penny-lib-0.12.0.0: Extensible double-entry accounting system - library

Safe HaskellSafe-Inferred

Penny.Lincoln.Family.Family

Synopsis

Documentation

data Family p c Source

A Family has one parent (ah, the anomie, sorry) and at least two children.

Constructors

Family 

Fields

parent :: p
 
child1 :: c
 
child2 :: c
 
children :: [c]
 

Instances

(Eq p, Eq c) => Eq (Family p c) 
(Show p, Show c) => Show (Family p c) 

mapChildrenA :: Applicative m => (a -> m b) -> Family p a -> m (Family p b)Source

Maps over all children, in order starting with child 1, then child 2, then the children in the list from left to right.

mapChildren :: (a -> b) -> Family p a -> Family p bSource

Maps over all children.

mapParentA :: Applicative m => (a -> m b) -> Family a c -> m (Family b c)Source

Maps over the parent in an Applicative.

mapParent :: (a -> b) -> Family a c -> Family b cSource

Maps over the parent.

find :: (p -> c -> Bool) -> Family p c -> Maybe cSource

Finds the first child matching a predicate.

filterChildren :: (a -> Bool) -> Family p a -> Maybe (Family p a)Source

Filters the children. Fails if there are not at least two children after filtering. Retains the original order of the children (after removing the children you don't want.)