ron
ron copied to clipboard
Generate lensish API
-- now
note_status_assignIfDiffer newStatus = do
curStatus <- note_status_read
when (curStatus /= newStatus) $
note_status_assign newStatus
-- should be
assignIfDiffer new = do
cur <- read
when (cur /= new) $
assign new
- note_status_assignIfDiffer
+ note_status &~ assignIfDiffer
Maybe make a ron-lens package with all the fancy stuff for those who like such things?
The problem is that lenses must be generated from the schema, so they go to ron-schema-gen or something like that.