relax instance matching for GGWidget hamlet instances
This commit is contained in:
parent
62cdd6ba63
commit
5c3670c848
@ -80,20 +80,20 @@ type GWInner sub master monad =
|
|||||||
StateT Int (
|
StateT Int (
|
||||||
monad
|
monad
|
||||||
))))))))
|
))))))))
|
||||||
instance Monad monad => Monoid (GGWidget sub master monad ()) where
|
instance (Monad monad, a ~ ()) => Monoid (GGWidget sub master monad a) where
|
||||||
mempty = return ()
|
mempty = return ()
|
||||||
mappend x y = x >> y
|
mappend x y = x >> y
|
||||||
|
|
||||||
instance Monad monad => HamletValue (GGWidget s m monad ()) where
|
instance (Monad monad, a ~ ()) => HamletValue (GGWidget s m monad a) where
|
||||||
newtype HamletMonad (GGWidget s m monad ()) a =
|
newtype HamletMonad (GGWidget s m monad a) b =
|
||||||
GWidget' { runGWidget' :: GGWidget s m monad a }
|
GWidget' { runGWidget' :: GGWidget s m monad b }
|
||||||
type HamletUrl (GGWidget s m monad ()) = Route m
|
type HamletUrl (GGWidget s m monad a) = Route m
|
||||||
toHamletValue = runGWidget'
|
toHamletValue = runGWidget'
|
||||||
htmlToHamletMonad = GWidget' . addHtml
|
htmlToHamletMonad = GWidget' . addHtml
|
||||||
urlToHamletMonad url params = GWidget' $
|
urlToHamletMonad url params = GWidget' $
|
||||||
addHamlet $ \r -> preEscapedString (r url params)
|
addHamlet $ \r -> preEscapedString (r url params)
|
||||||
fromHamletValue = GWidget'
|
fromHamletValue = GWidget'
|
||||||
instance Monad monad => Monad (HamletMonad (GGWidget s m monad ())) where
|
instance (Monad monad, a ~ ()) => Monad (HamletMonad (GGWidget s m monad a)) where
|
||||||
return = GWidget' . return
|
return = GWidget' . return
|
||||||
x >>= y = GWidget' $ runGWidget' x >>= runGWidget' . y
|
x >>= y = GWidget' $ runGWidget' x >>= runGWidget' . y
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user