Skip to content

Commit

Permalink
Add applyNT
Browse files Browse the repository at this point in the history
  • Loading branch information
phadej committed Oct 16, 2016
1 parent 5b93420 commit cdff4f0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Control/Natural.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ module Control.Natural
, type (~>)
-- * Conversion functions between the newtype and the synonym
, unwrapNT
-- * Type inference helper
, applyNT
-- * Class for Natural Transformations
, Transformation(..)
) where
Expand Down Expand Up @@ -84,3 +86,9 @@ instance Transformation f g (f :~> g) where
-- transformation wrappers, including ':~>'.
unwrapNT :: Transformation f g t => t -> (forall a . f a -> g a)
unwrapNT = (#)

-- | An alias to 'id', to help type-inference.
--
-- See <https://github.com/ku-fpg/natural-transformation/issues/9#issuecomment-172121060 comment on GitHub>
applyNT :: (f ~> g) -> (f ~> g)
applyNT nt = nt

0 comments on commit cdff4f0

Please sign in to comment.