Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Ml > heterogeneous l...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 948 of 968
Post > Topic >>

heterogeneous lists??

by Mayer <mayer.goldberg@[EMAIL PROTECTED] > Apr 7, 2008 at 02:24 PM

Hello:

I found a reference on the internet to a puzzle posed by Bruce Duba.
The challenge is to define Nil and Cons to make the following type
check:

fun length (Nil) = 0
  | length (Cons (_, x)) = 1 + length (x);
val heterogeneous = Cons (1, Cons (true, Cons (fn x => x, Nil)));

I banged my head against this problem for a while, and nothing seems
to come up. Can someone please give me a hint here?

Thanks,

Mayer
 




 2 Posts in Topic:
heterogeneous lists??
Mayer <mayer.goldberg@  2008-04-07 14:24:22 
Re: heterogeneous lists??
torbenm@[EMAIL PROTECTED]  2008-04-09 10:08:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 0:31:18 CDT 2008.