| |||||||||
| |||||||||
| |||||||||
| Description | |||||||||
DeepArrow examples. The types in the source code are formatted for easier reading. | |||||||||
| Synopsis | |||||||||
| |||||||||
| Deep application | |||||||||
| deep :: DeepArrow ~> => (c ~> c') -> (a -> (f, b -> (c, g)), e) ~> (a -> (f, b -> (c', g)), e) | |||||||||
Given a value of type (a -> (f,b -> (c,g)),e), apply a function to just the c part and leave the rest intact. deep = first . result . second . result . first | |||||||||
| Function extraction | |||||||||
| extF :: DeepArrow ~> => (d ~> (c -> b)) -> (e -> (a, d), f) ~> (c -> (e -> (a, b), f)) | |||||||||
Given a way to extract a function from a d value, create a way to extract a function from a (e -> (a,d), f) value. extF = funFirst . funResult . funSecond | |||||||||
| extFF :: DeepArrow ~> => (e -> (a, c -> b), f) ~> (c -> (e -> (a, b), f)) | |||||||||
To make an extractor, simply apply the extractor-transformer extF to the identity arrow. extFF = extF idA | |||||||||
| Input extraction | |||||||||
| extI :: DeepArrow ~> => (((a, (b, e)), c) -> d) ~> (b -> ((a, e), c) -> d) | |||||||||
Extract a b input from a ((a,(b,e)),c) argument. extI = (inpFirst . inpSecond) inpF | |||||||||
| extFI :: DeepArrow ~> => (e -> (g, ((a, (b, e)), c) -> d), f) ~> (b -> (e -> (g, ((a, e), c) -> d), f)) | |||||||||
Typically, we will have to combine function and input extractors. For instance, combine extF and extI. extFI = extF extI | |||||||||
| Produced by Haddock version 2.1.0 |