Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Tuple helpers
- uncurry3 :: (a -> b -> c -> e) -> (a, b, c) -> e
- uncurry4 :: (a -> b -> c -> d -> e) -> (a, b, c, d) -> e
- take4 :: [a] -> (a, a, a, a)
- fromTuple4 :: (a, a, a, a) -> [a]
- module Data.Tuple
- newtype Single a = Single a
- type family TupleToList t where ...
- type family ListToTuple t where ...
- class ExtractTuple (n :: Nat) t x | n t -> x where
- class TupleHead ts ts' | ts -> ts' where
- class TupleTail ts ts' | ts -> ts' where
- class TupleCons t ts ts' | t ts -> ts' where
- class ReorderTuple t1 t2 where
Documentation
fromTuple4 :: (a, a, a, a) -> [a] Source #
toList for quadruple
module Data.Tuple
Singleton type
Single a |
type family TupleToList t where ... Source #
TupleToList (Single a) = '[a] | |
TupleToList (a, b) = '[a, b] | |
TupleToList (a, b, c) = '[a, b, c] | |
TupleToList (a, b, c, d) = '[a, b, c, d] | |
TupleToList (a, b, c, d, e) = '[a, b, c, d, e] | |
TupleToList (a, b, c, d, e, f) = '[a, b, c, d, e, f] | |
TupleToList (a, b, c, d, e, f, g) = '[a, b, c, d, e, f, g] | |
TupleToList (a, b, c, d, e, f, g, h) = '[a, b, c, d, e, f, g, h] | |
TupleToList (a, b, c, d, e, f, g, h, i) = '[a, b, c, d, e, f, g, h, i] | |
TupleToList (a, b, c, d, e, f, g, h, i, j) = '[a, b, c, d, e, f, g, h, i, j] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k) = '[a, b, c, d, e, f, g, h, i, j, k] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l) = '[a, b, c, d, e, f, g, h, i, j, k, l] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m) = '[a, b, c, d, e, f, g, h, i, j, k, l, m] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y] | |
TupleToList (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) = '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z] |
type family ListToTuple t where ... Source #
ListToTuple '[a] = Single a | |
ListToTuple '[a, b] = (a, b) | |
ListToTuple '[a, b, c] = (a, b, c) | |
ListToTuple '[a, b, c, d] = (a, b, c, d) | |
ListToTuple '[a, b, c, d, e] = (a, b, c, d, e) | |
ListToTuple '[a, b, c, d, e, f] = (a, b, c, d, e, f) | |
ListToTuple '[a, b, c, d, e, f, g] = (a, b, c, d, e, f, g) | |
ListToTuple '[a, b, c, d, e, f, g, h] = (a, b, c, d, e, f, g, h) | |
ListToTuple '[a, b, c, d, e, f, g, h, i] = (a, b, c, d, e, f, g, h, i) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j] = (a, b, c, d, e, f, g, h, i, j) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k] = (a, b, c, d, e, f, g, h, i, j, k) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l] = (a, b, c, d, e, f, g, h, i, j, k, l) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m] = (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y) | |
ListToTuple '[a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z] = (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z) |
class ExtractTuple (n :: Nat) t x | n t -> x where Source #
Extract a tuple value statically
ExtractTuple 0 (Single t) t Source # | |
ExtractTuple 0 (e0, e1) e0 Source # | |
ExtractTuple 1 (e0, e1) e1 Source # | |
ExtractTuple 0 (e0, e1, e2) e0 Source # | |
ExtractTuple 1 (e0, e1, e2) e1 Source # | |
ExtractTuple 2 (e0, e1, e2) e2 Source # | |
ExtractTuple 0 (e0, e1, e2, e3) e0 Source # | |
ExtractTuple 1 (e0, e1, e2, e3) e1 Source # | |
ExtractTuple 2 (e0, e1, e2, e3) e2 Source # | |
ExtractTuple 3 (e0, e1, e2, e3) e3 Source # | |
ExtractTuple 0 (e0, e1, e2, e3, e4) e0 Source # | |
ExtractTuple 1 (e0, e1, e2, e3, e4) e1 Source # | |
ExtractTuple 2 (e0, e1, e2, e3, e4) e2 Source # | |
ExtractTuple 3 (e0, e1, e2, e3, e4) e3 Source # | |
ExtractTuple 4 (e0, e1, e2, e3, e4) e4 Source # | |
ExtractTuple 0 (e0, e1, e2, e3, e4, e5) e0 Source # | |
ExtractTuple 1 (e0, e1, e2, e3, e4, e5) e1 Source # | |
ExtractTuple 2 (e0, e1, e2, e3, e4, e5) e2 Source # | |
ExtractTuple 3 (e0, e1, e2, e3, e4, e5) e3 Source # | |
ExtractTuple 4 (e0, e1, e2, e3, e4, e5) e4 Source # | |
ExtractTuple 5 (e0, e1, e2, e3, e4, e5) e5 Source # | |
ExtractTuple 0 (e0, e1, e2, e3, e4, e5, e6) e0 Source # | |
ExtractTuple 1 (e0, e1, e2, e3, e4, e5, e6) e1 Source # | |
ExtractTuple 2 (e0, e1, e2, e3, e4, e5, e6) e2 Source # | |
ExtractTuple 3 (e0, e1, e2, e3, e4, e5, e6) e3 Source # | |
ExtractTuple 4 (e0, e1, e2, e3, e4, e5, e6) e4 Source # | |
ExtractTuple 5 (e0, e1, e2, e3, e4, e5, e6) e5 Source # | |
ExtractTuple 6 (e0, e1, e2, e3, e4, e5, e6) e6 Source # | |
ExtractTuple 0 (e0, e1, e2, e3, e4, e5, e6, e7) e0 Source # | |
ExtractTuple 1 (e0, e1, e2, e3, e4, e5, e6, e7) e1 Source # | |
ExtractTuple 2 (e0, e1, e2, e3, e4, e5, e6, e7) e2 Source # | |
ExtractTuple 3 (e0, e1, e2, e3, e4, e5, e6, e7) e3 Source # | |
ExtractTuple 4 (e0, e1, e2, e3, e4, e5, e6, e7) e4 Source # | |
ExtractTuple 5 (e0, e1, e2, e3, e4, e5, e6, e7) e5 Source # | |
ExtractTuple 6 (e0, e1, e2, e3, e4, e5, e6, e7) e6 Source # | |
ExtractTuple 7 (e0, e1, e2, e3, e4, e5, e6, e7) e7 Source # | |
class ReorderTuple t1 t2 where Source #
Reorder tuple elements
tupleReorder :: t1 -> t2 Source #
Reorder tuple elements
ReorderTuple (Single a) (Single a) Source # | |
ReorderTuple (a, b) (b, a) Source # | |
ReorderTuple (a, b) (a, b) Source # | |
ReorderTuple (a, b, c) (c, b, a) Source # | |
ReorderTuple (a, b, c) (c, a, b) Source # | |
ReorderTuple (a, b, c) (b, c, a) Source # | |
ReorderTuple (a, b, c) (b, a, c) Source # | |
ReorderTuple (a, b, c) (a, c, b) Source # | |
ReorderTuple (a, b, c) (a, b, c) Source # | |
ReorderTuple (a, b, c) (x, y, z) => ReorderTuple (a, b, c, d) (x, y, z, d) Source # | |
ReorderTuple (a, b, d) (x, y, z) => ReorderTuple (a, b, c, d) (x, y, c, z) Source # | |
ReorderTuple (a, c, d) (x, y, z) => ReorderTuple (a, b, c, d) (x, b, y, z) Source # | |
ReorderTuple (b, c, d) (x, y, z) => ReorderTuple (a, b, c, d) (a, x, y, z) Source # | |
ReorderTuple (a, b, c, d) (a, b, c, d) Source # | |
ReorderTuple (a, b, c, d) (x, y, z, w) => ReorderTuple (a, b, c, d, e) (x, y, z, w, e) Source # | |
ReorderTuple (a, b, c, e) (x, y, z, w) => ReorderTuple (a, b, c, d, e) (x, y, z, d, w) Source # | |
ReorderTuple (a, b, d, e) (x, y, z, w) => ReorderTuple (a, b, c, d, e) (x, y, c, z, w) Source # | |
ReorderTuple (a, c, d, e) (x, y, z, w) => ReorderTuple (a, b, c, d, e) (x, b, y, z, w) Source # | |
ReorderTuple (b, c, d, e) (x, y, z, w) => ReorderTuple (a, b, c, d, e) (a, x, y, z, w) Source # | |
ReorderTuple (a, b, c, d, e) (a, b, c, d, e) Source # | |
ReorderTuple (a, b, c, d, e) (x, y, z, w, v) => ReorderTuple (a, b, c, d, e, f) (x, y, z, w, v, f) Source # | |
ReorderTuple (a, b, c, d, f) (x, y, z, w, v) => ReorderTuple (a, b, c, d, e, f) (x, y, z, w, e, v) Source # | |
ReorderTuple (a, b, c, e, f) (x, y, z, w, v) => ReorderTuple (a, b, c, d, e, f) (x, y, z, d, w, v) Source # | |
ReorderTuple (a, b, d, e, f) (x, y, z, w, v) => ReorderTuple (a, b, c, d, e, f) (x, y, c, z, w, v) Source # | |
ReorderTuple (a, c, d, e, f) (x, y, z, w, v) => ReorderTuple (a, b, c, d, e, f) (x, b, y, z, w, v) Source # | |
ReorderTuple (b, c, d, e, f) (x, y, z, w, v) => ReorderTuple (a, b, c, d, e, f) (a, x, y, z, w, v) Source # | |
ReorderTuple (a, b, c, d, e, f) (a, b, c, d, e, f) Source # | |
ReorderTuple (a, b, c, d, e, f) (x, y, z, w, v, u) => ReorderTuple (a, b, c, d, e, f, g) (x, y, z, w, v, u, g) Source # | |
ReorderTuple (a, b, c, d, e, g) (x, y, z, w, v, u) => ReorderTuple (a, b, c, d, e, f, g) (x, y, z, w, v, f, u) Source # | |
ReorderTuple (a, b, c, d, f, g) (x, y, z, w, v, u) => ReorderTuple (a, b, c, d, e, f, g) (x, y, z, w, e, v, u) Source # | |
ReorderTuple (a, b, c, e, f, g) (x, y, z, w, v, u) => ReorderTuple (a, b, c, d, e, f, g) (x, y, z, d, w, v, u) Source # | |
ReorderTuple (a, b, d, e, f, g) (x, y, z, w, v, u) => ReorderTuple (a, b, c, d, e, f, g) (x, y, c, z, w, v, u) Source # | |
ReorderTuple (a, c, d, e, f, g) (x, y, z, w, v, u) => ReorderTuple (a, b, c, d, e, f, g) (x, b, y, z, w, v, u) Source # | |
ReorderTuple (b, c, d, e, f, g) (x, y, z, w, v, u) => ReorderTuple (a, b, c, d, e, f, g) (a, x, y, z, w, v, u) Source # | |
ReorderTuple (a, b, c, d, e, f, g) (a, b, c, d, e, f, g) Source # | |
ReorderTuple (a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h) Source # | |
ReorderTuple (a, b, c, d, e, f, g, h, i) (a, b, c, d, e, f, g, h, i) Source # | |
ReorderTuple (a, b, c, d, e, f, g, h, i, j) (a, b, c, d, e, f, g, h, i, j) Source # | |