ff-notes / ron

Haskell implementation of RON and RON-RDT
BSD 3-Clause "New" or "Revised" License
65 stars 9 forks source link

Generate lensish API #13

Open cblp opened 6 years ago

cblp commented 6 years ago
-- 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
dpwiz commented 5 years ago

Maybe make a ron-lens package with all the fancy stuff for those who like such things?

cblp commented 5 years ago

The problem is that lenses must be generated from the schema, so they go to ron-schema-gen or something like that.