extensible-0.2.1: 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

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

type OneOf xs = K0 :| xs Source

(<%) :: 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 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.

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

Prepend a clause for a plain value.