extensible-0.3.1: Extensible, efficient, lens-friendly data types

Copyright(c) Fumiaki Kinoshita 2015
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Extensible.Internal.Rig

Description

Miscellaneous utilities

Synopsis

Documentation

type Lens' s a = forall f. Functor f => (a -> f a) -> s -> f s Source

A type synonym for lenses

view :: ((a -> Const a a) -> s -> Const a s) -> s -> a Source

view :: Lens' s a -> (a -> a) -> (s -> s)

views :: ((a -> Const r a) -> s -> Const r s) -> (a -> r) -> s -> r Source

views :: Lens' s a -> (a -> r) -> (s -> r)

newtype K0 a Source

Just a value.

Constructors

K0 

Fields

getK0 :: a
 

Instances

Monad K0 
Functor K0 
Applicative K0 
Foldable K0 
Traversable K0 
Eq a => Eq (K0 a) 
Ord a => Ord (K0 a) 
Read a => Read (K0 a) 
Show a => Show (K0 a) 
Typeable (* -> *) K0 

over :: ((a -> K0 a) -> s -> K0 s) -> (a -> a) -> s -> s Source

over :: Lens' s a -> (a -> a) -> (s -> s)

newtype Const' a x Source

Poly-kinded Const

Constructors

Const' 

Fields

getConst' :: a
 

Instances

Show a => Show (Const' k a x) 

newtype Match h a x Source

Turn a wrapper type into one clause that returns a.

Constructors

Match 

Fields

runMatch :: h x -> a
 

Instances

Typeable ((k -> *) -> * -> k -> *) (Match k) 

newtype Comp f g a Source

Constructors

Comp 

Fields

getComp :: f (g a)
 

comp :: Functor f => (a -> g b) -> f a -> Comp f g b Source

data Nullable h x Source

Poly-kinded Maybe

Constructors

Null 
Eine (h x) 

Instances

Typeable ((k -> *) -> k -> *) (Nullable k) 
Eq (h x) => Eq (Nullable k h x) 
Ord (h x) => Ord (Nullable k h x) 
Show (h x) => Show (Nullable k h x) 

nullable :: r -> (h x -> r) -> Nullable h x -> r Source

Destruct Nullable.

mapNullable :: (g x -> h y) -> Nullable g x -> Nullable h y Source

Apply a function to its content.

newtype MergeList a Source

Constructors

MergeList 

Fields

getMerged :: [a]