[Haskell-cafe] Re: Type-Level Naturals Like Prolog?

2006-07-17 Thread Jared Warren
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

[Haskell] Type-Level Naturals Like Prolog?

2006-07-12 Thread Jared Warren
) = 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

[Haskell] Instances That Ignore Type Constraints? (HList-related)

2005-10-26 Thread Jared Warren
) 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

[Haskell] Closed Projections on HLists?

2004-11-17 Thread Jared Warren
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

Resolving Ambiguous Types

2003-11-20 Thread Jared Warren
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

Beta Reduction, undefined vs Type Classes

2003-11-09 Thread Jared Warren
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