mirror of
https://github.com/byteverse/colonnade.git
synced 2024-09-11 06:45:41 +03: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.*
|
||||
, containers >= 0.5 && < 0.6
|
||||
, profunctors >= 5.2 && < 5.3
|
||||
, transformers >= 0.5 && < 0.6
|
||||
default-language: Haskell2010
|
||||
|
||||
source-repository head
|
||||
|
@ -23,6 +23,8 @@ module Reflex.Dom.Colonnade
|
||||
, Bureau(..)
|
||||
, Arrangement(..)
|
||||
, Pagination(..)
|
||||
-- * Typeclasses
|
||||
, Cellular(..)
|
||||
-- * Table Encoders
|
||||
, basic
|
||||
, static
|
||||
@ -71,6 +73,7 @@ import Data.Monoid (Sum(..))
|
||||
import Data.Proxy
|
||||
import Control.Monad.Fix (MonadFix)
|
||||
import Control.Monad (forM)
|
||||
import Control.Monad.Trans.Reader (ReaderT)
|
||||
import qualified Colonnade as C
|
||||
import qualified Colonnade.Encode as E
|
||||
|
||||
@ -121,6 +124,7 @@ data Arrangement t
|
||||
(Dynamic t (Map Text Text))
|
||||
-- ^ 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
|
||||
cellularAttrs :: c b -> Dynamic t (Map Text Text)
|
||||
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
|
||||
cellularAttrs _ = pure M.empty
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user