HList-0.5.2.0: Heterogeneous lists
Safe HaskellNone
LanguageHaskell2010

Data.HList.TIPtuple

Description

While NoMonoLocalBinds could be enabled in TIP.hs, the ghc manual warns "type inference becomes less predicatable if you do so. (Read the papers!)". These definitions don't need type families, putting these definitions in a separate module avoids that mess.

XXX these should be implemented in terms of HTuple and tipyProject, which means adding

Synopsis

Documentation

tipyTuple :: forall b r (v1 :: [Type]) (v2 :: [Type]) a (v3 :: [Type]) (v'1 :: [Type]) (v'2 :: [Type]). (HOccurs b (r v1), HOccurs b (r v2), HOccurs a (r v2), HOccurs a (r v3), HDeleteAtLabel r b v1 v'1, HDeleteAtLabel r b v2 v3, HDeleteAtLabel r a v2 v1, HDeleteAtLabel r a v3 v'2) => r v2 -> (a, b) Source #

project a TIP (or HList) into a tuple

tipyTuple' x = (hOccurs x, hOccurs x)

behaves similarly, except tipyTuple excludes the possibility of looking up the same element twice, which allows inferring a concrete type in more situations. For example

(\x y z -> tipyTuple (x .*. y .*. emptyTIP) `asTypeOf` (x, z)) () 'x'

has type Char -> ((), Char). tipyTuple' would need a type annotation to decide whether the type should be Char -> ((), Char) or () -> ((), ())

tipyTuple3 :: forall b r (v1 :: [Type]) (v2 :: [Type]) (v3 :: [Type]) c (v4 :: [Type]) (v5 :: [Type]) a (v6 :: [Type]) (v7 :: [Type]) (v'1 :: [Type]) (v'2 :: [Type]) (v'3 :: [Type]). (HOccurs b (r v1), HOccurs b (r v2), HOccurs b (r v3), HOccurs c (r v4), HOccurs c (r v3), HOccurs c (r v5), HOccurs a (r v3), HOccurs a (r v6), HOccurs a (r v7), HDeleteAtLabel r b v1 v4, HDeleteAtLabel r b v2 v'1, HDeleteAtLabel r b v3 v5, HDeleteAtLabel r c v4 v'2, HDeleteAtLabel r c v3 v6, HDeleteAtLabel r c v5 v7, HDeleteAtLabel r a v3 v1, HDeleteAtLabel r a v6 v2, HDeleteAtLabel r a v7 v'3) => r v3 -> (a, b, c) Source #

tipyTuple4 :: forall b r (v1 :: [Type]) (v2 :: [Type]) (v3 :: [Type]) (v4 :: [Type]) c (v5 :: [Type]) (v6 :: [Type]) (v7 :: [Type]) d (v8 :: [Type]) (v9 :: [Type]) (v10 :: [Type]) a (v11 :: [Type]) (v12 :: [Type]) (v13 :: [Type]) (v'1 :: [Type]) (v'2 :: [Type]) (v'3 :: [Type]) (v'4 :: [Type]). (HOccurs b (r v1), HOccurs b (r v2), HOccurs b (r v3), HOccurs b (r v4), HOccurs c (r v5), HOccurs c (r v6), HOccurs c (r v4), HOccurs c (r v7), HOccurs d (r v8), HOccurs d (r v4), HOccurs d (r v9), HOccurs d (r v10), HOccurs a (r v4), HOccurs a (r v11), HOccurs a (r v12), HOccurs a (r v13), HDeleteAtLabel r b v1 v5, HDeleteAtLabel r b v2 v6, HDeleteAtLabel r b v3 v'1, HDeleteAtLabel r b v4 v7, HDeleteAtLabel r c v5 v8, HDeleteAtLabel r c v6 v'2, HDeleteAtLabel r c v4 v9, HDeleteAtLabel r c v7 v10, HDeleteAtLabel r d v8 v'3, HDeleteAtLabel r d v4 v11, HDeleteAtLabel r d v9 v12, HDeleteAtLabel r d v10 v13, HDeleteAtLabel r a v4 v1, HDeleteAtLabel r a v11 v2, HDeleteAtLabel r a v12 v3, HDeleteAtLabel r a v13 v'4) => r v4 -> (a, b, c, d) Source #

tipyTuple5 :: forall b r (v1 :: [Type]) (v2 :: [Type]) (v3 :: [Type]) (v4 :: [Type]) (v5 :: [Type]) c (v6 :: [Type]) (v7 :: [Type]) (v8 :: [Type]) (v9 :: [Type]) d (v10 :: [Type]) (v11 :: [Type]) (v12 :: [Type]) (v13 :: [Type]) e (v14 :: [Type]) (v15 :: [Type]) (v16 :: [Type]) (v17 :: [Type]) a (v18 :: [Type]) (v19 :: [Type]) (v20 :: [Type]) (v21 :: [Type]) (v'1 :: [Type]) (v'2 :: [Type]) (v'3 :: [Type]) (v'4 :: [Type]) (v'5 :: [Type]). (HOccurs b (r v1), HOccurs b (r v2), HOccurs b (r v3), HOccurs b (r v4), HOccurs b (r v5), HOccurs c (r v6), HOccurs c (r v7), HOccurs c (r v8), HOccurs c (r v5), HOccurs c (r v9), HOccurs d (r v10), HOccurs d (r v11), HOccurs d (r v5), HOccurs d (r v12), HOccurs d (r v13), HOccurs e (r v14), HOccurs e (r v5), HOccurs e (r v15), HOccurs e (r v16), HOccurs e (r v17), HOccurs a (r v5), HOccurs a (r v18), HOccurs a (r v19), HOccurs a (r v20), HOccurs a (r v21), HDeleteAtLabel r b v1 v6, HDeleteAtLabel r b v2 v7, HDeleteAtLabel r b v3 v8, HDeleteAtLabel r b v4 v'1, HDeleteAtLabel r b v5 v9, HDeleteAtLabel r c v6 v10, HDeleteAtLabel r c v7 v11, HDeleteAtLabel r c v8 v'2, HDeleteAtLabel r c v5 v12, HDeleteAtLabel r c v9 v13, HDeleteAtLabel r d v10 v14, HDeleteAtLabel r d v11 v'3, HDeleteAtLabel r d v5 v15, HDeleteAtLabel r d v12 v16, HDeleteAtLabel r d v13 v17, HDeleteAtLabel r e v14 v'4, HDeleteAtLabel r e v5 v18, HDeleteAtLabel r e v15 v19, HDeleteAtLabel r e v16 v20, HDeleteAtLabel r e v17 v21, HDeleteAtLabel r a v5 v1, HDeleteAtLabel r a v18 v2, HDeleteAtLabel r a v19 v3, HDeleteAtLabel r a v20 v4, HDeleteAtLabel r a v21 v'5) => r v5 -> (a, b, c, d, e) Source #