{"id":15874422,"url":"https://github.com/bookshelfdave/monad-transformers-step-by-step","last_synced_at":"2025-03-16T05:31:02.436Z","repository":{"id":66708535,"uuid":"261801764","full_name":"bookshelfdave/monad-transformers-step-by-step","owner":"bookshelfdave","description":"(unofficial) source for Monad Transformers Step by Step by Martin Grabmüller","archived":false,"fork":false,"pushed_at":"2024-08-09T06:03:16.000Z","size":19,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T05:11:40.899Z","etag":null,"topics":["haskell","haskell-exercises","haskell-learning","monad-transformers","monads"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bookshelfdave.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-05-06T15:29:26.000Z","updated_at":"2024-11-17T02:51:31.000Z","dependencies_parsed_at":"2024-10-27T08:42:34.876Z","dependency_job_id":"06a7d718-e94c-4594-a18f-ab41f175a63a","html_url":"https://github.com/bookshelfdave/monad-transformers-step-by-step","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookshelfdave%2Fmonad-transformers-step-by-step","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookshelfdave%2Fmonad-transformers-step-by-step/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookshelfdave%2Fmonad-transformers-step-by-step/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bookshelfdave%2Fmonad-transformers-step-by-step/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bookshelfdave","download_url":"https://codeload.github.com/bookshelfdave/monad-transformers-step-by-step/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243806122,"owners_count":20350773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","haskell-exercises","haskell-learning","monad-transformers","monads"],"created_at":"2024-10-06T01:40:16.210Z","updated_at":"2025-03-16T05:31:02.425Z","avatar_url":"https://github.com/bookshelfdave.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monad Transformers Step by Step\n\nHaskell source for the paper \n[Monad Transformers Step by Step](https://page.mi.fu-berlin.de/scravy/realworldhaskell/materialien/monad-transformers-step-by-step.pdf) by Martin Grabmüller, tweaked to work in 2020 and built using [Stack](https://docs.haskellstack.org/en/stable/README/).\n\n\n## How this repo is organized\n\n- Shared data structureds can be found in [Lib.hs](https://github.com/metadave/monad-transformers-step-by-step/blob/master/src/Lib.hs) \n- Each of the `eval0` .. `eval6` implementations can be found in [./src](https://github.com/metadave/monad-transformers-step-by-step/tree/master/src) under a similarly named file.  \n- Examples of each `eval*` function running can be found in the [test](https://github.com/metadave/monad-transformers-step-by-step/blob/master/test/HUnitTests.hs) file.\n\n\n## Changes\n\nI've made the following changes to the example source in order for it to compile with the \"latest\" Haskell tools (as of May 2020). \n\n- In [Lib.hs](https://github.com/metadave/monad-transformers-step-by-step/blob/master/src/Lib.hs), `Eq` was added \nto the `deriving` block of `Exp` and `Value`.\n\n- As [`fail` was removed from Monad](https://downloads.haskell.org/%7Eghc/8.8.1/docs/html/users_guide/8.8.1-notes.html#base-library), I've replaced calls to `fail` with `error`. \n\n- I added a `MonadFail` instance for `Identity` in [Lib.hs](https://github.com/metadave/monad-transformers-step-by-step/blob/master/src/Lib.hs)\n  - more info can be found here https://wiki.haskell.org/MonadFail_Proposal, see the `Adapting old code` section\n\n\nWithout the `MonadFail` instance above, you'll get compilation errors like this:\n\n```\n   • No instance for (MonadFail Identity)\n        arising from a do statement\n        with the failable pattern ‘IntVal i2’\n    • In a stmt of a 'do' block: IntVal i2 \u003c- eval2c env e2\n      In the expression:\n        do IntVal i1 \u003c- eval2c env e1\n           IntVal i2 \u003c- eval2c env e2\n           return $ IntVal (i1 + i2)\n      In an equation for ‘eval2c’:\n          eval2c env (Plus e1 e2)\n            = do IntVal i1 \u003c- eval2c env e1\n                 IntVal i2 \u003c- eval2c env e2\n                 return $ IntVal (i1 + i2)\n   |\n52 |                                  IntVal i2  \u003c- eval2c env e2\n   |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n```\n\n- `Control.Monad.Except` is used in place of `import Control.Monad.Error`, as `Control.Monad.Error` has been [deprecated](https://hackage.haskell.org/package/mtl-2.2.2/docs/Control-Monad-Error.html).\n  - as the result of this, you'll see `ErrorT` replaced by `ExceptT` in most of the examples.\n\n# Building\n\n```bash\ngit clone https://github.com/metadave/monad-transformers-step-by-step.git\ncd monad-transformers-step-by-step\nstack test\n # - or-\nstack ghci\n```\n\n## Interactive Examples\n\n```bash\nstack ghci\n\nimport qualified Data.Map as Map\neval0 Map.empty exampleExp\n-- will display:\nIntVal 18\n\n```\n# TODO\n\n- Figure out how to test the eval2* functions\n\n# Similar repos\n\nThe following repos contain similar implementations, although they don't seem to work in 2020:\n\n- https://github.com/NickAger/monad-transformers-step-by-step\n- https://github.com/danbroooks/monad-transformers-step-by-step\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbookshelfdave%2Fmonad-transformers-step-by-step","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbookshelfdave%2Fmonad-transformers-step-by-step","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbookshelfdave%2Fmonad-transformers-step-by-step/lists"}