tis 2004-03-30 klockan 17.30 skrev S. Alexander Jacobson:
> I would assume that this function:
> 
>   foo list@(h:t) = list
> 
> is equivalent to
> 
>   foo list = list
>      where (h:t)=list
> 
> But passing [] to the first generates an error
> even though h and t are never used!  Passing [] to
> the second works just fine.

You can write this as

> foo' list@(~(h:t)) = list

foo' [] will evaluate to []. The H98 report calls it an "irrefutable
pattern", IIRC.


Regards,
Martin

_______________________________________________
Haskell mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell

Reply via email to