3 ms·
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 h
by crimsonalucard 9y ago
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.
- hellofunk 9y agoI 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.
- gilmi 9y ago> 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/Data-Tree.html 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/src/Data/List/Zipper.purs https://github.com/soupi/purescript-list-zipper/blob/master/...
- enalicho 9y agoTrees 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/listzipper/latest http://package.elm-lang.org/packages/wernerdegroot/listzippe...
- deleted 9y ago[deleted]