[Haskell-beginners] Is there an idiom for this?

emacstheviking objitsu at gmail.com
Mon Nov 16 11:53:28 UTC 2015


I guess it depends on the final use cases... you could use currying to
partially evaluate some stuff ready, locked and loaded as it were but the
example you have  given shows to distinct functions pres1 and pred2.

I guess the short answer is "yes" but it depends on how you do it!

:)
Sean


On 16 November 2015 at 11:44, Mark Carter <alt.mcarter at gmail.com> wrote:

> Suppose I want to use an argument twice, as for example in the expression:
> (\x -> (pred1 x) and (pred2 x))
>
> Is there a shorter way of doing this?
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20151116/78b641a6/attachment.html>


More information about the Beginners mailing list