
Hi, Am Freitag, den 19.08.2016, 11:16 -0700 schrieb Theodore Lief Gannon:
Well... there's that rather worrisome introductory paragraph of the Data.Composition docs, though:
"This module is for convenience and demonstrative purposes more than it is for providing actual value. I do not recommend that you rely on this module for performance-sensitive code. Because this module is not based on Prelude's (.), some chances at optimization might be missed by your compiler."
I wonder if that is really something to worry about. Prelude’s (.) is not special in any way: -- | Function composition. {-# INLINE (.) #-} -- Make sure it has TWO args only on the left, so that it inlines -- when applied to two functions, even if there is no final argument (.) :: (b -> c) -> (a -> b) -> a -> c (.) f g = \x -> f (g x) The INLINE pragma and the definition with the right arity could be used in Data.Composition as well, and it would yield the same results. Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org