utility-ht-0.0.11: Various small helper functions for Lists, Maybes, Tuples, Functions

Safe Haskell | Safe
Language | Haskell98

Control.Functor.HT

Synopsis

- void :: Functor f => f a -> f ()
- map :: Functor f => (a -> b) -> f a -> f b
- for :: Functor f => f a -> (a -> b) -> f b
- unzip :: Functor f => f (a, b) -> (f a, f b)
- unzip3 :: Functor f => f (a, b, c) -> (f a, f b, f c)
- outerProduct :: (Functor f, Functor g) => (a -> b -> c) -> f a -> g b -> f (g c)

# Documentation

void :: Functor f => f a -> f () Source

map :: Functor f => (a -> b) -> f a -> f b Source

for :: Functor f => f a -> (a -> b) -> f b Source

unzip :: Functor f => f (a, b) -> (f a, f b) Source

Caution: Every pair member has a reference to the argument of `unzip`. Depending on the consumption pattern this may cause a memory leak. For lists, I think, you should generally prefer `unzip`.

unzip3 :: Functor f => f (a, b, c) -> (f a, f b, f c) Source

Caution: See `unzip`.

outerProduct :: (Functor f, Functor g) => (a -> b -> c) -> f a -> g b -> f (g c) Source

Generalization of `outerProduct`.