packages feed

papa-0.4.0: src/Papa/Base/Data/Functor.hs

{-# LANGUAGE CPP #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -Wall #-}

module Papa.Base.Data.Functor (
  module P,
  map,
) where

import Data.Functor as P (
  Functor (fmap, (<$)),
  void,
  ($>),
  (<$>),
#if MIN_VERSION_base(4,11,0)
  (<&>),
#endif
 )

{-# INLINE map #-}
-- | Map a function over a functor.
--
-- >>> map (\x -> x) [1,2,3]
-- [1,2,3]
-- >>> import Data.Maybe (Maybe(..))
-- >>> map (\x -> x) (Just 5)
-- Just 5
-- >>> map (\x -> x) Nothing
-- Nothing
map ::
  (Functor f) =>
  (a -> b) ->
  f a ->
  f b
map =
  fmap