[Haskell-beginners] another list comprehesion error
David Place
d at vidplace.com
Thu Jul 21 20:05:14 CEST 2011
On Jul 21, 2011, at 1:27 PM, Roelof Wobben wrote:
> roelof :: a -> b -> c -> (a,b,c)
> roelof n = [(x y z) | x^2+Y^2=Z^2 <- x<-[1..n], y<- [1..n], z<-[1..n]]
>
> But I get this error : oefening.hs:2:30: parse error on input `='
Hi, Roelof.
This short amount of code has many syntax and semantic errors. May I suggest that you might benefit from trying to make this function using only normal function application and the basic list functions. I think you will learn more about Haskell this way. Personally, i rarely use list comprehensions. I think they are not very modular.
Also, it might help people to understand your background a little. This way comments could be better focused. For instance, which other programming languages do you know?
____________________
David Place
Owner, Panpipes Ho! LLC
http://panpipesho.com
d at vidplace.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110721/820fa873/attachment.htm>
More information about the Beginners
mailing list