[Haskell-cafe] YAWQ (Yet Another Wash Question)

Jeremy Shaw Jeremy.Shaw at linspireinc.com
Thu Feb 24 12:01:06 EST 2005


I am making a wild guess because I do not have all the information in
front of me right now but would this work ?

... do x <- if cond
>                then textInputField ...
>                else return ()

note the addition of 'return' to the else clause ?

Jeremy Shaw.

On Feb 24, 2005 08:42 AM, John Goerzen <jgoerzen at complete.org> wrote:

> Thanks for everyone that's helped me out with my Wash questions. I
> have
> one more.
> 
> I have a textInputField that I only want to display on a form in
> certain
> cituations.  I can't figure out how to make this work.  For instance:
> 
> ... do if cond
>           then x <- textInputField ...
>           else ()
>        ...
>        submit ...
> 
> Well, two problems there... first, the scope of the x doesn't reach to
> the submit.  Second, there's a type issue.  So I thought maybe I could
> figure out something like this:
> 
> ... do x <- if cond
>                then textInputField ...
>                else ()
> 
> still stuck with the typing problem.
> 
> So I thought maybe something like this...
> 
> ... do let x = if cond
>                   then Just $ textInputField ...
>                   else Nothing
> 
> Though I suspect this won't work either, since the textInputField
> won't
> actually be processed at the right place in the program.
> 
> I then thought maybe I could kludge by this with a hidden field, but I
> can't find one of those, either.
> 
> Ideas, anyone?
> 
> Thanks,
> John
> 
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe

--

This message contains information which may be confidential and privileged. Unless you are the 
addressee (or authorized to receive for the addressee), you may not use, copy or disclose to anyone 
the message or any information contained in the message. If you have received the message in error, 
please advise the sender and delete the message.  Thank you.


More information about the Haskell-Cafe mailing list