@@ -15,6 +15,7 @@ import qualified Data.ByteString.Lazy as LBS
1515import qualified Data.List as List
1616import qualified Data.Map as Map
1717import Data.Monoid ((<>))
18+import qualified Data.Name as Name
1819import qualified Data.Text as Text
1920import qualified Data.Text.Encoding as Text
2021import qualified System.Console.Haskeline as Repl
@@ -25,7 +26,6 @@ import qualified System.IO as IO
2526import qualified System.Process as Proc
2627
2728import qualified Elm.Compiler as Elm (version)
28−import qualified Elm.Name as N
2929import qualified Elm.Project as Project
3030import qualified Elm.Package as Pkg
3131import qualified Elm.PerUserCache as PerUserCache
@@ -151,7 +151,7 @@ report msg =
151151 return Nothing
152152
153153
154−data Output = None | Def N.Name | Expr Text.Text
154+data Output = None | Def Name.Name | Expr Text.Text
155155
156156
157157interpret :: Output -> State -> Runner (Maybe a)
@@ -220,9 +220,9 @@ toInput string =
220220data State =
221221 State
222222 { _count :: !Int
223− , _imports :: Map.Map N.Name Text.Text
224− , _types :: Map.Map N.Name Text.Text
225− , _defs :: Map.Map N.Name Text.Text
223+ , _imports :: Map.Map Name.Name Text.Text
224+ , _types :: Map.Map Name.Name Text.Text
225+ , _defs :: Map.Map Name.Name Text.Text
226226 , _tricks :: [Text.Text]
227227 , _localizer :: L.Localizer
228228 }
@@ -237,7 +237,7 @@ compile :: Bool -> Output -> State -> Task.Task (Maybe FilePath)
237237compile noColors output (State count imports types defs tricks localizer) =
238238 let
239239 header =
240− "module " <> N.toBuilder N.replModule <> " exposing (..)\n\n"
240+ "module " <> Name.toBuilder Name.replModule <> " exposing (..)\n\n"
241241
242242 elmSourceCode =
243243 (<>) header $
@@ -259,14 +259,14 @@ compile noColors output (State count imports types defs tricks localizer) =
259259
260260 Expr expr ->
261261 let
262− name = N.addIndex "repl_value_" count
262+ name = Name.fromReplCount count
263263 text = Text.replace "\n" "\n " expr
264− def = N.toBuilder name <> " =\n " <> Text.encodeUtf8Builder text <> "\n"
264+ def = Name.toBuilder name <> " =\n " <> Text.encodeUtf8Builder text <> "\n"
265265 in
266266 compileForRepl (elmSourceCode <> def) (Just name)
267267
268268
269−addLines :: Map.Map N.Name Text.Text -> B.Builder -> B.Builder
269+addLines :: Map.Map Name.Name Text.Text -> B.Builder -> B.Builder
270270addLines dict builder =
271271 Map.foldr (\text b -> Text.encodeUtf8Builder text <> "\n" <> b) builder dict
272272
@@ -296,19 +296,19 @@ lookupCompletions string =
296296 addMatches string False commands []
297297
298298
299−commands :: Map.Map N.Name ()
299+commands :: Map.Map Name.Name ()
300300commands =
301301 Map.fromList [ (":exit", ()), (":quit", ()), (":reset", ()), (":help", ()) ]
302302
303303
304−addMatches :: String -> Bool -> Map.Map N.Name v -> [Repl.Completion] -> [Repl.Completion]
304+addMatches :: String -> Bool -> Map.Map Name.Name v -> [Repl.Completion] -> [Repl.Completion]
305305addMatches string isFinished dict completions =
306306 Map.foldrWithKey (addMatch string isFinished) completions dict
307307
308308
309−addMatch :: String -> Bool -> N.Name -> v -> [Repl.Completion] -> [Repl.Completion]
309+addMatch :: String -> Bool -> Name.Name -> v -> [Repl.Completion] -> [Repl.Completion]
310310addMatch string isFinished name _ completions =
311− let suggestion = N.toString name in
311+ let suggestion = Name.toString name in
312312 if List.isPrefixOf string suggestion then
313313 Repl.Completion suggestion suggestion isFinished : completions
314314 else