P1 looks like a 1-element, trivial type of product . In Haskell, it will be written as:
data P1 a = P1 a
( Identity type in Haskell).
those. this is a container that contains some other type a .
This type also implements the simplest monad, Identity , which allows you to opaquely apply functions to the contents of a field.
Computably, there is no reason to use the Identity monad instead of the much simpler act of simply applying functions to their arguments, but this can be useful in designing monad transformer stacks.
The monadic realization of the identical monad is trivial,
return a = P1 a (P1 m) >>= k = km
As you can see, this is just a functional application.
Don stewart
source share