on master help sign in
Switch Elm/ to Data.Name if only needed qualifier changes
commitd331101c784837a54257a0f85ad44a10ef60cb35 authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 19 Nov 2018, 13:37 (8 years ago) parent5fbf3b1
7 files changed+89−88
compiler/src/Elm/Compiler/Imports.hs+13−12 compiler/src/Elm/Compiler/Objects.hs+7−7 compiler/src/Elm/Compiler/Type.hs+11−11 compiler/src/Elm/Compiler/Type/Extract.hs+5−5 compiler/src/Elm/Docs.hs+39−39 compiler/src/Elm/Header.hs+3−3 compiler/src/Elm/Interface.hs+11−11
compiler/src/Elm/Compiler/Imports.hs+13−12
@@ -6,9 +6,10 @@ module Elm.Compiler.Imports
66 where
77
88
9+import qualified Data.Name as Name
10+
911import qualified AST.Source as Src
1012import qualified AST.Module.Name as Module
11−import qualified Elm.Name as N
1213import qualified Elm.Package as Pkg
1314import qualified Reporting.Annotation as A
1415import qualified Reporting.Region as R
@@ -34,18 +35,18 @@ defaults =
3435 [ import_ Module.basics Nothing Src.Open
3536 , import_ Module.debug Nothing closed
3637 , import_ Module.list Nothing (operator "::")
37− , import_ Module.maybe Nothing (typeOpen N.maybe)
38− , import_ Module.result Nothing (typeOpen N.result)
39− , import_ Module.string Nothing (typeClosed N.string)
40− , import_ Module.char Nothing (typeClosed N.char)
38+ , import_ Module.maybe Nothing (typeOpen Name.maybe)
39+ , import_ Module.result Nothing (typeOpen Name.result)
40+ , import_ Module.string Nothing (typeClosed Name.string)
41+ , import_ Module.char Nothing (typeClosed Name.char)
4142 , import_ Module.tuple Nothing closed
42− , import_ Module.platform Nothing (typeClosed N.program)
43− , import_ Module.cmd (Just N.cmd) (typeClosed N.cmd)
44− , import_ Module.sub (Just N.sub) (typeClosed N.sub)
43+ , import_ Module.platform Nothing (typeClosed Name.program)
44+ , import_ Module.cmd (Just Name.cmd) (typeClosed Name.cmd)
45+ , import_ Module.sub (Just Name.sub) (typeClosed Name.sub)
4546 ]
4647
4748
48−import_ :: Module.Canonical -> Maybe N.Name -> Src.Exposing -> Src.Import
49+import_ :: Module.Canonical -> Maybe Name.Name -> Src.Exposing -> Src.Import
4950import_ (Module.Canonical _ name) maybeAlias exposing =
5051 Src.Import (A.At R.zero name) maybeAlias exposing
5152
@@ -59,16 +60,16 @@ closed =
5960 Src.Explicit []
6061
6162
62−typeOpen :: N.Name -> Src.Exposing
63+typeOpen :: Name.Name -> Src.Exposing
6364typeOpen name =
6465 Src.Explicit [ A.At R.zero (Src.Upper name Src.Public) ]
6566
6667
67−typeClosed :: N.Name -> Src.Exposing
68+typeClosed :: Name.Name -> Src.Exposing
6869typeClosed name =
6970 Src.Explicit [ A.At R.zero (Src.Upper name Src.Private) ]
7071
7172
72−operator :: N.Name -> Src.Exposing
73+operator :: Name.Name -> Src.Exposing
7374operator op =
7475 Src.Explicit [ A.At R.zero (Src.Operator op) ]
compiler/src/Elm/Compiler/Objects.hs+7−7
@@ -15,10 +15,10 @@ module Elm.Compiler.Objects
1515
1616import qualified Data.List as List
1717import qualified Data.Map as Map
18+import qualified Data.Name as Name
1819
1920import qualified AST.Optimized as Opt
2021import qualified AST.Module.Name as ModuleName
21−import qualified Elm.Name as N
2222import qualified Elm.Package as Pkg
2323import qualified Generate.JavaScript as JS
2424
@@ -62,7 +62,7 @@ data Kernel =
6262 }
6363
6464
65−fromKernels :: Map.Map N.Name Kernel -> Opt.Graph
65+fromKernels :: Map.Map Name.Name Kernel -> Opt.Graph
6666fromKernels kernels =
6767 Opt.Graph
6868 Map.empty
@@ -74,9 +74,9 @@ fromKernels kernels =
7474-- KERNEL TO NODES
7575
7676
77−toGlobal :: N.Name -> Opt.Global
77+toGlobal :: Name.Name -> Opt.Global
7878toGlobal home =
79− Opt.Global (ModuleName.Canonical Pkg.kernel (ModuleName.getKernel home)) N.dollar
79+ Opt.Global (ModuleName.Canonical Pkg.kernel (Name.getKernel home)) Name.dollar
8080
8181
8282toNode :: Kernel -> Opt.Node
@@ -88,17 +88,17 @@ toNode (Kernel client server) =
8888-- KERNEL TO ELM FIELDS
8989
9090
91−addKernel :: Map.Map N.Name Int -> Kernel -> Map.Map N.Name Int
91+addKernel :: Map.Map Name.Name Int -> Kernel -> Map.Map Name.Name Int
9292addKernel fields (Kernel client maybeServer) =
9393 addContent (maybe fields (addContent fields) maybeServer) client
9494
9595
96−addContent :: Map.Map N.Name Int -> Opt.KContent -> Map.Map N.Name Int
96+addContent :: Map.Map Name.Name Int -> Opt.KContent -> Map.Map Name.Name Int
9797addContent fields (Opt.KContent chunks _) =
9898 List.foldl' addChunk fields chunks
9999
100100
101−addChunk :: Map.Map N.Name Int -> Opt.KChunk -> Map.Map N.Name Int
101+addChunk :: Map.Map Name.Name Int -> Opt.KChunk -> Map.Map Name.Name Int
102102addChunk fields chunk =
103103 case chunk of
104104 Opt.ElmField name ->
compiler/src/Elm/Compiler/Type.hs+11−11
@@ -14,11 +14,11 @@ module Elm.Compiler.Type
1414 where
1515
1616
17+import qualified Data.Name as Name
1718import qualified Data.Text as Text
1819import qualified Data.Text.Encoding as Text
1920
2021import qualified AST.Source as Src
21−import qualified Elm.Name as N
2222import qualified Parse.Primitives as Parse
2323import qualified Parse.Type as Type
2424import qualified Reporting.Annotation as A
@@ -37,9 +37,9 @@ import Json.Encode ((==>))
3737
3838data Type
3939 = Lambda Type Type
40− | Var N.Name
41− | Type N.Name [Type]
42− | Record [(N.Name, Type)] (Maybe N.Name)
40+ | Var Name.Name
41+ | Type Name.Name [Type]
42+ | Record [(Name.Name, Type)] (Maybe Name.Name)
4343 | Unit
4444 | Tuple Type Type [Type]
4545
@@ -52,8 +52,8 @@ data DebugMetadata =
5252 }
5353
5454
55−data Alias = Alias N.Name [N.Name] Type
56−data Union = Union N.Name [N.Name] [(N.Name, [Type])]
55+data Alias = Alias Name.Name [Name.Name] Type
56+data Union = Union Name.Name [Name.Name] [(Name.Name, [Type])]
5757
5858
5959
@@ -94,7 +94,7 @@ toDoc localizer context tipe =
9494 (fmap D.fromName ext)
9595
9696
97−entryToDoc :: L.Localizer -> (N.Name, Type) -> (D.Doc, D.Doc)
97+entryToDoc :: L.Localizer -> (Name.Name, Type) -> (D.Doc, D.Doc)
9898entryToDoc localizer (field, fieldType) =
9999 ( D.fromName field, toDoc localizer RT.None fieldType )
100100
@@ -175,7 +175,7 @@ encodeMetadata (DebugMetadata msg aliases unions) =
175175
176176toAliasField :: Alias -> ( Text.Text, Encode.Value )
177177toAliasField (Alias name args tipe) =
178− N.toText name ==>
178+ Name.toText name ==>
179179 Encode.object
180180 [ "args" ==> Encode.list Encode.name args
181181 , "type" ==> encode tipe
@@ -184,13 +184,13 @@ toAliasField (Alias name args tipe) =
184184
185185toUnionField :: Union -> ( Text.Text, Encode.Value )
186186toUnionField (Union name args constructors) =
187− N.toText name ==>
187+ Name.toText name ==>
188188 Encode.object
189189 [ "args" ==> Encode.list Encode.name args
190190 , "tags" ==> Encode.object (map toCtorObject constructors)
191191 ]
192192
193193
194−toCtorObject :: (N.Name, [Type]) -> ( Text.Text, Encode.Value )
194+toCtorObject :: (Name.Name, [Type]) -> ( Text.Text, Encode.Value )
195195toCtorObject (name, args) =
196− N.toText name ==> Encode.list encode args
196+ Name.toText name ==> Encode.list encode args
compiler/src/Elm/Compiler/Type/Extract.hs+5−5
@@ -11,6 +11,7 @@ module Elm.Compiler.Type.Extract
1111
1212import Data.Map ((!))
1313import qualified Data.Maybe as Maybe
14+import qualified Data.Name as Name
1415import qualified Data.Set as Set
1516
1617import qualified AST.Canonical as Can
@@ -19,7 +20,6 @@ import qualified AST.Module.Name as ModuleName
1920import qualified AST.Utils.Type as Type
2021import qualified Elm.Compiler.Type as T
2122import qualified Elm.Interface as I
22−import qualified Elm.Name as N
2323
2424
2525
@@ -71,9 +71,9 @@ extract astType =
7171 <$> traverse (extract . snd) args
7272
7373
74−toPublicName :: ModuleName.Canonical -> N.Name -> N.Name
74+toPublicName :: ModuleName.Canonical -> Name.Name -> Name.Name
7575toPublicName (ModuleName.Canonical _ home) name =
76− N.sepBy 0x2E {- . -} home name
76+ Name.sepBy 0x2E {- . -} home name
7777
7878
7979
@@ -129,7 +129,7 @@ extractAlias interfaces (Opt.Global home name) =
129129
130130extractUnion :: I.Interfaces -> Opt.Global -> Extractor T.Union
131131extractUnion interfaces (Opt.Global home name) =
132− if name == N.list && home == ModuleName.list
132+ if name == Name.list && home == ModuleName.list
133133 then return $ T.Union (toPublicName home name) ["a"] []
134134 else
135135 let
@@ -141,7 +141,7 @@ extractUnion interfaces (Opt.Global home name) =
141141 T.Union pname vars <$> traverse extractCtor ctors
142142
143143
144−extractCtor :: Can.Ctor -> Extractor (N.Name, [T.Type])
144+extractCtor :: Can.Ctor -> Extractor (Name.Name, [T.Type])
145145extractCtor (Can.Ctor ctor _ _ args) =
146146 (,) ctor <$> traverse extract args
147147
compiler/src/Elm/Docs.hs+39−39
@@ -22,6 +22,7 @@ import qualified Data.ByteString as B
2222import qualified Data.List as List
2323import Data.Map ((!))
2424import qualified Data.Map as Map
25+import qualified Data.Name as Name
2526import qualified Data.Text as Text
2627import qualified Data.Text.Encoding as Text
2728
@@ -32,7 +33,6 @@ import qualified Data.OneOrMore as OneOrMore
3233import qualified Elm.Compiler.Module as Module
3334import qualified Elm.Compiler.Type as Type
3435import qualified Elm.Compiler.Type.Extract as Extract
35−import qualified Elm.Name as N
3636import qualified Json.Decode as D
3737import qualified Json.Encode as E
3838import Json.Encode ((==>))
@@ -53,7 +53,7 @@ import qualified Parse.Primitives.Whitespace as W
5353
5454
5555type Documentation =
56− Map.Map N.Name Module
56+ Map.Map Name.Name Module
5757
5858
5959toDict :: [Module] -> Documentation
@@ -62,7 +62,7 @@ toDict modules =
6262
6363
6464
65−toPair :: Module -> (N.Name, Module)
65+toPair :: Module -> (Name.Name, Module)
6666toPair modul@(Module name _ _ _ _ _) =
6767 (name, modul)
6868
@@ -73,20 +73,20 @@ toPair modul@(Module name _ _ _ _ _) =
7373
7474data Module =
7575 Module
76− { _name :: N.Name
76+ { _name :: Name.Name
7777 , _comment :: Comment
78− , _unions :: Map.Map N.Name Union
79− , _aliases :: Map.Map N.Name Alias
80− , _values :: Map.Map N.Name Value
81− , _binops :: Map.Map N.Name Binop
78+ , _unions :: Map.Map Name.Name Union
79+ , _aliases :: Map.Map Name.Name Alias
80+ , _values :: Map.Map Name.Name Value
81+ , _binops :: Map.Map Name.Name Binop
8282 }
8383
8484
8585type Comment = Text.Text
8686
8787
88−data Alias = Alias Comment [N.Name] Type.Type
89−data Union = Union Comment [N.Name] [(N.Name, [Type.Type])]
88+data Alias = Alias Comment [Name.Name] Type.Type
89+data Union = Union Comment [Name.Name] [(Name.Name, [Type.Type])]
9090data Value = Value Comment Type.Type
9191data Binop = Binop Comment Type.Type Binop.Associativity Binop.Precedence
9292
@@ -124,19 +124,19 @@ decoder =
124124 <*> D.field "binops" (dictDecoder binop)
125125
126126
127−dictDecoder :: D.Decoder Error a -> D.Decoder Error (Map.Map N.Name a)
127+dictDecoder :: D.Decoder Error a -> D.Decoder Error (Map.Map Name.Name a)
128128dictDecoder entryDecoder =
129129 Map.fromList <$> D.list (named entryDecoder)
130130
131131
132−named :: D.Decoder Error a -> D.Decoder Error (N.Name, a)
132+named :: D.Decoder Error a -> D.Decoder Error (Name.Name, a)
133133named entryDecoder =
134134 (,)
135135 <$> D.field "name" D.name
136136 <*> entryDecoder
137137
138138
139−nameDecoder :: D.Decoder Error N.Name
139+nameDecoder :: D.Decoder Error Name.Name
140140nameDecoder =
141141 D.mapError (const BadName) Module.decoder
142142
@@ -150,7 +150,7 @@ typeDecoder =
150150-- UNION JSON
151151
152152
153−encodeUnion :: (N.Name, Union) -> E.Value
153+encodeUnion :: (Name.Name, Union) -> E.Value
154154encodeUnion (name, Union comment args cases) =
155155 E.object
156156 [ "name" ==> E.name name
@@ -168,12 +168,12 @@ union =
168168 <*> D.field "cases" (D.list caseDecoder)
169169
170170
171−encodeCase :: ( N.Name, [Type.Type] ) -> E.Value
171+encodeCase :: ( Name.Name, [Type.Type] ) -> E.Value
172172encodeCase ( tag, args ) =
173173 E.list id [ E.name tag, E.list Type.encode args ]
174174
175175
176−caseDecoder :: D.Decoder Error ( N.Name, [Type.Type] )
176+caseDecoder :: D.Decoder Error ( Name.Name, [Type.Type] )
177177caseDecoder =
178178 D.pair D.name (D.list typeDecoder)
179179
@@ -182,7 +182,7 @@ caseDecoder =
182182-- ALIAS JSON
183183
184184
185−encodeAlias :: (N.Name, Alias) -> E.Value
185+encodeAlias :: (Name.Name, Alias) -> E.Value
186186encodeAlias ( name, Alias comment args tipe) =
187187 E.object
188188 [ "name" ==> E.name name
@@ -204,7 +204,7 @@ alias =
204204-- VALUE JSON
205205
206206
207−encodeValue :: (N.Name, Value) -> E.Value
207+encodeValue :: (Name.Name, Value) -> E.Value
208208encodeValue (name, Value comment tipe) =
209209 E.object
210210 [ "name" ==> E.name name
@@ -224,7 +224,7 @@ value =
224224-- BINOP JSON
225225
226226
227−encodeBinop :: (N.Name, Binop) -> E.Value
227+encodeBinop :: (Name.Name, Binop) -> E.Value
228228encodeBinop (name, Binop comment tipe assoc prec) =
229229 E.object
230230 [ "name" ==> E.name name
@@ -314,7 +314,7 @@ emptyModule (ModuleName.Canonical _ name) overview =
314314-- PARSE OVERVIEW
315315
316316
317−parseOverview :: R.Region -> B.ByteString -> Result.Result i w Error.Error [A.Located N.Name]
317+parseOverview :: R.Region -> B.ByteString -> Result.Result i w Error.Error [A.Located Name.Name]
318318parseOverview (R.Region (R.Position row col) _) overview =
319319 case P.runAt row (col + 3) (chompOverview []) overview of
320320 Left err ->
@@ -324,7 +324,7 @@ parseOverview (R.Region (R.Position row col) _) overview =
324324 Result.ok names
325325
326326
327−chompOverview :: [A.Located N.Name] -> Parser [A.Located N.Name]
327+chompOverview :: [A.Located Name.Name] -> Parser [A.Located Name.Name]
328328chompOverview names =
329329 do isDocs <- W.chompUntilDocs
330330 if isDocs
@@ -332,7 +332,7 @@ chompOverview names =
332332 else return names
333333
334334
335−chompOverviewHelp :: [A.Located N.Name] -> Parser [A.Located N.Name]
335+chompOverviewHelp :: [A.Located Name.Name] -> Parser [A.Located Name.Name]
336336chompOverviewHelp names =
337337 do pos <- P.getPosition
338338 (W.SPos spos) <- W.whitespace
@@ -341,7 +341,7 @@ chompOverviewHelp names =
341341 else chompOverview =<< chompDocs names
342342
343343
344−chompDocs :: [A.Located N.Name] -> Parser [A.Located N.Name]
344+chompDocs :: [A.Located Name.Name] -> Parser [A.Located Name.Name]
345345chompDocs names =
346346 do name <- P.addLocation (P.oneOf [ Var.lower, Var.upper, chompBinop ])
347347 spos <- W.whitespace
@@ -354,7 +354,7 @@ chompDocs names =
354354 ]
355355
356356
357−chompBinop :: Parser N.Name
357+chompBinop :: Parser Name.Name
358358chompBinop =
359359 do Symbol.leftParen
360360 name <- Symbol.binop
@@ -371,10 +371,10 @@ type Result i w a =
371371
372372
373373type Dups =
374− Map.Map N.Name (OneOrMore.OneOrMore R.Region)
374+ Map.Map Name.Name (OneOrMore.OneOrMore R.Region)
375375
376376
377−checkNames :: Map.Map N.Name (A.Located Can.Export) -> [A.Located N.Name] -> Result i w ()
377+checkNames :: Map.Map Name.Name (A.Located Can.Export) -> [A.Located Name.Name] -> Result i w ()
378378checkNames exports names =
379379 do docs <- Map.traverseWithKey isUnique (List.foldl' addName Map.empty names)
380380 let overlap = Map.size (Map.intersection docs exports)
@@ -386,12 +386,12 @@ checkNames exports names =
386386 Result.ok ()
387387
388388
389−addName :: Dups -> A.Located N.Name -> Dups
389+addName :: Dups -> A.Located Name.Name -> Dups
390390addName dict (A.At region name) =
391391 Map.insertWith OneOrMore.more name (OneOrMore.one region) dict
392392
393393
394−isUnique :: N.Name -> OneOrMore.OneOrMore R.Region -> Result i w R.Region
394+isUnique :: Name.Name -> OneOrMore.OneOrMore R.Region -> Result i w R.Region
395395isUnique name regions =
396396 case regions of
397397 OneOrMore.One region ->
@@ -402,12 +402,12 @@ isUnique name regions =
402402 Result.throw (E.Duplicate name r1 r2)
403403
404404
405−onlyInDocs :: N.Name -> R.Region -> Result i w a
405+onlyInDocs :: Name.Name -> R.Region -> Result i w a
406406onlyInDocs name region =
407407 Result.throw $ E.OnlyInDocs name region
408408
409409
410−onlyInExports :: N.Name -> A.Located Can.Export -> Result i w a
410+onlyInExports :: Name.Name -> A.Located Can.Export -> Result i w a
411411onlyInExports name (A.At region _) =
412412 Result.throw $ E.OnlyInExports name region
413413
@@ -418,16 +418,16 @@ onlyInExports name (A.At region _) =
418418
419419data Info =
420420 Info
421− { _iComments :: Map.Map N.Name Comment
421+ { _iComments :: Map.Map Name.Name Comment
422422 , _iValues :: Types
423− , _iUnions :: Map.Map N.Name Can.Union
424− , _iAliases :: Map.Map N.Name Can.Alias
425− , _iBinops :: Map.Map N.Name Can.Binop
423+ , _iUnions :: Map.Map Name.Name Can.Union
424+ , _iAliases :: Map.Map Name.Name Can.Alias
425+ , _iBinops :: Map.Map Name.Name Can.Binop
426426 , _iEffects :: Can.Effects
427427 }
428428
429429
430−checkExport :: Info -> N.Name -> A.Located Can.Export -> Result i w (Module -> Module)
430+checkExport :: Info -> Name.Name -> A.Located Can.Export -> Result i w (Module -> Module)
431431checkExport info name (A.At region export) =
432432 case export of
433433 Can.ExportValue ->
@@ -468,7 +468,7 @@ checkExport info name (A.At region export) =
468468 m { _values = Map.insert name (Value comment tipe) (_values m) }
469469
470470
471−getComment :: R.Region -> N.Name -> Info -> Result i w Comment
471+getComment :: R.Region -> Name.Name -> Info -> Result i w Comment
472472getComment region name info =
473473 case Map.lookup name (_iComments info) of
474474 Nothing ->
@@ -478,7 +478,7 @@ getComment region name info =
478478 Result.ok comment
479479
480480
481−getType :: N.Name -> Info -> Result i w Type.Type
481+getType :: Name.Name -> Info -> Result i w Type.Type
482482getType name info =
483483 case _iValues info ! name of
484484 A.At defRegion Nothing ->
@@ -488,7 +488,7 @@ getType name info =
488488 Result.ok (Extract.fromType tipe)
489489
490490
491−dector :: Can.Ctor -> (N.Name, [Type.Type])
491+dector :: Can.Ctor -> (Name.Name, [Type.Type])
492492dector (Can.Ctor name _ _ args) =
493493 ( name, map Extract.fromType args )
494494
@@ -498,7 +498,7 @@ dector (Can.Ctor name _ _ args) =
498498
499499
500500type Types =
501− Map.Map N.Name (A.Located (Maybe Can.Type))
501+ Map.Map Name.Name (A.Located (Maybe Can.Type))
502502
503503
504504gatherTypes :: Can.Decls -> Types -> Types
compiler/src/Elm/Header.hs+3−3
@@ -7,10 +7,10 @@ module Elm.Header
77
88
99import qualified Data.ByteString as B
10+import qualified Data.Name as Name
1011
1112import qualified AST.Source as Src
1213import qualified Elm.Compiler.Module as M
13−import qualified Elm.Name as N
1414import qualified Elm.Package as Pkg
1515import qualified Parse.Primitives as Parser
1616import qualified Parse.Module as Module
@@ -46,7 +46,7 @@ parse pkgName sourceCode =
4646 Left (Error.Syntax err)
4747
4848
49−getName :: Src.Import -> N.Name
49+getName :: Src.Import -> Name.Name
5050getName (Src.Import (A.At _ name) _ _) =
5151 name
5252
@@ -55,7 +55,7 @@ getName (Src.Import (A.At _ name) _ _) =
5555-- TO HEADER
5656
5757
58−simplifyHeader :: Src.Header -> (Tag, N.Name)
58+simplifyHeader :: Src.Header -> (Tag, Name.Name)
5959simplifyHeader (Src.Header name effects _ _) =
6060 ( toTag effects, name )
6161
compiler/src/Elm/Interface.hs+11−11
@@ -19,11 +19,11 @@ import Data.Binary
1919import Data.Map ((!))
2020import qualified Data.Map as Map
2121import qualified Data.Map.Merge.Strict as Map
22+import qualified Data.Name as Name
2223
2324import qualified AST.Canonical as Can
2425import qualified AST.Module.Name as ModuleName
2526import qualified AST.Utils.Binop as Binop
26−import qualified Elm.Name as N
2727import qualified Reporting.Annotation as A
2828
2929
@@ -41,10 +41,10 @@ type Interfaces =
4141
4242data Interface =
4343 Interface
44− { _types :: Map.Map N.Name Can.Annotation
45− , _unions :: Map.Map N.Name Union
46− , _aliases :: Map.Map N.Name Alias
47− , _binops :: Map.Map N.Name Binop
44+ { _types :: Map.Map Name.Name Can.Annotation
45+ , _unions :: Map.Map Name.Name Union
46+ , _aliases :: Map.Map Name.Name Alias
47+ , _binops :: Map.Map Name.Name Binop
4848 }
4949
5050
@@ -61,7 +61,7 @@ data Alias
6161
6262data Binop =
6363 Binop
64− { _op_name :: N.Name
64+ { _op_name :: Name.Name
6565 , _op_annotation :: Can.Annotation
6666 , _op_associativity :: Binop.Associativity
6767 , _op_precedence :: Binop.Precedence
@@ -72,7 +72,7 @@ data Binop =
7272-- FROM MODULE
7373
7474
75−fromModule :: Map.Map N.Name Can.Annotation -> Can.Module -> Interface
75+fromModule :: Map.Map Name.Name Can.Annotation -> Can.Module -> Interface
7676fromModule types (Can.Module _ _ exports _ unions aliases binops _) =
7777 Interface
7878 { _types = privatize exports types
@@ -82,7 +82,7 @@ fromModule types (Can.Module _ _ exports _ unions aliases binops _) =
8282 }
8383
8484
85−privatize :: Can.Exports -> Map.Map N.Name a -> Map.Map N.Name a
85+privatize :: Can.Exports -> Map.Map Name.Name a -> Map.Map Name.Name a
8686privatize exports dict =
8787 case exports of
8888 Can.ExportEverything _ ->
@@ -92,12 +92,12 @@ privatize exports dict =
9292 Map.intersection dict explicitExports
9393
9494
95−toOp :: Map.Map N.Name Can.Annotation -> Can.Binop -> Binop
95+toOp :: Map.Map Name.Name Can.Annotation -> Can.Binop -> Binop
9696toOp types (Can.Binop_ associativity precedence name) =
9797 Binop name (types ! name) associativity precedence
9898
9999
100−privatizeUnions :: Can.Exports -> Map.Map N.Name Can.Union -> Map.Map N.Name Union
100+privatizeUnions :: Can.Exports -> Map.Map Name.Name Can.Union -> Map.Map Name.Name Union
101101privatizeUnions exports unions =
102102 case exports of
103103 Can.ExportEverything _ ->
@@ -115,7 +115,7 @@ privatizeUnions exports unions =
115115 _ -> error "impossible exports discovered in privatizeUnions"
116116
117117
118−privatizeAliases :: Can.Exports -> Map.Map N.Name Can.Alias -> Map.Map N.Name Alias
118+privatizeAliases :: Can.Exports -> Map.Map Name.Name Can.Alias -> Map.Map Name.Name Alias
119119privatizeAliases exports aliases =
120120 case exports of
121121 Can.ExportEverything _ ->