Removed data-object

This commit is contained in:
Michael Snoyman 2010-05-05 05:26:44 +03:00
parent 6db0589936
commit 5c5b2ca81d
3 changed files with 2 additions and 29 deletions

View File

@ -15,8 +15,6 @@ module Yesod.Hamlet
, hamletToRepHtml
-- * Page templates
, PageContent (..)
-- * data-object
, HtmlObject
)
where
@ -25,8 +23,6 @@ import Text.Hamlet.Monad (outputHtml)
import Yesod.Content
import Yesod.Handler
import Data.Convertible.Text
import Data.Object -- FIXME should we kill this?
import Control.Arrow ((***))
import Web.Routes.Quasi (Routes)
import Data.Text (Text)
import Web.Encodings (encodeHtml)
@ -65,27 +61,5 @@ hamletToRepHtml = fmap RepHtml . hamletToContent
instance Monad m => ConvertSuccess String (Hamlet url m ()) where
convertSuccess = outputHtml . Unencoded . cs
instance Monad m
=> ConvertSuccess (Object String HtmlContent) (Hamlet url m ()) where
convertSuccess (Scalar h) = outputHtml h
convertSuccess (Sequence s) = template () where
template = [$hamlet|
%ul
$forall s' s
%li ^s^|]
s' _ = map cs s
convertSuccess (Mapping m) = template () where
template :: Monad m => () -> Hamlet url m ()
template = [$hamlet|
%dl
$forall pairs pair
%dt $pair.fst$
%dd ^pair.snd^|]
pairs _ = map (cs *** cs) m
instance ConvertSuccess String HtmlContent where
convertSuccess = Unencoded . cs
type HtmlObject = Object String HtmlContent
instance ConvertSuccess (Object String String) HtmlObject where
convertSuccess = fmap cs

View File

@ -73,7 +73,7 @@ jsonList :: [Json url ()] -> Json url ()
jsonList = jsonList' . fromList
-- | Same as 'jsonList', but uses an 'Enumerator' for input.
jsonList' :: Enumerator (Json url ()) (Json url) -> Json url () -- FIXME simplify type
jsonList' :: Enumerator (Json url ()) (Json url) -> Json url ()
jsonList' (Enumerator enum) = do
Json $ outputString "["
_ <- enum go False
@ -89,7 +89,7 @@ jsonMap :: [(String, Json url ())] -> Json url ()
jsonMap = jsonMap' . fromList
-- | Same as 'jsonMap', but uses an 'Enumerator' for input.
jsonMap' :: Enumerator (String, Json url ()) (Json url) -> Json url () -- FIXME simplify type
jsonMap' :: Enumerator (String, Json url ()) (Json url) -> Json url ()
jsonMap' (Enumerator enum) = do
Json $ outputString "{"
_ <- enum go False

View File

@ -23,7 +23,6 @@ library
authenticate >= 0.6 && < 0.7,
bytestring >= 0.9.1.4 && < 0.10,
web-encodings >= 0.2.4 && < 0.3,
data-object >= 0.2.0 && < 0.3,
directory >= 1 && < 1.1,
control-monad-attempt >= 0.2.0 && < 0.3,
text >= 0.5 && < 0.8,