pointless-lenses-0.0.4: Pointless Lenses library

Portabilitynon-portable
Stabilityexperimental
Maintainerhpacheco@di.uminho.pt

Generics.Pointless.Lenses.Examples.Examples

Description

Pointless Lenses: bidirectional lenses with point-free programming

This module provides examples, examples and more examples.

Synopsis

Documentation

length_lns :: a -> Lens [a] NatSource

List length lens.

zip_lns :: Either (Either One (b, [b])) (a, [a]) -> Lens ([a], [b]) [(a, b)]Source

List zipping lens. The aux transformation is merely for simplifying the constant argument

filter_lns :: Lens [Either a b] [a]Source

List filtering lens. The argument passed to snd_lns can be undefined because it will never be used

cat_lns :: Lens ([a], [a]) [a]Source

Binary list concatenation.

data Tree a Source

Constructors

Empty 
Node a (Tree a) (Tree a) 

Instances

Eq a => Eq (Tree a) 
Show a => Show (Tree a) 
Mu (Tree a) 

flatten_lns :: Lens (Tree a) [a]Source

Flatten a tree.

concat_lns :: Lens [[a]] [a]Source

List concatenation.

map_lns :: Lens c a -> Lens [c] [a]Source

List mapping lens.

data T a Source

Generic mapping example using user-defined concrete generators

Constructors

Fst a 
Next (T a) 

Instances

Eq a => Eq (T a) 
Show a => Show (T a) 
Mu (T a) 

aux :: T a -> aSource