summaryrefslogtreecommitdiffstats
path: root/site/posts/MonadTransformers.org
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-02-21 23:25:14 +0100
committerThomas Letan <lthms@soap.coffee>2020-02-21 23:25:14 +0100
commite792118e1e8e5213dff01f80240a98c14a55344f (patch)
tree4b257088f829376c1c079655eb59d4ad31aa814d /site/posts/MonadTransformers.org
parentb3a30963af918d1d4edf03ac67ba44089c1a5417 (diff)
Various improvement in cleopatra
- Fix the dependencies in the Makefile - Use a minimal emacs configuration with themes - Dark theme again
Diffstat (limited to 'site/posts/MonadTransformers.org')
-rw-r--r--site/posts/MonadTransformers.org5
1 files changed, 3 insertions, 2 deletions
diff --git a/site/posts/MonadTransformers.org b/site/posts/MonadTransformers.org
index 7947ef4..4c28fe5 100644
--- a/site/posts/MonadTransformers.org
+++ b/site/posts/MonadTransformers.org
@@ -43,9 +43,10 @@ Monad. It carries an environment in a transparent way. The only thing is, I was
already using the State Monad to carry the computation result. But that’s not an
issue with the Monad Transformers.
-#+BEGIN_SRC patch
+#+BEGIN_SRC diff
-type Builder = StateT Text IO
+type Builder = StateT Text (ReaderT Language IO)
+
#+END_SRC
As you may have already understood, I wasn't using the “raw” ~State~ Monad, but
@@ -56,7 +57,7 @@ function call easily” problem.
Retrieving the chosen language is as simple as:
-#+BEGIN_SRC patch
+#+BEGIN_SRC haskell
getLanguage :: Builder Language
getLanguage = lift ask
#+END_SRC