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
a6033bfa
Commit
a6033bfa
authored
2 months ago
by
Maxime Jacquemin
Browse files
Options
Downloads
Patches
Plain Diff
[Kernel] Typos
Credit to Basile Desloges
parent
85b248f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libraries/monads/monad.mli
+8
-5
8 additions, 5 deletions
src/libraries/monads/monad.mli
with
8 additions
and
5 deletions
src/libraries/monads/monad.mli
+
8
−
5
View file @
a6033bfa
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
operator while [>>-:] and [let+] always correspond to the [map].
operator while [>>-:] and [let+] always correspond to the [map].
All those operators are provided in an [Operators] module to avoid
All those operators are provided in an [Operators] module to avoid
spacename conflicts. Indeed, one can use the expression
spacename conflicts. Indeed, one can use the expression
[let open Monad.Operators in] to use all the let-bindings without
[let open
My
Monad.Operators in] to use all the let-bindings without
risking conflicts by including the other definitions, which have
risking conflicts by including the other definitions, which have
rather common names. This idiom also helps indicate which monad is
rather common names. This idiom also helps indicate which monad is
currently used in a code. *)
currently used in a code. *)
...
@@ -104,7 +104,7 @@ end
...
@@ -104,7 +104,7 @@ end
that would like to build their own monads. Each monad can be build
that would like to build their own monads. Each monad can be build
by directly implementing all required operators in the previous
by directly implementing all required operators in the previous
signatures. However, this is a tedious and error prone work, in
signatures. However, this is a tedious and error prone work, in
particular for the let-bin
g
ing operators which are just syntactic
particular for the let-bin
d
ing operators which are just syntactic
sugars for other operators.
sugars for other operators.
To simplify this, two minimal definitions and the corresponding
To simplify this, two minimal definitions and the corresponding
...
@@ -116,7 +116,10 @@ end
...
@@ -116,7 +116,10 @@ end
In depth explanations on those minimal definitions and the properties
In depth explanations on those minimal definitions and the properties
they should respect are given. A huge effort has been made to make
they should respect are given. A huge effort has been made to make
those explanations as simple as possible even if deep down, monads
those explanations as simple as possible even if deep down, monads
take roots in the category theory, a notoriously difficult topic. *)
take roots in the category theory, a notoriously difficult topic.
For an example of monad implementation based on this module, see
{!Option}. *)
(** {3 Minimal signature based on bind}
(** {3 Minimal signature based on bind}
...
@@ -142,7 +145,7 @@ end
...
@@ -142,7 +145,7 @@ end
[bind (fun x -> bind g (f x)) m ≣ bind g (bind f m)]
[bind (fun x -> bind g (f x)) m ≣ bind g (bind f m)]
As there is no way in the OCaml type system to enforce those properties,
As there is no way in the OCaml type system to enforce those properties,
users have to trust the implemented monad when using it, and develop
p
ers
users have to trust the implemented monad when using it, and developers
have to manually check that they are respected. *)
have to manually check that they are respected. *)
module
type
Based_on_bind
=
sig
module
type
Based_on_bind
=
sig
type
'
a
t
type
'
a
t
...
@@ -228,7 +231,7 @@ end
...
@@ -228,7 +231,7 @@ end
4. ∀m:('a t t), ∀f: ('a -> 'b), [flatten (map (map f) m) ≣ map f (flatten m)]
4. ∀m:('a t t), ∀f: ('a -> 'b), [flatten (map (map f) m) ≣ map f (flatten m)]
As there is no way in the OCaml type system to enforce those properties,
As there is no way in the OCaml type system to enforce those properties,
users have to trust the implemented monad when using it, and develop
p
ers
users have to trust the implemented monad when using it, and developers
have to manually check that they are respected. *)
have to manually check that they are respected. *)
module
type
Based_on_map
=
sig
module
type
Based_on_map
=
sig
type
'
a
t
type
'
a
t
...
...
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