[Haskell-beginners] confusing type signature with sections

Karl Voelker ktvoelker
Wed Oct 2 17:25:23 UTC 2013


On Tue, Oct 1, 2013 at 5:25 PM, Patrick Redmond <plredmond at gmail.com> wrote:

>     Prelude> :t ((+ 1) / 2)
>     ((+ 1) / 2) :: (Fractional (a -> a), Num a) => a -> a
>

The key is that typeclasses are open. You could write a Fractional instance
for (a -> a), in which case it would be possible to do _something_ with
this code. Would it be useful? Even Haskell can't guarantee that.

-Karl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20131002/669d9aee/attachment.html>



More information about the Beginners mailing list