concept Coercible in category haskell

appears as: Coercible
Haskell in Depth

This is an excerpt from Manning's book Haskell in Depth.

The Coercible looks like a type class, but it is actually not. It belongs to the Constraint kind. We cannot define instances of Coercible, GHC infers them for us. When we write a newtype declaration, GHC infers the corresponding instance of Coercible. In our example, we have Coercible Age Int generated. Moreover, GHC lifts this instance to Coercible [Age] [Int] automatically. It is also able to use symmetry and get Coercible Int Age and Coercible [Int] [Age]. It’s the latter instance that allows us to use coerce instead of implementing toAges with map.

type family Id t
type instance Id t = t