[Haskell-beginners] first number is a list

Roelof Wobben rwobben at hotmail.com
Mon Jun 27 13:27:27 CEST 2011

Hello,  I have to find the first number is a list. So first I tried :  let mylast = last [1,2,3,4]mylast  This one works but you have to give 2 commands. So i was thinking about using list compreshion. So I did :  [x | x <- [1,2,3,4] , last ] But then I see these error :  Could not match expected type "Bool" with actual type [a0] -> a0 in the expression last in stdn of a list compreshion last in the expression : [x | x <- [1,2,3,4] , last ] What is my thinking error ? Roelof  		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110627/836943d8/attachment.htm>

More information about the Beginners mailing list