Hacker News new | ask | show | jobs
by Peaker 2943 days ago
Haskell record syntax with lenses is workable:

  import Control.Lens

  data MyRecord = MyRecord { _a :: Int, _b :: MyRecord }
  makeLenses ''MyRecord
Then you can use it nested like:

  over (b . b . a) (+5) myRecord
1 comments

Clojure people use the untyped equivalent of row types, i.e. being able to arbitrarily add and remove fields to and from a record. That would be nice to have in Haskell (though personally it's nowhere near a dealbreaker for me).
Haskell has reasonable implementations of row types as well.
A bold claim!
There are various library-level implementations. Here's the first one that turned up on Google:

https://raw.githubusercontent.com/target/row-types/master/ex...