by rishav_sharan · 6y ago · 0 comments
Then came the part where I needed to work with list of records and realized that something as basic as that which I take for granted in other languages, is a monstrously complicated concept in f#. I got introduced to the shady world of Lenses, tried my hand for a bit and decided to get out. Lenses are not for me.
I can't believe that a language makes updating records so difficult. F# is my first functional language and while I expected some friction in doing such stuff in a functional language, I never expected so much work around something so trivial. But is does helps me understand why people don't use F# for things like gamedev.
Anyway TLDR; love the language. Wish that it will make concepts like Lens much easier to use in the language
There are also some libraries out there that make this easier.
I'd say it's an annoyance and should be improved, but it's nowhere near a blocker for us.
Here I ended up reading bid docs on something called Lens and was never able to apply it correctly. here is the repo i was working on https://github.com/rishavs/coral/blob/master/Engine.fs
I must be missing something, but this sounds like a pretty straightforward List.map