
Hello, I have this : cons8 n l = n : l x = cons8 8 [1,2,3] main = print x This will be the output: [8.1.2.3] Now the problem is how I can take care that the output will be [1,2,3,4,8] I have to change the function for it. I tried switching n and L in the function but that will not work. Or does I have to do x = cons [1,2,3] 8 and make the function like this cons8 l n = l : n Roelof --- Dit e-mailbericht bevat geen virussen en malware omdat avast! Antivirus-bescherming actief is. http://www.avast.com

Hi, W dniu 03.03.2014 18:04, Roelof Wobben pisze:
I am studing this by following the wiki tutorial and then the Haskell basic tutorial. But if you have a better tutorial I'm happy to study this one too.
Roelof
Benjamin Edwards schreef op 3-3-2014 17:59:
The problem is that you don't seem to understand how singly linked lists work. I would recommend studying this first, then understanding how to append a value to the end of the list in haskell will probably make a lot more sense.
This is of course mailing list for beginners and we are happy to help you, but your questions are _very_ basic. Please take a look at http://learnyouahaskell.com. Regards, Emanuel
participants (3)
-
Benjamin Edwards
-
Emanuel Koczwara
-
Roelof Wobben