Thank you to everyone for the responses. I guess what I should have
clarified is that I know how Peano numbers are *normally* encoded in
the type language (I am very familiar with the HList library), but I
would like to know why the type language appears to require data
structures to do so while
) = Natural y where
toInt y = undefined + 1
class Succ x y
instance Succ Zero y
instance Succ x y = Succ y z
zero = toInt (undefined :: Zero) -- THIS SUCCEEDS
one = toInt (undefined :: (Succ Zero x) = x) -- THIS FAILS
Thanks,
Jared Warren
___
Haskell
) from the examples that come along
with HList (like keyword-arguments.hs) to no avail. Can anybody give
me a hand?
Thanks,
Jared Warren [EMAIL PROTECTED]
* I could satisfy the type constraints with the infinite HList Record:
{Label hZero - undefined, Label (hSucc hZero) - undefined
to close HLookupByHNat when I try and get the appropriate
subset out of the powerset.
So what I'm wondering: is it possible to rewrite HProject in such a
way as to allow the type checker to infer that the only possible
projections from a list are its (non-proper) sublists?
Jared Warren [EMAIL PROTECTED
system can avoid this problem?
Thanks for your help,
~ Jared Warren [EMAIL PROTECTED]
Computing Science, Queen's University
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe
to make the former work
as well? Even modifying fst doesn't work:
fst' :: Thing b = (a,b) - a
fst' (~a,~b) = a
--
~ Jared Warren [EMAIL PROTECTED]
Computing Science, Queen's University
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http