Re:State of Elm 2017 Results
by crimsonalucard on Friday July 28, 2017 @10:39AM
(#14874558)
I was trying to build a tmux style svg based windowing system for elm. Guess what? this involves a tree. Trees don't go well with functional programming. Ever heard of a zipper? lol.
[ Parent
| on HN ]
> Trees don't go well with functional programming
What? Building trees is easy as pie in typed fp
http://hackage.haskell.org/package/containers-0.5.10.2/docs/...
> Ever heard of a zipper?
https://github.com/soupi/purescript-list-zipper/blob/master/...
Trees go extremely well with FP. In fact, a lot of Elm's core data structures are implemented with trees. Dicts, Arrays, Sets. Here's an example of a zipper package in Elm: http://package.elm-lang.org/packages/wernerdegroot/listzippe...
I used to think that walking trees was a standard task in functional programming languages because the one I am used to (Clojure) contains gobs of functions in its library for all kinds of walking, zipping, combining, separating trees of different structures. But I've learned since studying other functional languages that it isn't as commonly done as I'd thought.