[Haskell-cafe] Inlinable (>>>)

Joe Hillenbrand joehillen at gmail.com
Fri Mar 3 05:19:34 UTC 2017


CCing  Libraries

On Thu, Mar 2, 2017 at 7:18 AM, David Sorokin <david.sorokin at gmail.com> wrote:
> Hi Cafe,
>
> I offer to define the functions of the Control.Category module inlinable:
>
> -- | Right-to-left composition
> (<<<) :: Category cat => cat b c -> cat a b -> cat a c
> {-# INLINABLE (<<<) #-}
> (<<<) = (.)
>
> -- | Left-to-right composition
> (>>>) :: Category cat => cat a b -> cat b c -> cat a c
> {-# INLINABLE (>>>) #-}
> f >>> g = g . f
>
> Perhaps all functions from this module should be marked by this pragma as possible.
>
> I suppose that the current definition without the pragma is the cause why the execution slows down in my applications, when using monad parameters in the constraints. I noticed it yet two or three years ago, while playing with the monad transformers, but decided to write now.
>
> Best regards,
> David Sorokin
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.


More information about the Haskell-Cafe mailing list