Copyright | (c) Ole Krüger 2016 |
---|---|
License | BSD3 |
Maintainer | Ole Krüger <ole@vprsm.de> |
Safe Haskell | Safe |
Language | Haskell2010 |
- data Tuple ts where
- class HasElement n ts r | n ts -> r where
- getElement0 :: Tuple (r ': ts) -> r
- getElement1 :: Tuple (t0 ': (r ': ts)) -> r
- getElement2 :: Tuple (t0 ': (t1 ': (r ': ts))) -> r
- getElement3 :: Tuple (t0 ': (t1 ': (t2 ': (r ': ts)))) -> r
- getElement4 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (r ': ts))))) -> r
- getElement5 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (r ': ts)))))) -> r
- getElement6 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (r ': ts))))))) -> r
- getElement7 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (r ': ts)))))))) -> r
- getElement8 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (r ': ts))))))))) -> r
- getElement9 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (t8 ': (r ': ts)))))))))) -> r
- type family Function (ps :: [Type]) r where ...
- class WithTuple ts where
- withTuple :: WithTuple ts => (Tuple ts -> r) -> Function ts r
Documentation
Generic product type
class HasElement n ts r | n ts -> r where Source #
Helper class to extract an element from a Tuple
.
getElement :: Tuple ts -> Tagged n r Source #
Extract the n
-th element from the product.
((<=) 1 n, HasElement ((-) n 1) ts r) => HasElement n ((:) Type t ts) r Source # | Extract element that is not the head |
HasElement 0 ((:) Type t ts) t Source # | Extract head element |
getElement0 :: Tuple (r ': ts) -> r Source #
Extract element at index 0
.
getElement1 :: Tuple (t0 ': (r ': ts)) -> r Source #
Extract element at index 1
.
getElement2 :: Tuple (t0 ': (t1 ': (r ': ts))) -> r Source #
Extract element at index 2
.
getElement3 :: Tuple (t0 ': (t1 ': (t2 ': (r ': ts)))) -> r Source #
Extract element at index 3
.
getElement4 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (r ': ts))))) -> r Source #
Extract element at index 4
.
getElement5 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (r ': ts)))))) -> r Source #
Extract element at index 5
.
getElement6 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (r ': ts))))))) -> r Source #
Extract element at index 6
.
getElement7 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (r ': ts)))))))) -> r Source #
Extract element at index 7
.
getElement8 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (r ': ts))))))))) -> r Source #
Extract element at index 8
.
getElement9 :: Tuple (t0 ': (t1 ': (t2 ': (t3 ': (t4 ': (t5 ': (t6 ': (t7 ': (t8 ': (r ': ts)))))))))) -> r Source #
Extract element at index 9
.
type family Function (ps :: [Type]) r where ... Source #
Build a function type using the given parameter types and return type.