vinyl-0.2: Extensible Records

Safe HaskellSafe-Inferred

Data.Vinyl.Classes

Synopsis

Documentation

class Apply arr f whereSource

This class is a generalized, but non-pointed version of Applicative. This is useful for types which range over functors rather than sets.

Methods

(<<*>>) :: f (arr a b) -> f a -> f bSource

Instances

Apply (* -> *) (~> *) (Rec rs)

Records can be applied to each other.

class Dist t whereSource

To accumulate effects distributed over a data type, you dist it.

Methods

dist :: Applicative f => t f -> f (t Identity)Source

Instances

Dist (Rec rs)

Records may be distributed to accumulate the effects of their fields.

class FoldRec r a whereSource

If a record is homogenous, you can fold over it.

Methods

foldRec :: (a -> b -> b) -> b -> r -> bSource

Instances

FoldRec (Rec ([] *) f) a 
FoldRec (Rec fs g) (g t) => FoldRec (Rec (: * (::: s t) fs) g) (g t) 

newtype (f (~>) g) x Source

'(~>)' is a morphism between functors.

Constructors

NT 

Fields

runNT :: f x -> g x
 

Instances

Apply (* -> *) (~> *) (Rec rs)

Records can be applied to each other.