on master help sign in
* ElmSource instance for strict text
commit58a6eb6a3f655807f3cdfcc66b51d88e451fa47c authorVincent Ambo <v.ambo@me.com> dateWed 30 May 2012, 21:52 (14 years ago) parent231bedd
1 file changed+7
elm/src/Language/Elm.hs+7
elm/src/Language/Elm.hs+7
@@ -19,6 +19,7 @@ import Initialize
1919import Text.Blaze.Html (Html)
2020import Language.Elm.Quasi
2121
22+import qualified Data.Text as TS
2223import qualified Data.Text.Lazy as TL
2324
2425class ElmSource a where
@@ -41,6 +42,12 @@ instance ElmSource Elm where
4142 toParts = toPartsHelper . TL.unpack . renderElm
4243 toHtml elmL title = generateHtml elmL title . TL.unpack . renderElm
4344
45+-- |Strict text
46+instance ElmSource TS.Text where
47+ toParts = toPartsHelper . TS.unpack
48+ toHtml elmL title = generateHtml elmL title . TS.unpack
49+
50+-- |Lazy text
4451instance ElmSource TL.Text where
4552 toParts = toPartsHelper . TL.unpack
4653 toHtml elmL title = generateHtml elmL title . TL.unpack