on master help sign in
Make some minor changes to get elm-make working
7e1de43Evan Czaplicki
src/Elm/Compiler.hs+3−2
@@ -12,6 +12,7 @@ import qualified Data.Aeson as Json
12import qualified Data.Map as Map
12import qualified Data.Map as Map
13
13
14import qualified AST.Module as Module
14import qualified AST.Module as Module
15+import qualified AST.Module.Name as ModuleName
15import qualified Compile
16import qualified Compile
16import qualified Docs.Check as Docs
17import qualified Docs.Check as Docs
17import qualified Elm.Compiler.Version
18import qualified Elm.Compiler.Version
@@ -91,7 +92,7 @@ data Context = Context
91 { _packageName :: Package.Name
92 { _packageName :: Package.Name
92 , _isRoot :: Bool
93 , _isRoot :: Bool
93 , _isExposed :: Bool
94 , _isExposed :: Bool
94− , _dependencies :: [PublicModule.Canonical]
95+ , _dependencies :: [PublicModule.CanonicalName]
95 }
96 }
96
97
97
98
@@ -115,7 +116,7 @@ docsGen isExposed modul =
115 Docs.check (Module.exports modul) (Module.docs modul)
116 Docs.check (Module.exports modul) (Module.docs modul)
116
117
117 name =
118 name =
118− PublicModule.Name (PublicModule._module (Module.name modul))
119+ PublicModule.Name (ModuleName._module (Module.name modul))
119
120
120 toDocs checked =
121 toDocs checked =
121 Docs.fromCheckedDocs name checked
122 Docs.fromCheckedDocs name checked
src/Elm/Compiler/Module.hs+24−14
@@ -1,12 +1,13 @@
1module Elm.Compiler.Module
1module Elm.Compiler.Module
2− ( Interface, Interfaces, Name(Name)
2+ ( Interface, Interfaces
3+ , Name(Name)
3 , nameToPath
4 , nameToPath
4 , nameToString, nameFromString
5 , nameToString, nameFromString
5 , hyphenate, dehyphenate
6 , hyphenate, dehyphenate
6 , defaultImports
7 , defaultImports
7 , interfacePorts
8 , interfacePorts
8 , interfaceAliasedTypes
9 , interfaceAliasedTypes
9− , ModuleName.Canonical(..)
10+ , CanonicalName, canonicalName
10 )
11 )
11 where
12 where
12
13
@@ -24,9 +25,10 @@ import qualified AST.Module.Name as ModuleName
24import qualified Elm.Compiler.Imports as Imports
25import qualified Elm.Compiler.Imports as Imports
25import qualified Elm.Compiler.Type as Type
26import qualified Elm.Compiler.Type as Type
26import qualified Elm.Compiler.Type.Extract as Extract
27import qualified Elm.Compiler.Type.Extract as Extract
28+import qualified Elm.Package as Package
27
29
28
30
29−-- EXPOSED TYPES
31+-- INTERFACES
30
32
31type Interface = Module.Interface
33type Interface = Module.Interface
32
34
@@ -34,17 +36,6 @@ type Interface = Module.Interface
34type Interfaces = Module.Interfaces
36type Interfaces = Module.Interfaces
35
37
36
38
37−newtype Name = Name ModuleName.Raw
38− deriving (Eq, Ord)
39−
40−
41−defaultImports :: [Name]
42−defaultImports =
43− map (Name . fst) Imports.defaults
44−
45−
46−-- POKING AROUND INTERFACES
47−
48interfacePorts :: Interface -> [String]
39interfacePorts :: Interface -> [String]
49interfacePorts interface =
40interfacePorts interface =
50 Module.iPorts interface
41 Module.iPorts interface
@@ -55,6 +46,25 @@ interfaceAliasedTypes interface =
55 Map.map Extract.toAliasedType (Module.iTypes interface)
46 Map.map Extract.toAliasedType (Module.iTypes interface)
56
47
57
48
49+-- NAMES
50+
51+newtype Name = Name ModuleName.Raw
52+ deriving (Eq, Ord)
53+
54+
55+type CanonicalName = ModuleName.Canonical
56+
57+
58+canonicalName :: Package.Name -> Name -> CanonicalName
59+canonicalName pkgName (Name name) =
60+ ModuleName.Canonical pkgName name
61+
62+
63+defaultImports :: [Name]
64+defaultImports =
65+ map (Name . fst) Imports.defaults
66+
67+
58-- STRING CONVERSIONS for NAMES
68-- STRING CONVERSIONS for NAMES
59
69
60nameToPath :: Name -> FilePath
70nameToPath :: Name -> FilePath