Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 19 additions & 8 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@
#
# For more information, see https://github.com/haskell-CI/haskell-ci
#
# version: 0.19.20250531
# version: 0.19.20250917
#
# REGENDATA ("0.19.20250531",["github","cabal.project","--config=cabal.haskell-ci"])
# REGENDATA ("0.19.20250917",["github","cabal.project","--config=cabal.haskell-ci"])
#
name: Haskell-CI
on:
- push
- pull_request
push:
branches:
- main
pull_request:
branches:
- main
merge_group:
branches:
- main
jobs:
linux:
name: Haskell-CI - Linux - ${{ matrix.compiler }}
Expand Down Expand Up @@ -86,8 +93,8 @@ jobs:
chmod a+x "$HOME/.ghcup/bin/ghcup"
- name: Install cabal-install
run: |
"$HOME/.ghcup/bin/ghcup" install cabal 3.14.2.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.14.2.0 -vnormal+nowrap" >> "$GITHUB_ENV"
"$HOME/.ghcup/bin/ghcup" install cabal 3.16.0.0 || (cat "$HOME"/.ghcup/logs/*.* && false)
echo "CABAL=$HOME/.ghcup/bin/cabal-3.16.0.0 -vnormal+nowrap" >> "$GITHUB_ENV"
- name: Install GHC (GHCup)
if: matrix.setup-method == 'ghcup'
run: |
Expand Down Expand Up @@ -163,7 +170,7 @@ jobs:
chmod a+x $HOME/.cabal/bin/cabal-plan
cabal-plan --version
- name: checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
path: source
- name: initial cabal.project for sdist
Expand All @@ -188,7 +195,11 @@ jobs:
touch cabal.project.local
echo "packages: ${PKGDIR_gibbon}" >> cabal.project
echo "package gibbon" >> cabal.project
echo " ghc-options: -Werror=missing-methods" >> cabal.project
echo " ghc-options: -Werror=missing-methods -Werror=missing-fields" >> cabal.project
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo "package gibbon" >> cabal.project ; fi
if [ $((HCNUMVER >= 90400)) -ne 0 ] ; then echo " ghc-options: -Werror=unused-packages" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo "package gibbon" >> cabal.project ; fi
if [ $((HCNUMVER >= 90000)) -ne 0 ] ; then echo " ghc-options: -Werror=incomplete-patterns -Werror=incomplete-uni-patterns" >> cabal.project ; fi
cat >> cabal.project <<EOF
EOF
$HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(gibbon)$/; }' >> cabal.project.local
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ cabal.project.local~
.HTF/
.ghc.environment.*
stack*.yaml.lock
.vscode/*
.vscode/*
racket-*
1 change: 1 addition & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ no-tests-no-benchmarks: False
unconstrained: False
cabal-check: False
haddock: False
branches: main
8 changes: 2 additions & 6 deletions gibbon-compiler/gibbon.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ library
, language-c-quote >= 0.12.1 && < 1
, mainland-pretty >= 0.6.1 && < 1
, safe
, uuid
, hashable >= 1.4.5.0
-- Brings in lots of ekmett dependencies:
-- , either

Expand All @@ -156,8 +154,6 @@ executable gibbon
main-is: Frontend.hs

build-depends: base
, haskell-src-exts
, filepath
, gibbon

default-language: Haskell2010
Expand Down Expand Up @@ -197,12 +193,12 @@ test-suite test-gibbon
executable test-gibbon-examples
hs-source-dirs: tests
main-is: BenchRunner.hs
build-depends: gibbon,
base, containers, mtl, transformers,
build-depends: base, containers,
process, filepath, directory,
time, clock, text, bytestring,
yaml, optparse-applicative, scientific,
prettyprinter, prettyprinter-ansi-terminal
build-tool-depends: gibbon:gibbon

default-language: Haskell2010
other-modules: TestRunner
Expand Down
1 change: 1 addition & 0 deletions gibbon-compiler/src/Gibbon/Compiler.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
Expand Down
6 changes: 2 additions & 4 deletions gibbon-compiler/src/Gibbon/HaskellFrontend.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ module Gibbon.HaskellFrontend

import Control.Monad
import Data.Foldable ( foldrM )
#if !MIN_VERSION_base(4,21,0)
import Data.Foldable ( foldl' )
#endif
import Data.Maybe (catMaybes, isJust)
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.List as L
import qualified Safe as Sf

import Data.IORef
Expand Down Expand Up @@ -1411,7 +1409,7 @@ desugarLinearExts (Prog ddefs fundefs main) = do
case fn' of
Ext (LambdaE [(v,ProdTy tys)] bod) -> do
let ty = Sf.headErr tys
bod'' = foldl' (\acc i -> gSubstE (ProjE i (VarE v)) (VarE v) acc) bod [0..(length tys)]
bod'' = L.foldl' (\acc i -> gSubstE (ProjE i (VarE v)) (VarE v) acc) bod [0..(length tys)]
pure (LetE (v,[],ty,e) bod'')
_ -> error $ "desugarLinearExts: couldn't desugar " ++ sdoc ex
ReverseAppE fn arg -> do
Expand Down
1 change: 1 addition & 0 deletions gibbon-compiler/src/Gibbon/L0/Specialize2.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE CPP #-}
{-# LANGUAGE LambdaCase #-}
Expand Down
10 changes: 6 additions & 4 deletions gibbon-compiler/src/Gibbon/L0/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -506,8 +506,9 @@ recoverType ddfs env2 ex =
CharE _ -> CharTy
FloatE{} -> FloatTy
LitSymE _ -> IntTy
AppE v tyapps _ -> let (ForAll tyvars (ArrowTy _ retty)) = fEnv env2 # v
in substTyVar (M.fromList (fragileZip tyvars tyapps)) retty
AppE v tyapps _ -> case fEnv env2 # v of
(ForAll tyvars (ArrowTy _ retty)) -> substTyVar (M.fromList (fragileZip tyvars tyapps)) retty
ty -> error $ "Function applied with type arguments has an unexpected type. Got " ++ sdoc ty ++ " in function " ++ sdoc v
-- PrimAppE (DictInsertP ty) ((L _ (VarE v)):_) -> SymDictTy (Just v) ty
-- PrimAppE (DictEmptyP ty) ((L _ (VarE v)):_) -> SymDictTy (Just v) ty
PrimAppE p _ -> primRetTy1 p
Expand All @@ -525,8 +526,9 @@ recoverType ddfs env2 ex =
oth -> error$ "typeExp: Cannot project fields from this type: "++show oth
++"\nExpression:\n "++ sdoc ex
++"\nEnvironment:\n "++sdoc (vEnv env2)
SpawnE v tyapps _ -> let (ForAll tyvars (ArrowTy _ retty)) = fEnv env2 # v
in substTyVar (M.fromList (fragileZip tyvars tyapps)) retty
SpawnE v tyapps _ -> case fEnv env2 # v of
(ForAll tyvars (ArrowTy _ retty)) -> substTyVar (M.fromList (fragileZip tyvars tyapps)) retty
ty -> error $ "Spawned function has an unexpected type. Got " ++ sdoc ty ++ " in function " ++ sdoc v
SyncE -> voidTy0
CaseE _ mp ->
let (c,args,e) = Sf.headErr mp
Expand Down
Loading
Loading