Skip to content

Commit d8fe2d4

Browse files
committed
Split CExpr and SExpr into different ADTs (WIP)
1 parent 0e6e527 commit d8fe2d4

File tree

8 files changed

+559
-1767
lines changed

8 files changed

+559
-1767
lines changed

dex.cabal

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ library
8282
, SourceIdTraversal
8383
, TopLevel
8484
-- , Transpose
85-
, Types.Core
85+
, Types.Simple
86+
, Types.Complicated
8687
, Types.Imp
8788
, Types.Primitives
8889
, Types.Source

src/lib/Core.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import qualified Data.Map.Strict as M
3535
import Name
3636
import Err
3737

38-
import Types.Core
38+
import Types.Complicated
39+
import Types.Simple
3940
import Types.Top
4041
import Types.Imp
4142
import Types.Primitives

src/lib/Name.hs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ import Control.Monad.Writer.Strict
2323
import Control.Monad.State.Strict
2424
import qualified Data.HashMap.Strict as HM
2525
import qualified Data.Map.Strict as M
26-
import Data.Bits
2726
import Data.Functor ((<&>))
2827
import Data.Foldable (toList, foldl')
29-
import Data.Maybe (fromJust, catMaybes)
3028
import Data.Hashable
3129
import Data.Kind (Type)
3230
import Data.Function ((&))
@@ -2192,7 +2190,7 @@ absurdNameFunction :: Name VoidS -> a
21922190
absurdNameFunction v = error $ "Void names shouldn't exist: " ++ show v
21932191

21942192
scopeFragToSubstFrag :: forall v i i' o
2195-
. (forall c. Name (i:=>:i') -> v o)
2193+
. (Name (i:=>:i') -> v o)
21962194
-> ScopeFrag i i' -> SubstFrag v i i' o
21972195
scopeFragToSubstFrag f (UnsafeScopeFromSubst m) = fmapSubstFrag (\n _ -> f n) m
21982196

@@ -2220,7 +2218,7 @@ newNames n = do
22202218
let bs = unsafeListToNest $ map UnsafeMakeBinder ns
22212219
unsafeCoerceE $ Abs bs $ ListE vs
22222220

2223-
withFresh :: forall n c a. (Distinct n)
2221+
withFresh :: forall n a. (Distinct n)
22242222
=> NameHint -> Scope n
22252223
-> (forall l. DExt n l => NameBinder n l -> a) -> a
22262224
withFresh hint (Scope (UnsafeMakeScopeFrag scope)) cont =
@@ -2749,7 +2747,7 @@ instance BindsNames (SubstPair v o) where
27492747

27502748
-- === instances ===
27512749

2752-
instance (forall c. Pretty (v n)) => Pretty (SubstItem v n) where
2750+
instance Pretty (v n) => Pretty (SubstItem v n) where
27532751
pretty (SubstItem _ val) = pretty val
27542752

27552753
instance SinkableE v => SinkableE (SubstFrag v i i') where

src/lib/QueryTypePure.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
module QueryTypePure where
88

99
import Types.Primitives
10-
import Types.Core
10+
import Types.Simple
11+
import Types.Complicated
1112
import Types.Top
1213
import Name
1314

0 commit comments

Comments
 (0)