extensible-0.2: Poly-kinded, extensible ADTs

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

Eq a => Eq (K0 a) 
Ord a => Ord (K0 a) 
Read a => Read (K0 a) 
Show a => Show (K0 a) 
Typeable (* -> *) K0 

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

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

pluck :: x xs => (K0 :* xs) -> x Source

Extract a plain value.

bury :: x xs => x -> K0 :| xs Source

Embed a plain value.

(<%|) :: (x -> r) -> ((K0 :| xs) -> r) -> (K0 :| (x : xs)) -> r Source

Naive pattern matching for a plain value.

record :: (x xs, Functor f) => (x -> f x) -> (K0 :* xs) -> f (K0 :* 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.