extensible-0.6: Extensible, efficient, optics-friendly data types and effects

Copyright(c) Fumiaki Kinoshita 2018
LicenseBSD3
MaintainerFumiaki Kinoshita <fumiexcel@gmail.com>
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Extensible.Plain

Description

 
Synopsis

Documentation

type AllOf xs = xs :& Identity Source #

Alias for plain products

type OneOf xs = xs :/ Identity 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.

accessing :: (Coercible x a, x xs, Extensible f p t, ExtensibleConstr t xs Identity x) => (a -> x) -> Optic' p f (t xs Identity) a Source #

An accessor for newtype constructors.