Closed teh closed 7 years ago
After writing a bit more test code: Yea, we need the extra monadic layer. For usability I folded the pure
return into the unionValue
function instead of requiring an extra pure
before each unionValue
call. I'd be open to expose a unionValue'
that's not monadic
There's one last really important decision, and that's whether to make the union handlers themselves monadic. They are not at the moment.
My intuition says yes, people will sometimes need to run e.g IO actions before deciding which branch of a union to return, but I'm also slightly unhappy about the proliferation of
pure
orreturn
.If this all becomes a bit much we always have the option of introducing a
PureField
that cannot run any actions, and just takes a value?