Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6571827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:55:50+00:00 2026-05-25T14:55:50+00:00

map :: (a -> b) -> [a] -> [b] fmap :: Functor f =>

  • 0
map :: (a -> b) -> [a] -> [b]

fmap :: Functor f => (a -> b) -> f a -> f b

liftM :: Monad m => (a -> b) -> m a -> m b

Why do we have three different functions that do essentially the same thing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:55:50+00:00Added an answer on May 25, 2026 at 2:55 pm

    map exists to simplify operations on lists and for historical reasons (see What's the point of map in Haskell, when there is fmap?).

    You might ask why we need a separate map function. Why not just do away with the current
    list-only map function, and rename fmap to map instead? Well, that’s a good question. The
    usual argument is that someone just learning Haskell, when using map incorrectly, would much
    rather see an error about lists than about Functors.

    — Typeclassopedia, page 20

    fmap and liftM exist because monads were not automatically functors in Haskell:

    The fact that we have both fmap and liftM is an
    unfortunate consequence of the fact that the Monad type class does not require
    a Functor instance, even though mathematically speaking, every monad is a
    functor. However, fmap and liftM are essentially interchangeable, since it is
    a bug (in a social rather than technical sense) for any type to be an instance
    of Monad without also being an instance of Functor.

    — Typeclassopedia, page 33

    Edit: agustuss’s history of map and fmap:

    That’s not actually how it happens. What happened was that the type of map was generalized to cover Functor in Haskell 1.3. I.e., in Haskell 1.3 fmap was called map. This change was then reverted in Haskell 1.4 and fmap was introduced. The reason for this change was pedagogical; when teaching Haskell to beginners the very general type of map made error messages more difficult to understand. In my opinion this wasn’t the right way to solve the problem.

    — What's the point of map in Haskell, when there is fmap?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a map that is cut up into a number of regions by
Map Reduce is a pattern that seems to get a lot of traction lately
std::map<any, string> is not working so I wonder if there's another approach to have
std::map<std::string, int> m; // Can I make assumption that m[NoSuchKey] will return 0? std::cout
std::map<int,int> mapy; ++mapy[5]; Is it safe to assume that mapy[5] will always be 1?
AFAIK, F# Map and set are implemented as red-black trees, so I guess that
I have map the entities in .hmb.xml and define attribute for all entity in
I have a map: Map<String, String> ht = new HashMap(); and I would like
I have a map and I want to find the minimum value (right-hand side)
i have a map file which has several tile images in the form of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.