The Bare type family removes nested layers of Compose newtypes so that values are easier to create. It also removes any Identity and Const newtypes it encounters, and recurses inside them.
However, recursing inside Identity and Const causes problems. It makes difficult to write fromBare-using functions polymorphic on the returned component. Bare gets stuck on the component's type variable and the functions do not compile:
This leads to unnecessary code duplication. If we stopped at Identity, Bare would never touch the type variable and wouldn't get stuck.
Strictly speaking, this is a breaking change, but the cases in which it breaks are very unlikely in practice: when using Identity or Const in the middle of a sequence of phases. Typically, these two applicatives will be used as the colophon of the sequence of phases.
The
Bare
type family removes nested layers ofCompose
newtypes so that values are easier to create. It also removes anyIdentity
andConst
newtypes it encounters, and recurses inside them.However, recursing inside
Identity
andConst
causes problems. It makes difficult to writefromBare
-using functions polymorphic on the returned component.Bare
gets stuck on the component's type variable and the functions do not compile:This leads to unnecessary code duplication. If we stopped at
Identity
,Bare
would never touch the type variable and wouldn't get stuck.Strictly speaking, this is a breaking change, but the cases in which it breaks are very unlikely in practice: when using
Identity
orConst
in the middle of a sequence of phases. Typically, these two applicatives will be used as the colophon of the sequence of phases.