boundedvariation / Freecell

Haskell freecell library
MIT License
4 stars 3 forks source link

Canonicalised format, made readable, used more standart functions. #1

Closed Heimdell closed 10 years ago

Heimdell commented 10 years ago

The theme itself looks interesting to me. I had some sketches about how it can work in the past.

I re-formatted the code as it is recommended and as I do (so I was able to read and understand).

I also remade all equation-style functions into a case ... of ones for simplifying future refactoring.

I made applyAt traverse the list once.

Other small changes: intercalate "\n" == unlines, the loadBoardFromText inner loadBoard became a foldl, some expressions turned into zip as bs 'for' \(a, b) -> c where for = flip map.

I didn't touch main domain algorithms, it hard to reason what is/should be done there.

The code looked as you used the tab button. Tab is a no-no, please, don't use it.