Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Glasgow Haskell Compiler
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shayne Fletcher
Glasgow Haskell Compiler
Commits
d9236c26
Commit
d9236c26
authored
Aug 29, 2007
by
simonpj@microsoft.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Further documentation about mdo, suggested by Benjamin Franksen
parent
a8312580
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
docs/users_guide/glasgow_exts.xml
docs/users_guide/glasgow_exts.xml
+16
-2
No files found.
docs/users_guide/glasgow_exts.xml
View file @
d9236c26
...
...
@@ -769,7 +769,7 @@ Furthermore, the Control.Monad.ST and Control.Monad.ST.Lazy modules provide the
for Haskell's internal state monad (strict and lazy, respectively).
</para>
<para>
There are thre
e important points in using the recursive-do notation:
Here are som
e important points in using the recursive-do notation:
<itemizedlist>
<listitem><para>
The recursive version of the do-notation uses the keyword
<literal>
mdo
</literal>
(rather
...
...
@@ -777,7 +777,21 @@ than <literal>do</literal>).
</para></listitem>
<listitem><para>
As with other extensions, ghc should be given the flag
<literal>
-fglasgow-exts
</literal>
It is enabled with the flag
<literal>
-XRecursiveDo
</literal>
, which is in turn implied by
<literal>
-fglasgow-exts
</literal>
.
</para></listitem>
<listitem><para>
Unlike ordinary do-notation, but like
<literal>
let
</literal>
and
<literal>
where
</literal>
bindings,
name shadowing is not allowed; that is, all the names bound in a single
<literal>
mdo
</literal>
must
be distinct (Section 3.3 of the paper).
</para></listitem>
<listitem><para>
Variables bound by a
<literal>
let
</literal>
statement in an
<literal>
mdo
</literal>
are monomorphic in the
<literal>
mdo
</literal>
(Section 3.1 of the paper). However
GHC breaks the
<literal>
mdo
</literal>
into segments to enhance polymorphism,
and improve termination (Section 3.2 of the paper).
</para></listitem>
</itemizedlist>
</para>
...
...
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