How does one store data in Haskell (explained below)?
I'm new to Haskell and just realized that lists are immutable. In fact, apparently immutability is a core part of the language. However, how does one store data in Haskell? What I was thinking of doing was creating a list of values (like in a checkers program - you have a list of checkers coordinates, with each item in the list being a checker). The issue is that you can lose checkers pieces of course! So how is it possible to do this with immutable lists if I have to write a new list every time a piece is taken? I've seen some very complicated examples online that seem to involve importing exotic packages, but the solution to this problem must be much simpler. Can anyone point me in the right direction to at least being able to store a simple immutable dataset?
Posted Feb 17, 2017, 3:01 AM UTC