What is the difference between Const and Constant?

There seem to be two implementations of a constant functor:

Why do they both exist, and which one should I use?

+7
haskell
source share
1 answer

They do the same thing. As far as I know, most people use Const because it is older (as Bakuriu noted), is in base and has a shorter name. Example: lens uses Const . At least one of the discussions about combining them in the library mailing list back in 2012, but it did not go through, apparently due to differences in opinion about the name and the module most suitable for it.

+9
source share

All Articles