[CST-2] Types: Ex 4.3.2

Steve Bishop smb50@cam.ac.uk
31 May 2002 14:03:35 +0100


> He is a bit brief about what constitutes a value on slide 34 -- he doesnt
> include lists, so perhaps we can say
> 
> let l = \x.x :: nil in
> case l of nil => nil
>     | f::tail => if (f true) then (f nil) else (f nil)
> 
> which has type 'a list (I think!) but wouldn't be allowed in (\x.x)::nil
> isnt a value.

This sounds plausable if you ignore the fact that you can encode lists
using lambdas.... ;-)

Steve