Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
98642975
Commit
98642975
authored
3 months ago
by
Maxime Jacquemin
Browse files
Options
Downloads
Patches
Plain Diff
[Kernel] Typos
Credit to Virgile Prevosto
parent
a6033bfa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libraries/monads/monad.mli
+6
-6
6 additions, 6 deletions
src/libraries/monads/monad.mli
with
6 additions
and
6 deletions
src/libraries/monads/monad.mli
+
6
−
6
View file @
98642975
...
...
@@ -32,7 +32,7 @@
This signature provides all the usual monadic operators along with
let-bindings definitions used to simplify codes relying on monads.
The provide
s
operators are as follows:
The provide
d
operators are as follows:
- [return] embeds a value [x] in the monad.
- [bind] encodes the idea of "sequence" in the monadic world, i.e the
call [bind f m] comes down to performing the computation [m] before
...
...
@@ -45,11 +45,11 @@
The provided let-bindings operators can be used to write simpler and
cleaner code. For example, one can write [let+ v = compute x in v + 1]
instead of [map (fun v -> v + 1) (compute x)]. The more monadic steps,
the
more
simpler the code will get when written using those operators.
the simpler the code will get when written using those operators.
In this module, [>>-] and [let*] always correspond to the [bind]
operator while [>>-:] and [let+] always correspond to the [map].
All those operators are provided in an [Operators] module to avoid
spac
enam
e conflicts. Indeed, one can use the expression
name
space conflicts. Indeed, one can use the expression
[let open MyMonad.Operators in] to use all the let-bindings without
risking conflicts by including the other definitions, which have
rather common names. This idiom also helps indicate which monad is
...
...
@@ -74,11 +74,11 @@ end
In a computational point of view, a monad is an abstraction of a sequence
of operations. But sometimes, one may need to specify that two operations
can be perform in *any* order, for instance when dealing with concurrency
can be perform
ed
in *any* order, for instance when dealing with concurrency
or generic errors handling using the [option] type. To do so, one needs
a *product* on monadic values, i.e a way to combine two monads into a new
one. Thus a second signature is provided, including a product operator
and t
wo the
let-bindings [and*] and [and+]. *)
and t
he two
let-bindings [and*] and [and+]. *)
module
type
S_with_product
=
sig
type
'
a
t
val
return
:
'
a
->
'
a
t
...
...
@@ -101,7 +101,7 @@ end
(** {2 Building monads from minimal signatures}
From now on, all provided definitions are designed for advanced users
that would like to build their own monads. Each monad can be buil
d
that would like to build their own monads. Each monad can be buil
t
by directly implementing all required operators in the previous
signatures. However, this is a tedious and error prone work, in
particular for the let-binding operators which are just syntactic
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment