Like many equations in Haskell-applied category theory, F ∘ IdB ≡ IdA ∘ F ≡ F should really just be read as equivalences. FComp Id Maybe Int
is very much not the same thing as FComp Maybe Id Int
to the type checker; however you can easily write
idFunctorIso :: Functor f => FComp f Id a -> f a
idFunctorIso (C fIdca) = fmap unId fIdca
idFunctorIso' :: Functor f => f a -> FComp f Id a
idFunctorIso' fa = C $ fmap Identity fIdc
which implies that both types contain the same information1. That's what we mean by saying they're isomorphic.
1No information is lost in either direction, since idFunctorIso' . idFunctorIso ≡ id
(as follows from the functor law fmap id ≡ id
, together with the fact that unC
and unId
are simple inverses of the newtype constructors).