Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell98 |

- class (Functor f, Applicative f, Foldable f, Traversable f) => Tup f where
- tupSize :: f a -> Int
- tupToList :: f a -> [a]
- tupFromList :: [a] -> f a
- tupProxy :: f a -> Proxy a
- tupUndef :: f a -> a
- constantTup :: a -> f a
- undefinedTup :: f a

- maybeTupFromList :: Tup f => [a] -> Maybe (f a)
- transposeTup :: (Tup f, Tup g) => f (g a) -> g (f a)
- maybeTupConcat :: (Tup f, Tup g, Tup h) => f a -> g a -> Maybe (h a)
- unsafeTupConcat :: (Tup f, Tup g, Tup h) => f a -> g a -> h a
- maybeConvertTup :: (Tup f, Tup g) => f a -> Maybe (g a)
- unsafeConvertTup :: (Tup f, Tup g) => f a -> g a
- zipTupWith :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
- zipTupWith3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d
- zipTupWith4 :: Applicative f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e
- zipTup :: Applicative f => f a -> f b -> f (a, b)
- zipTup3 :: Applicative f => f a -> f b -> f c -> f (a, b, c)
- zipTup4 :: Applicative f => f a -> f b -> f c -> f d -> f (a, b, c, d)

# the Tup class

class (Functor f, Applicative f, Foldable f, Traversable f) => Tup f where Source

Nothing

:: f a | |

-> Int | equivalent to |

:: f a | |

-> [a] | equivalent to |

tupFromList :: [a] -> f a Source

tupProxy :: f a -> Proxy a Source

:: f a | |

-> a | poor man's version of |

constantTup :: a -> f a Source

:: f a | when possible / makes sense, you can still pattern-patch on the constructor |

Tup Tup9 | |

Tup Tup8 | |

Tup Tup7 | |

Tup Tup6 | |

Tup Tup5 | |

Tup Tup4 | |

Tup Tup3 | |

Tup Tup2 | |

Tup Tup1 | |

Tup Tup0 | |

Tup Tup9 | |

Tup Tup8 | |

Tup Tup7 | |

Tup Tup6 | |

Tup Tup5 | |

Tup Tup4 | |

Tup Tup3 | |

Tup Tup2 | |

Tup Tup1 | |

Tup Tup0 | |

Tup Empty | |

Tup NTup9 | |

Tup NTup8 | |

Tup NTup7 | |

Tup NTup6 | |

Tup NTup5 | |

Tup NTup4 | |

Tup NTup3 | |

Tup NTup2 | |

Tup NTup1 | |

Tup NTup0 | |

Tup v => Tup (Cons v) |

# Misc

maybeTupFromList :: Tup f => [a] -> Maybe (f a) Source

Safe version of `tupFromList`

.

transposeTup :: (Tup f, Tup g) => f (g a) -> g (f a) Source

Transpose a Tup of Tups.

# Concatenation

maybeTupConcat :: (Tup f, Tup g, Tup h) => f a -> g a -> Maybe (h a) Source

Safe concatenation (going through lists)

unsafeTupConcat :: (Tup f, Tup g, Tup h) => f a -> g a -> h a Source

Unsafe concatenation

# Conversion

maybeConvertTup :: (Tup f, Tup g) => f a -> Maybe (g a) Source

Safe conversion between different Tup implementations

unsafeConvertTup :: (Tup f, Tup g) => f a -> g a Source

Unsafe conversion

# zipping (only using the Applicative structure)

zipTupWith :: Applicative f => (a -> b -> c) -> f a -> f b -> f c Source

zipTupWith3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source

zipTupWith4 :: Applicative f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e Source

zipTup :: Applicative f => f a -> f b -> f (a, b) Source

zipTup3 :: Applicative f => f a -> f b -> f c -> f (a, b, c) Source

zipTup4 :: Applicative f => f a -> f b -> f c -> f d -> f (a, b, c, d) Source