Send Beginners mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Is there an idiom for this? (Mark Carter)
   2. Re:  Is there an idiom for this? (emacstheviking)


----------------------------------------------------------------------

Message: 1
Date: Mon, 16 Nov 2015 11:44:35 +0000
From: Mark Carter <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Is there an idiom for this?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

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?


------------------------------

Message: 2
Date: Mon, 16 Nov 2015 11:53:28 +0000
From: emacstheviking <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Is there an idiom for this?
Message-ID:
        <CAEiEuULHWhechDwUF417Rnr55RDrEVUFVOgiQ6=5-8jux3p...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

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 <[email protected]> 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
> [email protected]
> 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-0001.html>

------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 89, Issue 28
*****************************************

Reply via email to