Re: [Haskell-cafe] Inlinable (>>>)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Haskell-cafe] Inlinable (>>>)

Joe Hillenbrand
CCing  Libraries

On Thu, Mar 2, 2017 at 7:18 AM, David Sorokin <[hidden email]> 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.
_______________________________________________
Libraries mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Loading...