Skip to content

Applicative Output #162

@AshleyYakeley

Description

@AshleyYakeley

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions