### nagibator's blog

By nagibator, 5 years ago,

I like Haskell and sometimes solve tasks using this language, but somehow I managed to choose tasks which do not require usage of ST monad. Today I tried to solve 686D - Kay and Snowflake and I needed an ST monad to turn list of parent nodes of the tree to adjacency list. Of course, everything worked fine on my computer, but when I tried to submit, CF said that I had CE:

Can't compile file:

program.hs:2:1:
The module itself isn't safe.

program.hs:3:1:
Data.Array.ST: Can't be safely imported!
The module itself isn't safe.


Here is the submission: 18723133
What do I have to do to fix it? How do I use ST or something similar? Why isn't ST safe?