-
-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Description
It should be possible to create instances roughly along these lines:
instance {-# OVERLAPPABLE #-} (Applicative f, Rangeable a) => Rangeable (f a)
instance {-# OVERLAPPABLE #-} (Applicative f, IsInline a) => IsInline (f a)
instance {-# OVERLAPPABLE #-} (Applicative f, HasAttributes a) => HasAttributes (f a)
instance {-# OVERLAPPABLE #-} (Applicative f, IsBlock il b) => IsBlock (f il) (f b)
-- etc.
Alternatively, if overlapping instances are scary, one could create a wrapper type:
newtype Wrapper (f :: Type -> Type) (a :: Type) = Wrapper (f a) deriving (Functor, Applicative)
instance (Applicative f, Rangeable a) => Rangeable (Wrapper f a)
instance (Applicative f, IsInline a) => IsInline (Wrapper f a)
instance (Applicative f, HasAttributes a) => HasAttributes (Wrapper f a)
instance (Applicative f, IsBlock il b) => IsBlock (Wrapper f il) (Wrapper f b)
-- etc.
Is this something you'd consider?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels