mirror of
https://github.com/byteverse/colonnade.git
synced 2026-04-30 11:54:51 +02:00
add a few more instances of Cellular and export it
This commit is contained in:
parent
7e002f9d5b
commit
16457188fe
@ -26,6 +26,7 @@ library
|
|||||||
, reflex-dom == 0.4.*
|
, reflex-dom == 0.4.*
|
||||||
, containers >= 0.5 && < 0.6
|
, containers >= 0.5 && < 0.6
|
||||||
, profunctors >= 5.2 && < 5.3
|
, profunctors >= 5.2 && < 5.3
|
||||||
|
, transformers >= 0.5 && < 0.6
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
|
|||||||
@ -23,6 +23,8 @@ module Reflex.Dom.Colonnade
|
|||||||
, Bureau(..)
|
, Bureau(..)
|
||||||
, Arrangement(..)
|
, Arrangement(..)
|
||||||
, Pagination(..)
|
, Pagination(..)
|
||||||
|
-- * Typeclasses
|
||||||
|
, Cellular(..)
|
||||||
-- * Table Encoders
|
-- * Table Encoders
|
||||||
, basic
|
, basic
|
||||||
, static
|
, static
|
||||||
@ -71,6 +73,7 @@ import Data.Monoid (Sum(..))
|
|||||||
import Data.Proxy
|
import Data.Proxy
|
||||||
import Control.Monad.Fix (MonadFix)
|
import Control.Monad.Fix (MonadFix)
|
||||||
import Control.Monad (forM)
|
import Control.Monad (forM)
|
||||||
|
import Control.Monad.Trans.Reader (ReaderT)
|
||||||
import qualified Colonnade as C
|
import qualified Colonnade as C
|
||||||
import qualified Colonnade.Encode as E
|
import qualified Colonnade.Encode as E
|
||||||
|
|
||||||
@ -121,6 +124,7 @@ data Arrangement t
|
|||||||
(Dynamic t (Map Text Text))
|
(Dynamic t (Map Text Text))
|
||||||
-- ^ contains attributes of @\<tfoot\>@, its inner @\<tr\>@, and its inner @\<th\>@.
|
-- ^ contains attributes of @\<tfoot\>@, its inner @\<tr\>@, and its inner @\<th\>@.
|
||||||
|
|
||||||
|
-- | Things that can be rendered as cells in a table.
|
||||||
class (PostBuild t m, DomBuilder t m) => Cellular t m c | c -> m, c -> t where
|
class (PostBuild t m, DomBuilder t m) => Cellular t m c | c -> m, c -> t where
|
||||||
cellularAttrs :: c b -> Dynamic t (Map Text Text)
|
cellularAttrs :: c b -> Dynamic t (Map Text Text)
|
||||||
cellularContents :: c b -> m b
|
cellularContents :: c b -> m b
|
||||||
@ -132,6 +136,14 @@ instance (PostBuild t m, DomBuilder t m) => Cellular t m (Cell t m) where
|
|||||||
instance (Reflex t, DomBuilder t m, PerformEvent t m, MonadHold t m, MonadFix m) => Cellular t (PostBuildT t m) (PostBuildT t m) where
|
instance (Reflex t, DomBuilder t m, PerformEvent t m, MonadHold t m, MonadFix m) => Cellular t (PostBuildT t m) (PostBuildT t m) where
|
||||||
cellularAttrs _ = pure M.empty
|
cellularAttrs _ = pure M.empty
|
||||||
cellularContents = id
|
cellularContents = id
|
||||||
|
|
||||||
|
instance Cellular t m m => Cellular t (ReaderT r m) (ReaderT r m) where
|
||||||
|
cellularAttrs _ = pure M.empty
|
||||||
|
cellularContents = id
|
||||||
|
|
||||||
|
instance (Cellular t m m, MonadHold t m, MonadFix m, Semigroup w) => Cellular t (EventWriterT t w m) (EventWriterT t w m) where
|
||||||
|
cellularAttrs _ = pure M.empty
|
||||||
|
cellularContents = id
|
||||||
|
|
||||||
|
|
||||||
-- | This typeclass is provided to make using functions in this
|
-- | This typeclass is provided to make using functions in this
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user