on master help sign in
Properly import the Text type by default
commitbf9573cb69b028c7fb824ee562048bccf653ffb5 authorEvan Czaplicki <info@elm-lang.org> dateSun 15 Jun 2014, 16:21 (12 years ago) parent4c7ff93
2 files changed+6−4
compiler/AST/Module.hs+2−2 compiler/Metadata/Prelude.hs+4−2
compiler/AST/Module.hs+2−2
@@ -91,8 +91,8 @@ data ImportMethod
9191open :: ImportMethod
9292open = Open (Var.openListing)
9393
94−importing :: [String] -> ImportMethod
95−importing xs = Open (Var.Listing (map Var.Value xs) False)
94+importing :: [Var.Value] -> ImportMethod
95+importing xs = Open (Var.Listing xs False)
9696
9797instance Binary ImportMethod where
9898 put method =
compiler/Metadata/Prelude.hs+4−2
@@ -6,6 +6,7 @@ import qualified Control.Exception as E
66import System.Exit
77import System.IO
88import AST.Module as Module
9+import qualified AST.Variable as Var
910import qualified Build.Interface as Interface
1011import Build.Utils (getDataFile)
1112
@@ -23,15 +24,16 @@ add noPrelude (Module name path exs ims decls) =
2324prelude :: [(String, ImportMethod)]
2425prelude = text : string : map (\n -> (n, Module.open)) modules
2526 where
26− string = ("String", Module.importing ["show"])
27+ string = ("String", Module.importing [Var.Value "show"])
2728 modules = [ "Basics", "Signal", "List", "Maybe", "Time", "Color"
2829 , "Graphics.Element", "Graphics.Collage"
2930 , "Native.Ports", "Native.Json"
3031 ]
3132 text = ("Text", Module.importing textImports)
3233 textImports =
34+ Var.ADT "Text" (Var.Listing [] False) : map Var.Value
3335 [ "toText", "leftAligned", "rightAligned", "centered", "justified"
34− , "plainText", "asText", "typeface", "monospace", "bold", "italic"
36+ , "plainText", "asText", "typeface", "monospace", "bold", "italic"
3537 ]
3638
3739interfaces :: Bool -> IO Interfaces