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
2482c5e7
Commit
2482c5e7
authored
2 months ago
by
Thibault Martin
Committed by
Maxime Jacquemin
2 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[doc] Fix odoc bullets
parent
2f673a64
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libraries/monads/monad.mli
+6
-0
6 additions, 0 deletions
src/libraries/monads/monad.mli
src/libraries/monads/result.mli
+5
-2
5 additions, 2 deletions
src/libraries/monads/result.mli
with
11 additions
and
2 deletions
src/libraries/monads/monad.mli
+
6
−
0
View file @
2482c5e7
...
...
@@ -20,6 +20,8 @@
(* *)
(**************************************************************************)
(** This module provides a generic monad interface based on Keisli and Categoric
defintion of monads. *)
(** {2 Kleisli triple signature for a monadic type constructor ['a t]}
...
...
@@ -115,7 +117,9 @@ end
nested applications of the monad. It must also satisfy some laws :
2. ∀m:('a t t t), [map flatten (flatten m) ≣ flatten (flatten m)]
3. ∀m:('a t), [flatten (map return m) ≣ flatten (return m) ≣ 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,
...
...
@@ -162,7 +166,9 @@ end
using the operations required by the others. Indeed :
1. ∀m:('a t), ∀f:('a -> 'b), [map f m ≣ bind (fun x -> return (f x)) m]
2. ∀m:('a t t), [flatten m ≣ bind identity m]
3. ∀m:('a t), ∀f:('a -> 'b t), [bind f m ≣ flatten (map f m)]
All required laws expressed in both minimal signatures are respected
...
...
This diff is collapsed.
Click to expand it.
src/libraries/monads/result.mli
+
5
−
2
View file @
2482c5e7
...
...
@@ -20,8 +20,11 @@
(* *)
(**************************************************************************)
(* Adding let binding operators to the Result module. See
https://v2.ocaml.org/manual/bindingops.html for more information. *)
(** Adding let binding operators to the Result module.
@see <https://v2.ocaml.org/manual/bindingops.html>
This module does not use the generic monad interface (cf. {!Monad}) because
of the error type, which would require another layer of functors.
*)
include
module
type
of
Stdlib
.
Result
...
...
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