on master help sign in
Switch Validate.hs to Data.Name
69224e3Evan Czaplicki
compiler/src/Validate.hs+5−5
@@ -9,11 +9,11 @@ module Validate
9import Control.Applicative (liftA2)
9import Control.Applicative (liftA2)
10import Control.Monad (forM_)
10import Control.Monad (forM_)
11import qualified Data.Map as Map
11import qualified Data.Map as Map
12+import qualified Data.Name as Name
12import Data.Text (Text)
13import Data.Text (Text)
13
14
14import qualified AST.Source as Src
15import qualified AST.Source as Src
15import qualified AST.Valid as Valid
16import qualified AST.Valid as Valid
16−import qualified Elm.Name as N
17import qualified Reporting.Annotation as A
17import qualified Reporting.Annotation as A
18import qualified Reporting.Error.Syntax as Error
18import qualified Reporting.Error.Syntax as Error
19import qualified Reporting.Region as R
19import qualified Reporting.Region as R
@@ -51,7 +51,7 @@ data Stuff =
51 , _aliases :: [Valid.Alias]
51 , _aliases :: [Valid.Alias]
52 , _binops :: [Valid.Binop]
52 , _binops :: [Valid.Binop]
53 , _ports :: [Valid.Port]
53 , _ports :: [Valid.Port]
54− , _docs :: Map.Map N.Name Text
54+ , _docs :: Map.Map Name.Name Text
55 }
55 }
56
56
57
57
@@ -111,7 +111,7 @@ validateDocs region docs decls stuff =
111 vsdHelp decls $ stuff { _docs = Map.insert name docs (_docs stuff) }
111 vsdHelp decls $ stuff { _docs = Map.insert name docs (_docs stuff) }
112
112
113
113
114−getNameForDocs :: R.Region -> Src.Decl_ -> Result i w N.Name
114+getNameForDocs :: R.Region -> Src.Decl_ -> Result i w Name.Name
115getNameForDocs region decl =
115getNameForDocs region decl =
116 case decl of
116 case decl of
117 Src.Union (A.At _ name) _ _ ->
117 Src.Union (A.At _ name) _ _ ->
@@ -140,7 +140,7 @@ getNameForDocs region decl =
140-- VALIDATE ANNOTATION
140-- VALIDATE ANNOTATION
141
141
142
142
143−validateAnnotation :: R.Region -> N.Name -> Src.Type -> [Src.Decl] -> Stuff -> Result i w Stuff
143+validateAnnotation :: R.Region -> Name.Name -> Src.Type -> [Src.Decl] -> Stuff -> Result i w Stuff
144validateAnnotation annRegion annotationName tipe decls stuff =
144validateAnnotation annRegion annotationName tipe decls stuff =
145 case decls of
145 case decls of
146 [] ->
146 [] ->
@@ -289,7 +289,7 @@ definitions sourceDefs =
289 Result.throw (Error.TypeWithoutDefinition annRegion annotationName)
289 Result.throw (Error.TypeWithoutDefinition annRegion annotationName)
290
290
291
291
292−validateDefinition :: R.Region -> A.Located N.Name -> [Src.Pattern] -> Src.Expr -> Maybe Src.Type -> Result i w Valid.Def
292+validateDefinition :: R.Region -> A.Located Name.Name -> [Src.Pattern] -> Src.Expr -> Maybe Src.Type -> Result i w Valid.Def
293validateDefinition region name args expr maybeType =
293validateDefinition region name args expr maybeType =
294 do validExpr <- expression expr
294 do validExpr <- expression expr
295 return $ Valid.Define region name args validExpr maybeType
295 return $ Valid.Define region name args validExpr maybeType