Safe Haskell | None |
---|---|
Language | GHC2021 |
Web.Atomic.Types.Attributable
Synopsis
- type Name = Text
- type AttValue = Text
- newtype Attributes (h :: k) = Attributes (Map Name AttValue)
- class Attributable h where
- (@) :: h -> (Attributes h -> Attributes h) -> h
- modAttributes :: (Map Name AttValue -> Map Name AttValue) -> h -> h
- att :: Attributable h => Name -> AttValue -> Attributes h -> Attributes h
Documentation
newtype Attributes (h :: k) Source #
Constructors
Attributes (Map Name AttValue) |
Instances
Attributable (Attributes h) Source # | |
Defined in Web.Atomic.Types.Attributable Methods (@) :: Attributes h -> (Attributes (Attributes h) -> Attributes (Attributes h)) -> Attributes h Source # modAttributes :: (Map Name AttValue -> Map Name AttValue) -> Attributes h -> Attributes h Source # | |
Monoid (Attributes h) Source # | |
Defined in Web.Atomic.Types.Attributable Methods mempty :: Attributes h # mappend :: Attributes h -> Attributes h -> Attributes h # mconcat :: [Attributes h] -> Attributes h # | |
Semigroup (Attributes h) Source # | |
Defined in Web.Atomic.Types.Attributable Methods (<>) :: Attributes h -> Attributes h -> Attributes h # sconcat :: NonEmpty (Attributes h) -> Attributes h # stimes :: Integral b => b -> Attributes h -> Attributes h # |
class Attributable h where Source #
Add Atts
Minimal complete definition
Methods
(@) :: h -> (Attributes h -> Attributes h) -> h infixl 5 Source #
Apply an attribute to some html
el @ att "id" "main-content" $ do tag "img" @ att "src" "logo.png" tag "input" @ placeholder "message" ~ border 1
modAttributes :: (Map Name AttValue -> Map Name AttValue) -> h -> h Source #
Instances
Attributable (Html a) Source # | |
Attributable (Attributes h) Source # | |
Defined in Web.Atomic.Types.Attributable Methods (@) :: Attributes h -> (Attributes (Attributes h) -> Attributes (Attributes h)) -> Attributes h Source # modAttributes :: (Map Name AttValue -> Map Name AttValue) -> Attributes h -> Attributes h Source # | |
Attributable (Map Name AttValue) Source # | |
(Attributable a, Attributable b) => Attributable (a -> b) Source # | |
Defined in Web.Atomic.Types.Attributable Methods (@) :: (a -> b) -> (Attributes (a -> b) -> Attributes (a -> b)) -> a -> b Source # modAttributes :: (Map Name AttValue -> Map Name AttValue) -> (a -> b) -> a -> b Source # |
att :: Attributable h => Name -> AttValue -> Attributes h -> Attributes h Source #