Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

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


Today's Topics:

   1. Re:  weird constraint (Yitzchak Gale)


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

Message: 1
Date: Sun, 20 Jan 2019 02:09:15 +0200
From: Yitzchak Gale <g...@sefer.org>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Subject: Re: [Haskell-beginners] weird constraint
Message-ID:
        <caorualbuq-pf2ozoxhna4nwcblu0uw9w2rin_odfyd4-kdf...@mail.gmail.com>
Content-Type: text/plain; charset="UTF-8"

On 16/01/2019 15:52, Dimitri DeFigueiredo wrote:
>> ...I was expecting to get:
>> inc . const :: Num a => a -> b -> a
>>
>> Prelude> inc x = x + 1

On Wed, Jan 16, 2019 at 5:06 PM Sylvain Henry <sylv...@haskus.fr> wrote:
> Remember that a -> b -> a is equivalent to a -> (b -> a)...

To augment Sylvain's explanation: The upshot of this unexpected type -
which would almost certainly lead to a type error in any real program -
is that you probably want
const . inc
rather than
inc . const

-Yitz


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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 127, Issue 5
*****************************************

Reply via email to