putlenses-0.0.3: Put-based lens library

Stabilityprovisional
MaintainerHugo Pacheco <hpacheco@nii.ac.jp>
Safe HaskellNone

Generics.Putlenses.Examples.People

Contents

Description

Database examples for a source database with a list of people.

Synopsis

Documentation

data Person Source

Constructors

Person 

Fields

name :: Name
 
city :: City
 

DB project

DB select

selectPut :: (Eq a, Ord k) => (a -> k) -> (st -> e -> [a]) -> (a -> Bool) -> Putlens st e [a] [a]Source

Generic database select putlens

selectPut' :: (Eq a, Ord k) => (a -> k) -> (a -> Bool) -> Putlens (Maybe a, [a]) e [a] [a]Source

recoverEntry :: Ord k => (a -> k) -> [a] -> [a] -> (Maybe a, [a])Source

peopleFromPut :: City -> Putlens st [Person] [Person] [Person]Source

Selects all people from a city

peopleFromToPut :: City -> City -> Putlens st [Person] [Person] [Person]Source

Selects all people from a city (moves deleted people to a new city to)

DB Join

withM :: (m1 -> Maybe s -> Maybe v -> v -> m2) -> Putlens st m2 s v -> Putlens st m1 s vSource