Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- tipyTuple :: (HDeleteAtLabel * r b v1 v2, HDeleteAtLabel * r b v3 v'2, HDeleteAtLabel * r a v2 v'1, HDeleteAtLabel * r a v1 v3, HOccurs b (r v1), HOccurs b (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (a, b)
- tipyTuple3 :: (HDeleteAtLabel * r b v1 v5, HDeleteAtLabel * r b v7 v'3, HDeleteAtLabel * r b v6 v4, HDeleteAtLabel * r c v5 v3, HDeleteAtLabel * r c v1 v2, HDeleteAtLabel * r c v4 v'2, HDeleteAtLabel * r a v3 v'1, HDeleteAtLabel * r a v2 v7, HDeleteAtLabel * r a v1 v6, HOccurs b (r v1), HOccurs b (r v7), HOccurs b (r v6), HOccurs c (r v5), HOccurs c (r v1), HOccurs c (r v4), HOccurs a (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (a, b, c)
- tipyTuple4 :: (HDeleteAtLabel * r b v1 v10, HDeleteAtLabel * r b v13 v'4, HDeleteAtLabel * r b v12 v9, HDeleteAtLabel * r b v11 v8, HDeleteAtLabel * r c v10 v7, HDeleteAtLabel * r c v1 v6, HDeleteAtLabel * r c v9 v'3, HDeleteAtLabel * r c v8 v5, HDeleteAtLabel * r d v7 v4, HDeleteAtLabel * r d v6 v3, HDeleteAtLabel * r d v1 v2, HDeleteAtLabel * r d v5 v'2, HDeleteAtLabel * r a v4 v'1, HDeleteAtLabel * r a v3 v13, HDeleteAtLabel * r a v2 v12, HDeleteAtLabel * r a v1 v11, HOccurs b (r v1), HOccurs b (r v13), HOccurs b (r v12), HOccurs b (r v11), HOccurs c (r v10), HOccurs c (r v1), HOccurs c (r v9), HOccurs c (r v8), HOccurs d (r v7), HOccurs d (r v6), HOccurs d (r v1), HOccurs d (r v5), HOccurs a (r v4), HOccurs a (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (a, b, c, d)
- tipyTuple5 :: (HDeleteAtLabel * r b v1 v17, HDeleteAtLabel * r b v21 v'5, HDeleteAtLabel * r b v20 v16, HDeleteAtLabel * r b v19 v15, HDeleteAtLabel * r b v18 v14, HDeleteAtLabel * r c v17 v13, HDeleteAtLabel * r c v1 v12, HDeleteAtLabel * r c v16 v'4, HDeleteAtLabel * r c v15 v11, HDeleteAtLabel * r c v14 v10, HDeleteAtLabel * r d v13 v9, HDeleteAtLabel * r d v12 v8, HDeleteAtLabel * r d v1 v7, HDeleteAtLabel * r d v11 v'3, HDeleteAtLabel * r d v10 v6, HDeleteAtLabel * r e v9 v5, HDeleteAtLabel * r e v8 v4, HDeleteAtLabel * r e v7 v3, HDeleteAtLabel * r e v1 v2, HDeleteAtLabel * r e v6 v'2, HDeleteAtLabel * r a v5 v'1, HDeleteAtLabel * r a v4 v21, HDeleteAtLabel * r a v3 v20, HDeleteAtLabel * r a v2 v19, HDeleteAtLabel * r a v1 v18, HOccurs b (r v1), HOccurs b (r v21), HOccurs b (r v20), HOccurs b (r v19), HOccurs b (r v18), HOccurs c (r v17), HOccurs c (r v1), HOccurs c (r v16), HOccurs c (r v15), HOccurs c (r v14), HOccurs d (r v13), HOccurs d (r v12), HOccurs d (r v1), HOccurs d (r v11), HOccurs d (r v10), HOccurs e (r v9), HOccurs e (r v8), HOccurs e (r v7), HOccurs e (r v1), HOccurs e (r v6), HOccurs a (r v5), HOccurs a (r v4), HOccurs a (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (a, b, c, d, e)
Documentation
tipyTuple :: (HDeleteAtLabel * r b v1 v2, HDeleteAtLabel * r b v3 v'2, HDeleteAtLabel * r a v2 v'1, HDeleteAtLabel * r a v1 v3, HOccurs b (r v1), HOccurs b (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (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 :: (HDeleteAtLabel * r b v1 v5, HDeleteAtLabel * r b v7 v'3, HDeleteAtLabel * r b v6 v4, HDeleteAtLabel * r c v5 v3, HDeleteAtLabel * r c v1 v2, HDeleteAtLabel * r c v4 v'2, HDeleteAtLabel * r a v3 v'1, HDeleteAtLabel * r a v2 v7, HDeleteAtLabel * r a v1 v6, HOccurs b (r v1), HOccurs b (r v7), HOccurs b (r v6), HOccurs c (r v5), HOccurs c (r v1), HOccurs c (r v4), HOccurs a (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (a, b, c) Source #
tipyTuple4 :: (HDeleteAtLabel * r b v1 v10, HDeleteAtLabel * r b v13 v'4, HDeleteAtLabel * r b v12 v9, HDeleteAtLabel * r b v11 v8, HDeleteAtLabel * r c v10 v7, HDeleteAtLabel * r c v1 v6, HDeleteAtLabel * r c v9 v'3, HDeleteAtLabel * r c v8 v5, HDeleteAtLabel * r d v7 v4, HDeleteAtLabel * r d v6 v3, HDeleteAtLabel * r d v1 v2, HDeleteAtLabel * r d v5 v'2, HDeleteAtLabel * r a v4 v'1, HDeleteAtLabel * r a v3 v13, HDeleteAtLabel * r a v2 v12, HDeleteAtLabel * r a v1 v11, HOccurs b (r v1), HOccurs b (r v13), HOccurs b (r v12), HOccurs b (r v11), HOccurs c (r v10), HOccurs c (r v1), HOccurs c (r v9), HOccurs c (r v8), HOccurs d (r v7), HOccurs d (r v6), HOccurs d (r v1), HOccurs d (r v5), HOccurs a (r v4), HOccurs a (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (a, b, c, d) Source #
tipyTuple5 :: (HDeleteAtLabel * r b v1 v17, HDeleteAtLabel * r b v21 v'5, HDeleteAtLabel * r b v20 v16, HDeleteAtLabel * r b v19 v15, HDeleteAtLabel * r b v18 v14, HDeleteAtLabel * r c v17 v13, HDeleteAtLabel * r c v1 v12, HDeleteAtLabel * r c v16 v'4, HDeleteAtLabel * r c v15 v11, HDeleteAtLabel * r c v14 v10, HDeleteAtLabel * r d v13 v9, HDeleteAtLabel * r d v12 v8, HDeleteAtLabel * r d v1 v7, HDeleteAtLabel * r d v11 v'3, HDeleteAtLabel * r d v10 v6, HDeleteAtLabel * r e v9 v5, HDeleteAtLabel * r e v8 v4, HDeleteAtLabel * r e v7 v3, HDeleteAtLabel * r e v1 v2, HDeleteAtLabel * r e v6 v'2, HDeleteAtLabel * r a v5 v'1, HDeleteAtLabel * r a v4 v21, HDeleteAtLabel * r a v3 v20, HDeleteAtLabel * r a v2 v19, HDeleteAtLabel * r a v1 v18, HOccurs b (r v1), HOccurs b (r v21), HOccurs b (r v20), HOccurs b (r v19), HOccurs b (r v18), HOccurs c (r v17), HOccurs c (r v1), HOccurs c (r v16), HOccurs c (r v15), HOccurs c (r v14), HOccurs d (r v13), HOccurs d (r v12), HOccurs d (r v1), HOccurs d (r v11), HOccurs d (r v10), HOccurs e (r v9), HOccurs e (r v8), HOccurs e (r v7), HOccurs e (r v1), HOccurs e (r v6), HOccurs a (r v5), HOccurs a (r v4), HOccurs a (r v3), HOccurs a (r v2), HOccurs a (r v1)) => r v1 -> (a, b, c, d, e) Source #