Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-11 Thread Keean Schupke
Greg Buchholz wrote: Wow. Color me impressed. A little under a week ago, I stumbled onto Joy, and thought to myself that it could be translated almost directly into Haskell (which would imply it was possible to statically type). Well, it wasn't quite as direct as I had initially thought, but

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-11 Thread Greg Buchholz
Keean Schupke wrote: The things to notice are using types as instance labels, that constraints form horn clause compile time meta-programs (in a non-backtracking prolog style) and that multi-parameter classes with functional depandencies simulate some dependant types. I think I

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-09 Thread Keean Schupke
Greg Buchholz wrote: Keean Schupke wrote: I dont see why this is illegal... what do we want? take the top two items from the stack? With the code below (direct translation from tuples to HLists) I still get an occurs check error when trying to define fact5... Okay the reason is that

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-09 Thread Greg Buchholz
Keean Schupke wrote: Haskell is not dependantly typed, so cannot deal with types that depend on values. Can anyone recommend a nice dependently typed language to play with? Cayenne, Epigram, other? Greg Buchholz ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-09 Thread Peter G. Hancock
Greg Buchholz wrote (on Wed, 09 Mar 2005 at 20:08): Can anyone recommend a nice dependently typed language to play with? Cayenne, Epigram, other? http://www.cs.chalmers.se/~catarina/agda/ See also the sexy IDE alfa: http://www.cs.chalmers.se/~hallgren/Alfa/ Peter Hancock

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-09 Thread Keean Schupke
Greg Buchholz wrote: Keean Schupke wrote: Haskell is not dependantly typed, so cannot deal with types that depend on values. Can anyone recommend a nice dependently typed language to play with? Cayenne, Epigram, other? I have refactored your code into a type level Haskell program. This

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-09 Thread Greg Buchholz
Keean Schupke wrote: I have refactored your code into a type level Haskell program. This has the nice advantage that it is extensible. Wow. Color me impressed. A little under a week ago, I stumbled onto Joy, and thought to myself that it could be translated almost directly into Haskell

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-08 Thread Daniel Fischer
Keean Schupke wrote: Daniel Fischer wrote: And, BTW, that's why Keean et al's HList library doesn't help here either, the type of an HList determines the number of elements and the type of each, so there we face the same problems as with nested tuples. What we need is type Stack =

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-08 Thread Daniel Fischer
Am Dienstag, 8. März 2005 17:31 schrieben Sie: Daniel Fischer wrote: The problem is that for the recursion combinators we need polymorphic recursion functions. For fact3 we need rec2 :: forall l. (HCons a (HCons a l) - HCons a l), I dont see why this is illegal... what do we want? take the

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-08 Thread Greg Buchholz
Keean Schupke wrote: I dont see why this is illegal... what do we want? take the top two items from the stack? With the code below (direct translation from tuples to HLists) I still get an occurs check error when trying to define fact5... Compiling Main ( joy3.hs, interpreted

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Greg Buchholz
Daniel Fischer wrote: Am Freitag, 4. M?rz 2005 19:35 schrieb Greg Buchholz: So, can anyone direct me towards more information on exactly what an Occurs check is, or does anyone see an easy fix to my problems? If I remember correctly, an occurs check is checking whether a type variable

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Daniel Fischer
Am Montag, 7. März 2005 17:58 schrieb Greg Buchholz: Daniel Fischer wrote: Am Freitag, 4. März 2005 19:35 schrieb Greg Buchholz: So, can anyone direct me towards more information on exactly what an Occurs check is, or does anyone see an easy fix to my problems? If I remember

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Keean Schupke
Daniel Fischer wrote: And, BTW, that's why Keean et al's HList library doesn't help here either, the type of an HList determines the number of elements and the type of each, so there we face the same problems as with nested tuples. What we need is type Stack = [ArbitraryType] (from the HList

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread Greg Buchholz
Daniel Fischer wrote: I think, it would be possible to define recursion combinators for specific patterns, like this functions takes 4 elements from the stack, this one 3 and so on, but then you would need combinators for all these patterns, which is rather cumbersome. Hmm. The

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-07 Thread John Meacham
On Mon, Mar 07, 2005 at 08:47:11PM +0100, Daniel Fischer wrote: And, BTW, that's why Keean et al's HList library doesn't help here either, the type of an HList determines the number of elements and the type of each, so there we face the same problems as with nested tuples. What we need is

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-06 Thread Keean Schupke
Daniel Fischer wrote: I don't know Joy, but probably there the stack is (roughly) a heterogenous list, which is hard to model in Haskell, think of data Element = Bool Bool | Char Char | Int Int . . . | IntToBool

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-06 Thread Daniel Fischer
Keean wrote: Not saying it isn't tricky - but thats what the HList library (http://www.cwi.nl/~ralf/HList) implements, a heterogenous list. It works slightly differently using classes, but does abstract the workings enough to be useful, to construct an HList you can do: hlist = a .*.

Re: [Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-05 Thread Daniel Fischer
Am Freitag, 4. März 2005 19:35 schrieb Greg Buchholz: Recently, while investigating the (non-statically typed) stack-based functional language Joy (http://www.latrobe.edu.au/philosophy/phimvt/joy.html), I became interested in seeing if I could implement Joy's combinators in Haskell. I

[Haskell-cafe] Joy Combinators (Occurs check: infinite type)

2005-03-04 Thread Greg Buchholz
Recently, while investigating the (non-statically typed) stack-based functional language Joy (http://www.latrobe.edu.au/philosophy/phimvt/joy.html), I became interested in seeing if I could implement Joy's combinators in Haskell. I started with a stack based implementation using nested