Annotations-0.2.1: Constructing, analyzing and destructing annotated trees

Safe HaskellSafe-Inferred
LanguageHaskell98

Annotations.MultiRec.Any

Description

Pattern functors existentially quantified in their top-level index type ix.

Synopsis

Documentation

data Any s where Source

A value of some type in data family s, together with its witness.

Constructors

Any :: s ix -> ix -> Any s 

Instances

ShowFam s => Show (Any s) 

mkAny :: El s ix => ix -> Any s Source

Helper constructor.

matchAny :: forall s a. EqS s => s a -> Any s -> Maybe a Source

Unify an Any with an a.

data AnyF s f where Source

A value of some type in data family s wrapped in an f, together with its witness.

Constructors

AnyF :: s ix -> f ix -> AnyF s f 

mkAnyF :: El s ix => r ix -> AnyF s r Source

Helper constructor.

matchAnyF :: forall s f a. EqS s => s a -> AnyF s f -> Maybe (f a) Source

Unify an AnyF with an f a.

unwrapAnyF :: (forall ix. f ix -> ix) -> AnyF s f -> Any s Source

Removes the value from its functor f.

($?) :: (forall b. s b -> f b -> a) -> AnyF s f -> a Source

Unwrap an AnyF and pass it to a function.