points by lgas 2 years ago

Also helpful to note that the "location" can be virtual. For example you could have a lens into the hours field a string that contains an ISO-8601 formatted date, so you could do something like

    let s = "20240722T193456.789-0800"
    putStrLn $ 19840206T193456.789-0800  -- prints "20240722T203456.789-0800"
and they can be composed, so if you have some other lens that gets from your outer structure to an ISO-8601 formatted date string field, let's call that lens `fieldLens` then `fieldLens . hours` will get from your outer structure to the hours field of that date field.