On 2002-09-21T12:56:13-0700, Russell O'Connor wrote:
> case (number g) of
>  Just n -> Just (show n)
>  Nothing ->
>   case (fraction g) of
>    Just n -> Just (show n)
>    Nothing ->
>     case (nimber g) of
>      Just n -> Just ("*"++(show n))
>      Nothing -> Nothing

How about something like:

    msum [ liftM show (number g)
         , liftM show (fraction g)
         , liftM (("*"++).show) (nimber g) ]

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
So the choice which Lomborg presents us with, of whether to save a drowning
Tuvaluan (climate change) or a dying Somalian (water and sanitation) is not 
a choice at all -- in fact we need to do both, and not least because one is
unlikely to be successful without the other.   http://www.anti-lomborg.com/

Attachment: msg02004/pgp00000.pgp
Description: PGP signature

Reply via email to