extensible-0.2.6: 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.Plain

Description

 

Synopsis

Documentation

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 

type AllOf xs = K0 :* xs Source

Alias for plain products

type OneOf xs = K0 :| xs Source

Alias for plain sums

(<%) :: x -> AllOf xs -> AllOf (x : xs) infixr 5 Source

O(log n) Add a plain value to a product.

pluck :: x xs => AllOf xs -> x Source

Extract a plain value.

bury :: x xs => x -> OneOf xs Source

Embed a plain value.

(<%|) :: (x -> r) -> (OneOf xs -> r) -> OneOf (x : xs) -> r infixr 1 Source

Naive pattern matching for a plain value.

record :: (x xs, Functor f) => (x -> f x) -> AllOf xs -> f (AllOf xs) Source

O(log n) A lens for a plain value in a product.

recordAt :: Functor f => Position xs x -> (x -> f x) -> AllOf xs -> f (AllOf xs) Source

O(log n) A lens for a plain value in a product.

(<?%) :: (x -> a) -> (Match K0 a :* xs) -> Match K0 a :* (x : xs) infixr 1 Source

Prepend a clause for a plain value.

newtype K1 a f Source

Wrap a type that has a kind * -> *.

Constructors

K1 

Fields

getK1 :: f a
 

Instances

Typeable (k -> (k -> *) -> *) (K1 k) 
Eq (f a) => Eq (K1 k a f) 
Ord (f a) => Ord (K1 k a f) 
Read (f a) => Read (K1 k a f) 

(<?!) :: (f x -> a) -> (Match (K1 x) a :* xs) -> Match (K1 x) a :* (f : fs) infixr 1 Source

Prepend a clause for a parameterized value.