on master help sign in
Switch Text to N.Name in Type.Type and Type.State
f3ae567Evan Czaplicki
src/Type/State.hs+3−3
@@ -21,9 +21,9 @@ import Control.Monad (forM_, liftM, liftM2, liftM3)
21import Control.Monad.Trans (MonadIO, liftIO)
21import Control.Monad.Trans (MonadIO, liftIO)
22import qualified Data.Map.Strict as Map
22import qualified Data.Map.Strict as Map
23import Data.Map.Strict ((!))
23import Data.Map.Strict ((!))
24−import Data.Text (Text)
25import qualified Data.Vector.Mutable as MVector
24import qualified Data.Vector.Mutable as MVector
26
25
26+import qualified Elm.Name as N
27import qualified Reporting.Annotation as A
27import qualified Reporting.Annotation as A
28import qualified Reporting.Error.Type as Error
28import qualified Reporting.Error.Type as Error
29import qualified Reporting.Region as R
29import qualified Reporting.Region as R
@@ -53,7 +53,7 @@ data State =
53type Pools = MVector.IOVector [Variable]
53type Pools = MVector.IOVector [Variable]
54
54
55
55
56−type Env = Map.Map Text (A.Located Variable)
56+type Env = Map.Map N.Name (A.Located Variable)
57
57
58
58
59
59
@@ -137,7 +137,7 @@ flatten tipe =
137 return (var, state)
137 return (var, state)
138
138
139
139
140−flattenHelp :: Int -> Pools -> Map.Map Text Variable -> Type -> IO Variable
140+flattenHelp :: Int -> Pools -> Map.Map N.Name Variable -> Type -> IO Variable
141flattenHelp maxRank pools aliasDict tipe =
141flattenHelp maxRank pools aliasDict tipe =
142 case tipe of
142 case tipe of
143 PlaceHolder name ->
143 PlaceHolder name ->
src/Type/Type.hs+9−9
@@ -53,19 +53,19 @@ data FlatType
53 = App1 ModuleName.Canonical N.Name [Variable]
53 = App1 ModuleName.Canonical N.Name [Variable]
54 | Fun1 Variable Variable
54 | Fun1 Variable Variable
55 | EmptyRecord1
55 | EmptyRecord1
56− | Record1 (Map.Map Text Variable) Variable
56+ | Record1 (Map.Map N.Name Variable) Variable
57 | Unit1
57 | Unit1
58 | Tuple1 Variable Variable (Maybe Variable)
58 | Tuple1 Variable Variable (Maybe Variable)
59
59
60
60
61data Type
61data Type
62− = PlaceHolder Text
62+ = PlaceHolder N.Name
63− | AliasN ModuleName.Canonical N.Name [(Text, Type)] Type
63+ | AliasN ModuleName.Canonical N.Name [(N.Name, Type)] Type
64 | VarN Variable
64 | VarN Variable
65 | AppN ModuleName.Canonical N.Name [Type]
65 | AppN ModuleName.Canonical N.Name [Type]
66 | FunN Type Type
66 | FunN Type Type
67 | EmptyRecordN
67 | EmptyRecordN
68− | RecordN (Map.Map Text Type) Type
68+ | RecordN (Map.Map N.Name Type) Type
69 | UnitN
69 | UnitN
70 | TupleN Type Type (Maybe Type)
70 | TupleN Type Type (Maybe Type)
71
71
@@ -84,12 +84,12 @@ data Descriptor =
84
84
85
85
86data Content
86data Content
87− = FlexVar (Maybe Text)
87+ = FlexVar (Maybe N.Name)
88− | FlexSuper T.Super (Maybe Text)
88+ | FlexSuper T.Super (Maybe N.Name)
89− | RigidVar Text
89+ | RigidVar N.Name
90− | RigidSuper T.Super Text
90+ | RigidSuper T.Super N.Name
91 | Structure FlatType
91 | Structure FlatType
92− | Alias ModuleName.Canonical N.Name [(Text,Variable)] Variable
92+ | Alias ModuleName.Canonical N.Name [(N.Name,Variable)] Variable
93 | Error Text
93 | Error Text
94
94
95
95