A good reference and example can be found in @fsoikin PR: https://github.com/paluh/purescript-undefined-is-not-a-problem/pull/16