Safe Haskell | Safe-Inferred |
---|---|
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
Synopsis
- tipyTuple :: forall {t} {r} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t)
- tipyTuple3 :: forall {t} {r} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t, t)
- tipyTuple4 :: forall {t} {r} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t, t, t)
- tipyTuple5 :: forall {t} {r} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t, t, t, t)
Documentation
tipyTuple :: forall {t} {r} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t) 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 {t} {r} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t, t) Source #
tipyTuple4 :: forall {t} {r} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t, t, t) Source #
tipyTuple5 :: forall {t} {r} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {t} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]} {v' :: [Type]}. (HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HOccurs t (r v), HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v', HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v, HDeleteAtLabel r t v v') => r v -> (t, t, t, t, t) Source #