Conversation:
Notices
-
I've just done (part of) Advent of Code 2018 q9 in #Haskell. My first attempt, I thought was elegant and readable, but consumed all RAM in the universe. My second attempt, was more nuanced, throwing away all the things the solution did not rea…
-
This is a nice explanation of the State Monad https://wiki.haskell.org/State_Monad #Haskell I've basically cut and paste the example more than once before to solve problems.
-
Ok, I made some changes, and it does the first part in a 0.1s now, and the second part in 7s. However the code looks very much like an imperative language now. There is a loop over a list inside which we do things, and use the State Monad to c…
-
I suppose I should be pleased. A execution time from 11min -> 0.1 sec
This functional programming malarky seems a bit dangerous. Making everything stateless and recursive seems nice, but picking the correct data structures and choices makes a huge difference.