[Haskell-cafe] Object Oriented programming for Functional Programmers
Kim-Ee Yeoh
ky3 at atamo.com
Fri Jan 4 13:51:13 CET 2013
On Fri, Jan 4, 2013 at 7:27 PM, David Thomas <davidleothomas at gmail.com>wrote:
> Well, "hidden" - it *is* right there in the type signature still, it just
> doesn't *look* like an argument.
>
If you squint hard enough, (=>) looks like (->). Or maybe the other way
round. Whatever. :)
> It also might be optimized away in static cases (certainly, it *could*
> happen, whether does or is even worthwhile is another question).
>
The optimization at stake is specialization. Given (Num a => a), specialize
it to Int or Double or X so that it's memoizably first-class, which is
where functions still fall down [1]. All functions are values but data
values still play nicer than others.
Isn't fixing this the real cure for the monomorphism restriction?
[1]
http://lukepalmer.wordpress.com/2009/07/07/emphasizing-specialization/#comment-862
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130104/4afbfd8c/attachment.htm>
More information about the Haskell-Cafe
mailing list