Status of List

55 views
Skip to first unread message

Richard Dallaway

unread,
Jun 23, 2012, 1:23:27 PM6/23/12
to roy...@googlegroups.com
Hello

I noticed in prelude.roy that the List type is commented out.  I was wondering what the status of that was?   

I did just try to use it as is, but didn't get too far:

roy> data List a = Cons a (List a) | Nil
roy> Cons 7 Nil
Error: Type error on line 0: Function(List #as) is not List Number

I'm using the bitbucket code base (make deps; make; ./roy)

Thank you!
Richard

Richard Dallaway

unread,
Jun 24, 2012, 2:19:00 PM6/24/12
to roy...@googlegroups.com
As context, what I'm trying to do is follow along with the fantastic IEEE article.

Brian McKenna

unread,
Jun 26, 2012, 7:50:47 AM6/26/12
to roy...@googlegroups.com
Hey Richard,

I had to make a change to tags. They are now functions and functions
of 0-arity require unit () to be applied to them. "Constructing" a Nil
is now like:

Nil ()

I usually do something like this though:

let nil = Nil ()

Which is annoying. That's probably something that the compiler should do... :)

I pushed a change that updates the code to something that should work
(still commented out).

Richard Dallaway

unread,
Jun 26, 2012, 8:06:42 AM6/26/12
to roy...@googlegroups.com
Thank you... that's working for me. Cheers!
Reply all
Reply to author
Forward
0 new messages