3 ms·
Honest question, if you look at this: https://github.com/Mojang/DataFixerUpper/blob/8b5f82ab78b30ff5813b3a7f3906cd3f4f732acf/src/main/java/com/mojang/datafixer
by suprfnk 8y ago
Honest question, if you look at this:
https://github.com/Mojang/DataFixerUpper/blob/8b5f82ab78b30ff5813b3a7f3906cd3f4f732acf/src/main/java/com/mojang/datafixers/optics/profunctors/ProfunctorFunctorWrapper.java https://github.com/Mojang/DataFixerUpper/blob/8b5f82ab78b30f...
Is that understandable to you? And does this really make solving some problems easier?
I've dabbled a bit in Haskell, but never got further than functors, applicatives and monads, and I always wonder whether this kind of stuff really helps.
(It probably doesn't help that Java is very verbose, especially compared to Haskell...)
- bjz_ 8y agoIt probably could do with some examples, and better docs, but it seems like they use this to update old chunks, which is a great use of lenses. But yeah, you'd have to weigh that up against how ugly it turns out to be in Java. It's not just because of the verbosity, it's the lack of being able to abstract over type-level functions that makes it quite icky to implement these abstractions in Java.
- kccqzy 8y ago> Is that understandable to you? Of course using lens in Java is going to have compromises and nothing is going to beat Haskell in readability for this kind of programs. As you pointed out, Java is verbose and that hurts the readability a lot. > And does this really make solving some problems easier? Whether this makes solving problems easier, I would say in Haskell, I routing compose half a dozen of optics to do a fold or update and it really makes things easier. I haven't read this Java version so I don't know whether the power-to-weight ratio here is similar.