on master help sign in
Use Data.Name in module names
commit270d8bd5ee93b959eeb0735d036a81b246c1bce1 authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 19 Nov 2018, 11:41 (8 years ago) parent4e94115
1 file changed+16−26
compiler/src/AST/Module/Name.hs+16−26
compiler/src/AST/Module/Name.hs+16−26
@@ -8,7 +8,7 @@ module AST.Module.Name
88 , virtualDom, debug, bitwise
99 , jsonDecode, jsonEncode
1010 , webgl, texture, vector2, vector3, vector4, matrix4
11− , isKernel, getKernel, canonicalIsKernel
11+ , canonicalIsKernel
1212 )
1313 where
1414
@@ -16,8 +16,8 @@ module AST.Module.Name
1616import Prelude hiding (maybe)
1717import Control.Monad (liftM2)
1818import Data.Binary
19+import qualified Data.Name as Name
1920
20−import qualified Elm.Name as N
2121import qualified Elm.Package as Pkg
2222
2323
@@ -28,7 +28,7 @@ import qualified Elm.Package as Pkg
2828data Canonical =
2929 Canonical
3030 { _package :: !Pkg.Name
31− , _module :: !N.Name
31+ , _module :: !Name.Name
3232 }
3333 deriving (Ord)
3434
@@ -49,12 +49,12 @@ basics = Canonical Pkg.core "Basics"
4949
5050{-# NOINLINE char #-}
5151char :: Canonical
52−char = Canonical Pkg.core N.char
52+char = Canonical Pkg.core Name.char
5353
5454
5555{-# NOINLINE string #-}
5656string :: Canonical
57−string = Canonical Pkg.core N.string
57+string = Canonical Pkg.core Name.string
5858
5959
6060
@@ -63,32 +63,32 @@ string = Canonical Pkg.core N.string
6363
6464{-# NOINLINE maybe #-}
6565maybe :: Canonical
66−maybe = Canonical Pkg.core N.maybe
66+maybe = Canonical Pkg.core Name.maybe
6767
6868
6969{-# NOINLINE result #-}
7070result :: Canonical
71−result = Canonical Pkg.core N.result
71+result = Canonical Pkg.core Name.result
7272
7373
7474{-# NOINLINE list #-}
7575list :: Canonical
76−list = Canonical Pkg.core N.list
76+list = Canonical Pkg.core Name.list
7777
7878
7979{-# NOINLINE array #-}
8080array :: Canonical
81−array = Canonical Pkg.core N.array
81+array = Canonical Pkg.core Name.array
8282
8383
8484{-# NOINLINE dict #-}
8585dict :: Canonical
86−dict = Canonical Pkg.core N.dict
86+dict = Canonical Pkg.core Name.dict
8787
8888
8989{-# NOINLINE tuple #-}
9090tuple :: Canonical
91−tuple = Canonical Pkg.core N.tuple
91+tuple = Canonical Pkg.core Name.tuple
9292
9393
9494
@@ -97,7 +97,7 @@ tuple = Canonical Pkg.core N.tuple
9797
9898{-# NOINLINE platform #-}
9999platform :: Canonical
100−platform = Canonical Pkg.core N.platform
100+platform = Canonical Pkg.core Name.platform
101101
102102
103103{-# NOINLINE cmd #-}
@@ -116,17 +116,17 @@ sub = Canonical Pkg.core "Platform.Sub"
116116
117117{-# NOINLINE virtualDom #-}
118118virtualDom :: Canonical
119−virtualDom = Canonical Pkg.virtualDom N.virtualDom
119+virtualDom = Canonical Pkg.virtualDom Name.virtualDom
120120
121121
122122{-# NOINLINE debug #-}
123123debug :: Canonical
124−debug = Canonical Pkg.core N.debug
124+debug = Canonical Pkg.core Name.debug
125125
126126
127127{-# NOINLINE bitwise #-}
128128bitwise :: Canonical
129−bitwise = Canonical Pkg.core N.bitwise
129+bitwise = Canonical Pkg.core Name.bitwise
130130
131131
132132
@@ -181,19 +181,9 @@ matrix4 = Canonical Pkg.linearAlgebra "Math.Matrix4"
181181-- IS KERNEL
182182
183183
184−isKernel :: N.Name -> Bool
185−isKernel name =
186− N.startsWith "Elm.Kernel." name
187−
188−
189−getKernel :: N.Name -> N.Name
190−getKernel name =
191− N.drop 11 name
192−
193−
194184canonicalIsKernel :: Canonical -> Bool
195185canonicalIsKernel (Canonical _ name) =
196− isKernel name
186+ Name.isKernel name
197187
198188
199189