Closed cartazio closed 11 years ago
So my understanding is that currently every optional field needs to be a monoid instance to handle nicely being empty or not.
What i'm also noticing is that while optional field examples are given as
f:: Optional n (Last a),
f:: Optional n (Last a)
this a) could just as well be f:: Optional n (First a),
f:: Optional n (First a)
b) if I want to get the value I care about at the end, i need to do getLast $ getValue f
getLast $ getValue f
to have a result type a which i guess i'm ok with since newtypes don't have any overhead.
a
realized its a nonissue :)
So my understanding is that currently every optional field needs to be a monoid instance to handle nicely being empty or not.
What i'm also noticing is that while optional field examples are given as
f:: Optional n (Last a)
,this a) could just as well be
f:: Optional n (First a)
,b) if I want to get the value I care about at the end, i need to do
getLast $ getValue f
to have a result type
a
which i guess i'm ok with since newtypes don't have any overhead.