[Haskell-cafe] Substituting values
Kim-Ee Yeoh
ky3 at atamo.com
Sat Dec 22 06:35:15 CET 2012
This is reminiscent of the Either (exception) monad where Left values, the
exceptions, pass through unaltered, and Right values are transformable,
i.e. acted on by functions.
But I have no idea what you're trying to achieve in the bigger picture.
Help us help you by fleshing out your use case.
-- Kim-Ee
On Sat, Dec 22, 2012 at 12:46 AM, Radical <radical at google.com> wrote:
> Sometimes I'll need something like:
>
> if value == Foo then Bar else value
>
> Or some syntactic variation thereof:
>
> case value of { Foo -> Bar; _ -> value }
>
> Is there a better/shorter way to do it? I'm surprised that it's more
> complicated to substitute a value on its own than e.g. in a list, using
> filter. Or perhaps I'm missing the right abstraction?
>
> Thanks,
>
> Alvaro
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121222/de2fb147/attachment.htm>
More information about the Haskell-Cafe
mailing list