-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
There's three different types of Attribute but all attributes can be used with the standard Attribute.
It's an easy mistake to wrap up an attribute incorrectly, I've seen (and done) it a few times. After spending over an hour debugging to find out splitAttr does this too I want this to be fixed :)
One way is to use data kinds:
data AttrKind = Attr | MAttr | TAttr
class AttributesClass where
type AttrType :: AttrKind
applyAttribute :: (AttributeClass a, AttrType a ~ Attr, HasStyle d) => a -> d -> d
applyTAttribute :: (AttributeClass a, AttrType a ~ TAttr, HasStyle d) => a -> d -> d
atAttr :: (AttributeClass a, AttrType a ~ Attr) :: Lens' (Style v n) (Maybe a)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels