Hi Folks,
I have a lambda expression that can be used to construct a list of values:
cons = (\a -> (\b -> (\f -> f a b)))
Here is an example that uses cons to construct "hello"
hello = cons 'h' (cons 'e' (cons 'l' (cons 'l' 'o')))
And here is a lambda expression that returns the tail of a list created using cons:
tail' = (\c -> c (\a -> (\b -> b)))
I would like to create a function that computes the length of a cons-created list:
length' = \xs -> if ( null' xs ) then 0 else length' (tail' xs) + 1
How would I define null' to determine if a cons list is empty?
null' = ???
/Roger
_______________________________________________
Beginners mailing list
Beginners@haskell.orghttp://www.haskell.org/mailman/listinfo/beginners