DeepArrow-0.3.5: Arrows for "deep application"

Portabilityportable
Stabilityexperimental
Maintainerconal@conal.net
Safe HaskellSafe-Infered

Data.DDeepArrow

Contents

Description

"Deep arrows" as a data type. Handy for code generation.

Synopsis

The DeepArrow data type

data DArrow whereSource

This GADT mirrors the DeepArrow class and part of the FunArr class.

Constructors

Arr :: DVal (a -> b) -> a `DArrow` b 
Compose :: (a `DArrow` b) -> (b `DArrow` c) -> a `DArrow` c 
First :: (a `DArrow` a') -> (a, b) `DArrow` (a', b) 
Second :: (b `DArrow` b') -> (a, b) `DArrow` (a, b') 
Result :: (b `DArrow` b') -> (a -> b) `DArrow` (a -> b') 
FunF :: (c -> a, b) `DArrow` (c -> (a, b)) 
FunS :: (a, c -> b) `DArrow` (c -> (a, b)) 
FunR :: (a -> c -> b) `DArrow` (c -> a -> b) 
CurryA :: ((a, b) -> c) `DArrow` (a -> b -> c) 
UncurryA :: (a -> b -> c) `DArrow` ((a, b) -> c) 
LAssocA :: (a, (b, c)) `DArrow` ((a, b), c) 
RAssocA :: ((a, b), c) `DArrow` (a, (b, c)) 
IdA :: a `DArrow` a 
DupA :: a `DArrow` (a, a) 
FstA :: (a, b) `DArrow` a 
SndA :: (a, b) `DArrow` b 
SwapA :: (a, b) `DArrow` (b, a) 

data DVal whereSource

A GADT alternative to terms. Allows generation of Haskell terms and, from there, strings and eval.

Constructors

ExpDV :: HsExp -> DVal a 
AppDA :: (a `DArrow` b) -> DVal a -> DVal b 
ZipDV :: DVal a -> DVal b -> DVal (a, b) 

Instances