on master help sign in
Move the `markdown` function to the text library
7e1d95aEvan Czaplicki
compiler/Type/Constrain/Expression.hs+1−1
@@ -138,7 +138,7 @@ constrain env (L span expr) tipe =
138 do vars <- forM es $ \_ -> liftIO (var Flexible)
138 do vars <- forM es $ \_ -> liftIO (var Flexible)
139 let tvars = map VarN vars
139 let tvars = map VarN vars
140 cs <- zipWithM (constrain env) es tvars
140 cs <- zipWithM (constrain env) es tvars
141− return . ex vars $ and ("Graphics.Element.markdown" <? tipe : cs)
141+ return . ex vars $ and ("Text.markdown" <? tipe : cs)
142
142
143 Let defs body ->
143 Let defs body ->
144 do c <- constrain env body tipe
144 do c <- constrain env body tipe
libraries/Graphics/Element.elm−3
@@ -117,9 +117,6 @@ tiledImage : Int -> Int -> String -> Element
117tiledImage w h src =
117tiledImage w h src =
118 newElement w h (Image Tiled w h (JS.fromString src))
118 newElement w h (Image Tiled w h (JS.fromString src))
119
119
120−markdown : Element
121−markdown = Native.Utils.undefined
122−
123data Three = P | Z | N
120data Three = P | Z | N
124data Pos = Absolute Int | Relative Float
121data Pos = Absolute Int | Relative Float
125type Position = { horizontal : Three, vertical : Three, x : Pos, y : Pos }
122type Position = { horizontal : Three, vertical : Three, x : Pos, y : Pos }
libraries/Text.elm+4
@@ -80,6 +80,10 @@ text = Native.Text.text
80plainText : String -> Element
80plainText : String -> Element
81plainText = Native.Text.plainText
81plainText = Native.Text.plainText
82
82
83+-- for internal use only
84+markdown : Element
85+markdown = Native.Text.markdown
86+
83-- Convert anything to it's textual representation and make it displayable in browser
87-- Convert anything to it's textual representation and make it displayable in browser
84--
88--
85-- asText == text . monospace . show
89-- asText == text . monospace . show