If you can't change a variable's value in Haskell, how do you create data structures?

前端 未结 3 758
醉话见心
醉话见心 2021-02-02 17:58

As per the title.

I have the following code which creates a binary search tree, but if I want it created and changed dynamically with user input, how would I do that if

3条回答
  •  难免孤独
    2021-02-02 18:24

    Dario gave a good direct answer. If you want more in-depth information, there's Purely Functional Data Structures by Chris Okasaki, an entire book on the subject. I bought it myself, but sadly, I don't have the time to experiment with the ideas.

提交回复
热议问题