Refactor game state computation

Cleaning up the Tetris module, mainly to favor a MonadState style over
explicit `Game -> Game` functions, which were a little awkward. This also
led naturally to explicitly isolating `IO`, by having pure state modifiers
with types like `Tetris a ~ forall m. StateT Game m a` being executed
with `m ~ Identity`, and those few modifiers that need IO specified by
`TetrisT a ~ StateT Game IO a`.
This commit is contained in:
Sam Tay 2018-12-27 10:28:26 -05:00
parent 09de01695c
commit ad1fcf9192
6 changed files with 179 additions and 157 deletions

View file

@ -19,17 +19,17 @@ library
build-depends: base >= 4.7 && < 5
, brick
, containers
, microlens
, microlens-th
, lens
, linear
, random
, transformers
, vty
default-language: Haskell2010
executable tetris
hs-source-dirs: app
main-is: Main.hs
ghc-options: -threaded -rtsopts -with-rtsopts=-N
ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
build-depends: base >= 4.7 && < 5
, directory
, filepath