{-# LANGUAGE CPP, NoImplicitPrelude #-}
module Data.Functor.Compat (
module Base
, Functor(..)
, ($>)
, void
, (<&>)
, unzip
) where
import Data.Functor as Base
#if !(MIN_VERSION_base(4,7,0))
import Control.Monad.Compat (void)
import Data.Function (flip)
#endif
#if !(MIN_VERSION_base(4,19,0))
import Data.Tuple (fst, snd)
#endif
#if !(MIN_VERSION_base(4,7,0))
infixl 4 $>
($>) :: Functor f => f a -> b -> f b
($>) = flip (<$)
#endif
#if !(MIN_VERSION_base(4,11,0))
(<&>) :: Functor f => f a -> (a -> b) -> f b
as <&> f = f <$> as
infixl 1 <&>
#endif
#if !(MIN_VERSION_base(4,19,0))
unzip :: Functor f => f (a, b) -> (f a, f b)
unzip :: forall (f :: * -> *) a b. Functor f => f (a, b) -> (f a, f b)
unzip f (a, b)
xs = ((a, b) -> a
forall a b. (a, b) -> a
fst ((a, b) -> a) -> f (a, b) -> f a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f (a, b)
xs, (a, b) -> b
forall a b. (a, b) -> b
snd ((a, b) -> b) -> f (a, b) -> f b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f (a, b)
xs)
#endif