Solution

ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2015/principles-of-programming-languages/1/e/solution

The identity monad embeds a value unchanged and sequences by ordinary application:
type IdM a = a
result :: a -> IdM a
result x = x
bind :: IdM a -> (a -> IdM b) -> IdM b
bind x f = f x
All three monad laws reduce to substitution in function application. There is no additional program state, failure alternative or continuation layer:

New to topics? Read the docs here!