Skip to content

Commit

Permalink
Add some more Data.Functor functions; fixes #7817
Browse files Browse the repository at this point in the history
Added infixl4 $>.
Re-exported void from Data.Functor.
Also defined the fixity for <$ for non-GHC impls.
  • Loading branch information
Ian Lynagh committed Apr 21, 2013
1 parent bfe01f0 commit 6402f8d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Data/Functor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ module Data.Functor
(
Functor(fmap),
(<$),
($>),
(<$>),
void,
) where

import Control.Monad
#ifdef __GLASGOW_HASKELL__
import GHC.Base (Functor(..))
#else
#endif

#ifndef __GLASGOW_HASKELL__
infixl 4 <$

(<$) :: Functor f => a -> f b -> f a
(<$) = fmap . const
#endif
Expand All @@ -34,3 +41,8 @@ infixl 4 <$>
(<$>) :: Functor f => (a -> b) -> f a -> f b
(<$>) = fmap

infixl 4 $>

($>) :: Functor f => f a -> b -> f b
($>) = flip (<$)

0 comments on commit 6402f8d

Please sign in to comment.