[Haskell] a quick question

2011-02-02 Thread Navin Rustagi
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

Re: [Haskell] a quick question

2011-02-02 Thread Ramy Abdel-Azim
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

Re: [Haskell] a quick question

2011-02-02 Thread Navin Rustagi
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:

Re: [Haskell] a quick question

2011-02-02 Thread Ramy Abdel-Azim
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

Re: [Haskell] a quick question

2011-02-02 Thread Julian Gilbey
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 ... ? ... : ...

Re: [Haskell] a quick question

2011-02-03 Thread Matthias Görgens
> 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

Re: [Haskell] a quick question

2011-02-03 Thread malcolm.wallace
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

Re: [Haskell] a quick question

2011-02-03 Thread Brandon S Allbery KF8NH
-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