Safe Haskell | None |
---|---|

Language | Haskell2010 |

The bidirectional "Prelude", which re-exports various bijections similar to functions from Prelude. Most "un"-functions are left out for obvious reasons.

## Synopsis

- (<->) :: BiArrow a => (b -> c) -> (c -> b) -> a b c
- type (<->) = Bijection (->)
- const :: a -> () <-> a
- flip :: (a -> b -> c) <-> (b -> a -> c)
- id :: a <-> a
- (.) :: (b <-> c) -> (a <-> b) -> a <-> c
- not :: Bool <-> Bool
- enum :: Enum a => Int <-> a
- succ :: Enum a => a <-> a
- fst :: (a, ()) <-> a
- snd :: ((), a) <-> a
- curry :: ((a, b) -> c) <-> (a -> b -> c)
- cons :: Maybe (a, [a]) <-> [a]
- uncons :: [a] <-> Maybe (a, [a])
- bifmap :: Functor f => (a <-> b) -> f a <-> f b
- class Functor f where
- (<$>) :: Functor f => (a <-> b) -> f a -> f b
- map :: (a <-> b) -> [a] <-> [b]
- reverse :: [a] <-> [a]
- zip :: ([a], [b]) <-> [(a, b)]
- zip3 :: ([a], [b], [c]) <-> [(a, b, c)]
- zipWith :: ((a, b) <-> c) -> ([a], [b]) <-> [c]
- lines :: String <-> [String]
- words :: String <-> [String]

# Documentation

(<->) :: BiArrow a => (b -> c) -> (c -> b) -> a b c infix 2 Source #

Take two functions and lift them into a bidirectional arrow. The intention is that these functions are each other's inverse.

flip :: (a -> b -> c) <-> (b -> a -> c) Source #

`flip`

the order of the first two arguments of a function.

curry :: ((a, b) -> c) <-> (a -> b -> c) Source #

Convert between an uncurried function and a `curry`

ed function.

cons :: Maybe (a, [a]) <-> [a] Source #

Convert between

and the non-empty list `Just`

(head, tail)`head:tail`

.