Skip to content

Commit

Permalink
Merge pull request #168 from FlorentBecker/master
Browse files Browse the repository at this point in the history
Make Diagrams.Transform.under more polymorphic
  • Loading branch information
byorgey committed Mar 24, 2014
2 parents 7bcf0a5 + 3517183 commit 84c5127
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Diagrams/Transform.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
--
-----------------------------------------------------------------------------

{-# LANGUAGE TypeFamilies #-}

module Diagrams.Transform
( -- * Transformations
Transformation, inv, transl, apply, papply
Expand Down Expand Up @@ -52,5 +54,5 @@ conjugate t1 t2 = inv t1 <> t2 <> t1
-- @
--
-- for all transformations @t1@ and @t2@.
under :: Transformable a => (a -> a) -> Transformation (V a) -> a -> a
under :: (Transformable a, Transformable b, V a ~ V b) => (a -> b) -> Transformation (V a) -> a -> b
f `under` t = transform (inv t) . f . transform t

0 comments on commit 84c5127

Please sign in to comment.