concrete functor and monad transformers
#25Constant is redundant
I'm copying a reddit post of mine:
I'm only bringing this up here because transformers
doesn't have a github issue page, and it's not considered a "core library", so I'm not really sure where to ask these kinds of things.
There is a data type defined in the Control.Applicative
module in base
:
newtype Const a b = Const { getConst :: a }
There is a data type defined in the Data.Functor.Constant
module in transformers
:
newtype Constant a b = Constant { getConstant :: a }
The only difference I can think of is that the one from transformers
has a polykinded b
, and the one from base
is not. But maybe that has changed in base-4.9
. Anyways, my point is that it seems redundant and confusing to have both of these, and I'd like to see the one in transformers
be deprecated and removed in time. Is there a compelling reason that it exists, or were there historically problems with the Const
that base
provided?
Also, sorry about the mention of github. At the time, I didn't realize that darcshub had an issue tracker.
The main problem with removing it is that it would break Control.Applicative.Lift, with no smooth upgrade path. Still, perhaps better to do that sooner than later.
If
Control.Applicative.Lift
is to be broken, it would be a nice opportunity to newtypeErrors
(the type errors are all in terms ofLift Constant
)Const in base is now poly-kinded. Let's deprecate
Constant
(I suspect few people would be affected by this)