[Haskell-beginners] if True than let...

Andrew Wagner wagner.andrew at gmail.com
Thu Jun 25 16:22:19 EDT 2009


Try this: let b = if a == True then "+" else "-" in ...

On Thu, Jun 25, 2009 at 4:12 PM, Bernhard Lehnert <b.lehnert at gmx.de> wrote:

> Hi,
>
> I'm sorry because I am absolutely sure, this is bloody obvious to the
> knowing. Being a total beginner I'm stuck. In the main = do part I
> wrote:
>
> 1:     if a == True then putStrLn "Yes!" else putStrLn "No."
> 2:     if a == True then let b = "+" else let b = "-"
>
> Line #1 works perfectly well.
> Read line #2 as pseudocode and you'll see what I want to do. Read it in
> ghci and it produces
>     "  parse error on input `='    "
>
> I tried 'case of' but it doesn't work either.
>
> What am I doing wrong?
> Thank you for any help,
>
> Bernhard
>
>
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090625/d8143aa9/attachment.html


More information about the Beginners mailing list