Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
mtl
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Glasgow Haskell Compiler
Packages
mtl
Commits
dac27e58
Commit
dac27e58
authored
Jun 10, 2018
by
Oskar Wickström
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improvements based on @ocramz feedback
parent
27f2d872
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
16 deletions
+21
-16
README.markdown
README.markdown
+17
-13
mtl.cabal
mtl.cabal
+4
-3
No files found.
README.markdown
View file @
dac27e58
# `mtl` [](https://hackage.haskell.org/package/mtl) [](https://travis-ci.org/haskell/mtl)
MTL is an implementation of monad transformers, using functional
dependencies for generic lifting of monadic actions.
MTL is a collection of monad classes, extending the
`transformers`
package, using functional dependencies for generic lifting of monadic
actions.
## Structure
Transformers in MTL are divided into classes and data types. Classes
define the monadic operations of transformers. Data types
implement
transformers, providing instances for _all_ the transformer type classes
in MTL
.
define the monadic operations of transformers. Data types
, generally
from the
`transformers`
package, implement transformers, and MTL
provides instances for all the transformer type classes
.
The transformers in MTL
use a common module, data type, and function
MTL and
`transformers`
use a common module, data type, and function
naming scheme. As an example, let's imagine we have a transformer
`Foo`
.
...
...
@@ -18,7 +19,9 @@ In the `Control.Monad.Foo` module, we'd find:
*
A type class
`StateFoo`
with the transformer operations.
*
A data type
`FooT`
with instances for all monad transformer classes.
*
Functions to run the transformed computation, e.g.
`runFooT`
.
*
Functions to run the transformed computation, e.g.
`runFooT`
. For
the actual transformers, there are usually a number of useful runner
functions.
### Lifting
...
...
@@ -47,10 +50,10 @@ mightFail = do
### Transformers
The following outlines the available monad
transformers in MTL. For
more details, and the corresponding documentation of the
`mtl`
version
you are using, see
[
the documentation on
Hackage
](
https://hackage.haskell.org/package/mtl
)
.
The following outlines the available monad
classes and transformers in
MTL and
`transformers`
. For more details, and the corresponding
documentation of the
`mtl`
version you are using, see
[
the
documentation on
Hackage
](
https://hackage.haskell.org/package/mtl
)
.
*
`Control.Monad.Cont`
...
...
@@ -105,7 +108,7 @@ Hackage](https://hackage.haskell.org/package/mtl).
*
`Control.Monad.Reader`
The Reader monad transformer represents a computation which can
read values from a
shared
environment.
read values from a
n
environment.
- Class: `Control.Monad.Reader.Class.MonadReader`
- Transformer: `Control.Monad.Reader.ReaderT`
...
...
@@ -127,7 +130,8 @@ Hackage](https://hackage.haskell.org/package/mtl).
The Writer monad transformer represents a computation that can
produce a stream of data in addition to the computed values. This
can be used to collect values in some data structure with a
`Monoid` instance.
`Monoid` instance. This can be used for things like logging and
accumulating values throughout a computation.
- Class: `Control.Monad.Writer.Class.MonadWriter`
- Lazy transformers: `Control.Monad.Writer.Lazy.WriterT`
...
...
mtl.cabal
View file @
dac27e58
...
...
@@ -6,12 +6,13 @@ license-file: LICENSE
author: Andy Gill
maintainer: Edward Kmett <ekmett@gmail.com>
category: Control
synopsis: Monad transformers, using functional dependencies
synopsis: Monad
classes for
transformers, using functional dependencies
homepage: http://github.com/haskell/mtl
bug-reports: http://github.com/haskell/mtl/issues
description:
MTL is an implementation of monad transformers, using functional
dependencies for generic lifting of monadic actions.
MTL is a collection of monad classes, extending the 'transformers'
package, using functional dependencies for generic lifting of
monadic actions.
build-type: Simple
extra-source-files: CHANGELOG.markdown, README.markdown
tested-with:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment