<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2018-05-24 23:00 GMT+02:00 Olaf Klinke <span dir="ltr"><<a href="mailto:olf@aatal-apotheke.de" target="_blank">olf@aatal-apotheke.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[...] I'm struggling to make the concept of monoidal configuration work when there is no sensible default configuration. Suppose my configuration type is <br>
<br>
data Config = Config {foo :: Bool, bar :: Int}<br>
<br>
with no reasonable default, e.g.<br>
<br>
emptyConfig = Config {<br>
foo = error "you did not specify option foo",<br>
bar = error "you did not specify option bar"<br>
}<br>
[...]<br></blockquote><div><br></div><div>I find the approach in <a href="https://medium.com/@jonathangfischoff/the-partial-options-monoid-pattern-31914a71fc67">https://medium.com/@jonathangfischoff/the-partial-options-monoid-pattern-31914a71fc67</a> quite straightforward, without any need for higher-kinded stuff, generics or lenses: Just distinguish between partial and non-partial options, and make a Monoid instance only for the partial ones.</div><div><br></div><div>Cheers,</div><div> S.</div><div> </div></div></div></div>