@@ -13,9 +13,9 @@ import qualified Data.Graph as Graph
1313import qualified Data.Map.Strict as Map
1414import qualified Data.Map.Merge.Strict as Map
1515
16−import qualified AST.Expression.Canonical as Can
17−import qualified AST.Expression.Valid as Valid
18−import qualified AST.Type as Type
16+import qualified AST.Canonical as Can
17+import qualified AST.Source as Src
18+import qualified AST.Valid as Valid
1919import qualified Canonicalize.Environment.Dups as Dups
2020import qualified Canonicalize.Environment.Internals as Env
2121import qualified Canonicalize.Type as Type
@@ -180,7 +180,7 @@ collectUpperVars (Valid.Module _ _ _ _ _ _ unions aliases _ _) =
180180
181181 aliasToInfos (Valid.Alias (A.A region name) _ (A.A _ tipe)) =
182182 case tipe of
183− Type.RRecord _ Nothing ->
183+ Src.TRecord _ Nothing ->
184184 [ Dups.info name region Error.RecordCtor () ]
185185
186186 _ ->
@@ -242,7 +242,7 @@ data Alias =
242242 { _region :: R.Region
243243 , _name :: N.Name
244244 , _args :: [N.Name]
245− , _type :: Type.Raw
245+ , _type :: Src.Type
246246 }
247247
248248
@@ -290,30 +290,30 @@ toNode alias@(Alias _ name _ tipe) =
290290 ( alias, name, Bag.toList (getEdges tipe) )
291291
292292
293−getEdges :: Type.Raw -> Bag.Bag N.Name
293+getEdges :: Src.Type -> Bag.Bag N.Name
294294getEdges (A.A _ tipe) =
295295 case tipe of
296− Type.RLambda arg result ->
296+ Src.TLambda arg result ->
297297 Bag.append (getEdges arg) (getEdges result)
298298
299− Type.RVar _ ->
299+ Src.TVar _ ->
300300 Bag.empty
301301
302− Type.RType _ Nothing name args ->
302+ Src.TType _ Nothing name args ->
303303 foldr Bag.append (Bag.one name) (map getEdges args)
304304
305− Type.RType _ (Just _) _ args ->
305+ Src.TType _ (Just _) _ args ->
306306 foldr Bag.append Bag.empty (map getEdges args)
307307
308− Type.RRecord fields ext ->
308+ Src.TRecord fields ext ->
309309 foldr Bag.append
310310 (maybe Bag.empty getEdges ext)
311311 (map (getEdges . snd) fields)
312312
313− Type.RUnit ->
313+ Src.TUnit ->
314314 Bag.empty
315315
316− Type.RTuple a b cs ->
316+ Src.TTuple a b cs ->
317317 foldr Bag.append
318318 (getEdges a)
319319 (getEdges b : map getEdges cs)
@@ -371,23 +371,23 @@ checkAliasFreeVars (Valid.Alias (A.A aliasRegion name) args tipe) =
371371 (map toLoc (Map.toList (Map.difference freeVars boundVars)))
372372
373373
374−addFreeVars :: Type.Raw -> Map.Map N.Name R.Region -> Map.Map N.Name R.Region
374+addFreeVars :: Src.Type -> Map.Map N.Name R.Region -> Map.Map N.Name R.Region
375375addFreeVars (A.A region tipe) freeVars =
376376 case tipe of
377− Type.RLambda arg result ->
377+ Src.TLambda arg result ->
378378 addFreeVars arg (addFreeVars result freeVars)
379379
380− Type.RVar name ->
380+ Src.TVar name ->
381381 Map.insert name region freeVars
382382
383− Type.RType _ _ _ args ->
383+ Src.TType _ _ _ args ->
384384 foldr addFreeVars freeVars args
385385
386− Type.RRecord fields ext ->
386+ Src.TRecord fields ext ->
387387 foldr addFreeVars (maybe id addFreeVars ext freeVars) (map snd fields)
388388
389− Type.RUnit ->
389+ Src.TUnit ->
390390 freeVars
391391
392− Type.RTuple a b cs ->
392+ Src.TTuple a b cs ->
393393 foldr addFreeVars freeVars (a:b:cs)