module TagAttrs(module TagAttrs,(<>)) where import Data.Semigroup newtype TagAttrs = TA [TagAttr] deriving (Eq,Show) type TagAttr = (AttrName,AttrValue) type AttrName = String type AttrValue = String lookupAttr n (TA as) = lookup n as implicit = TA [("implicit","")] noAttrs = TA [] attrs = TA hasAttr n (TA as) = not $ null [()|(m,_)<-as,m==n] mapAttrs f (TA as) = TA (map f as) instance Semigroup TagAttrs where TA as1<>TA as2 = TA (as1++as2)