Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using State Monad in GHC Core Translation #213

Merged
merged 8 commits into from
Oct 8, 2023
Merged
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
3 changes: 3 additions & 0 deletions g2.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ library
, text-builder >= 0.6.6.1
, time >= 1.6 && <= 1.13
, unordered-containers >= 0.2.10.0 && < 0.3

-- remove this eventually
, deferred-folds <= 0.9.18.3

if flag(support-lh) && impl(ghc < 9.2)
build-depends: liquidhaskell >= 0.8.10.2 && <= 0.9.0.2.1
Expand Down
2 changes: 1 addition & 1 deletion src/G2/Initialization/KnownValues.hs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ superClassExtractor tc tc_n sc_n =
case lookupTCClass tc_n tc of
Just c
| Just (_, i) <- find extractsSC (superclasses c) -> idName i
| otherwise -> error $ "superClassExtractor: Extractor not found " ++ show (superclasses c)
| otherwise -> error $ "superClassExtractor: Extractor not found\n" ++ show sc_n ++ "\n" ++ show (superclasses c)
Nothing -> error $ "superClassExtractor: Class not found " ++ show tc_n
where
extractsSC (t, _) =
Expand Down
2 changes: 1 addition & 1 deletion src/G2/Language/TypeClasses/TypeClasses.hs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ initTypeClasses nsi =
ns = map (\(n, _, i, sc) -> (n, i, sc)) nsi
nsi' = filter (not . null . insts . snd)
$ map (\(n, i, sc) ->
(n, Class { insts = mapMaybe (nameIdToTypeId n) nsi
(n, Class { insts = nub $ mapMaybe (nameIdToTypeId n) nsi
, typ_ids = i
, superclasses = sc } )) ns
in
Expand Down
2 changes: 1 addition & 1 deletion src/G2/Liquid/Conversion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ rTyConType :: RTyCon -> [SpecType]-> LHStateM (Maybe Type)
rTyConType rtc sts = do
tenv <- typeEnv

let tcn = mkTyConName HM.empty . rtc_tc $ rtc
let tcn = mkTyConNameUnsafe . rtc_tc $ rtc
n = nameModMatch tcn tenv

ts <- mapM specTypeToType sts
Expand Down
2 changes: 1 addition & 1 deletion src/G2/Liquid/Measures.hs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ convertDefs :: [Type] -> Maybe Type -> LHDictMap -> BoundTypes -> Def SpecType G
convertDefs [l_t] ret m bt (Def { ctor = dc, body = b, binds = bds})
| TyCon _ _ <- tyAppCenter l_t
, st_t <- tyAppArgs l_t
, dc' <- mkData HM.empty HM.empty dc = do
, dc' <- mkDataUnsafe dc = do
tenv <- typeEnv
let
-- See [1] below, we only evaluate this if Just
Expand Down
Loading
Loading