Hi all,
I am stuck at a piece of code and am not able to figure out the error.
uptable::[[Char]]->[([Char],Int,Int,Int,Int)]->[([Char],Int,Int,Int,Int)]
uptable (xf:xs) main_array = map (\(x,y,z,r,t)-> do if x==xf then tupup x y z r
t second xs ) main_array
here tupup and second are functi
Missing else?
On Wed, Feb 2, 2011 at 8:49 PM, Navin Rustagi wrote:
> Hi all,
>
> I am stuck at a piece of code and am not able to figure out the error.
>
>
> uptable::[[Char]]->[([Char],Int,Int,Int,Int)]->[([Char],Int,Int,Int,Int)]
> uptable (xf:xs) main_array = map (\(x,y,z,r,t)-> do if x==xf t
Sorry, dumb of me doesn't give this error anymore.
thanks,
Navin
From: Ramy Abdel-Azim
To: Navin Rustagi
Cc: Haskell@haskell.org
Sent: Wed, February 2, 2011 7:55:09 PM
Subject: Re: [Haskell] a quick question
Missing else?
On Wed, Feb 2, 2011 at 8:
thanks,
> Navin
> --
> *From:* Ramy Abdel-Azim
> *To:* Navin Rustagi
> *Cc:* Haskell@haskell.org
> *Sent:* Wed, February 2, 2011 7:55:09 PM
> *Subject:* Re: [Haskell] a quick question
>
> Missing else?
>
> On Wed, Feb 2, 2011 at 8:49 PM, Navin Rustagi w
On Wed, Feb 02, 2011 at 10:01:08PM -0500, Ramy Abdel-Azim wrote:
> No need to apologize. Not dumb of you. The mandatory else is unusual. I
> don't personally know of any other language that requires an else for every
> if.
Indeed. Haskell's if ... then ... else ... is akin to C's ... ? ... :
...
> uptable::[[Char]]->[([Char],Int,Int,Int,Int)]->[([Char],Int,Int,Int,Int)]
> uptable (xf:xs) main_array = map (\(x,y,z,r,t)-> do if x==xf then tupup x y
> z r t second xs ) main_array
Why do you have a `do' in that snippet?
___
Haskell mailing list
Has
Can I suggest you take this discussion to either the haskell-beginners list, or haskell-cafe?This list (haskell@haskell.org) is intended primarily for announcements.Regards,
MalcolmOn 03 Feb, 2011,at 09:33 AM, Matthias Görgens wrote:> uptable::[[Char]]->[([Char],Int,Int,Int,Int)]->[([Char],Int
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 2/2/11 22:01 , Ramy Abdel-Azim wrote:
> No need to apologize. Not dumb of you. The mandatory else is unusual. I
> don't personally know of any other language that requires an else for every
> if.
Haskell's if is an expression, best compared to the