4 ms·
The resulting type of the expression is inconsistent. First case returns a Maybe, second case returns whatever the type of a is. edit: replaced option with may
by davidgrenier 8y ago
The resulting type of the expression is inconsistent. First case returns a Maybe, second case returns whatever the type of a is.
edit: replaced option with maybe.
- dmead 8y agoAh right you are. It's missing something to unwrap from the maybe type at least.
- moomin 8y agoI think it’d work if the initial type was “Maybe Maybe x”, (in which the function is join) but I seriously doubt that was what was intended. The roach motel aspect of monads is not underestimating.
- moomin 8y agoGrief, I need a proof-reader.