[Haskell-cafe] Access to list

jerzy.karczmarczuk at info.unicaen.fr jerzy.karczmarczuk at info.unicaen.fr
Sun Jan 13 11:10:07 EST 2008


Jed Brown writes: 

> On 13 Jan 2008, frr149 at easyjob.net wrote:
>>
>> If I define the follwoing functions: 
>>
>> car (x:_) = x
>> car [] = []
> 
> This won't typecheck.  It helps to add a type signature
>   car :: [a] -> a

Good will, wrong diagnosis. This WILL check. 

car :: forall a. [[a]] -> [a] 


J. Karczmarczuk


More information about the Haskell-Cafe mailing list