regular-0.2.3: Generic programming library for regular datatypes.

Portabilitynon-portable
Stabilityexperimental
Maintainergenerics@haskell.org

Generics.Regular.Functions.Crush

Contents

Description

Summary: Generic crush.

Synopsis

Crush functions

class Crush f whereSource

The Crush class defines a right-associative crush on functorial values.

Methods

crush :: Assoc -> (a -> b -> b) -> b -> f a -> bSource

Instances

Crush U 
Crush I 
Crush (K a) 
Crush f => Crush (S s f) 
Crush f => Crush (C c f) 
(Crush f, Crush g) => Crush (:*: f g) 
(Crush f, Crush g) => Crush (:+: f g) 

flattenl :: Crush f => f a -> [a]Source

Flatten a structure by collecting all the elements present.

flattenr :: Crush f => f a -> [a]Source

crushr :: Crush f => (a -> b -> b) -> b -> f a -> bSource

crushl :: Crush f => (a -> b -> b) -> b -> f a -> bSource