File tree 3 files changed +9
-20
lines changed
3 files changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -119,7 +119,6 @@ theories/Data/Monads/FuelMonadLaws.v
119
119
theories/Data/Monads/FuelMonad.v
120
120
theories/Data/Monads/IdentityMonadLaws.v
121
121
theories/Data/Monads/IdentityMonad.v
122
- theories/Data/Monads/ListMonad.v
123
122
theories/Data/Monads/OptionMonadLaws.v
124
123
theories/Data/Monads/OptionMonad.v
125
124
theories/Data/Monads/ReaderMonadLaws.v
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ Global Instance Foldable_list@{u} {T : Type@{u}} : Foldable (list T) T :=
98
98
99
99
Require Import ExtLib.Structures.Traversable.
100
100
Require Import ExtLib.Structures.Functor.
101
- Require Import ExtLib.Structures.Monad .
101
+ Require Import ExtLib.Structures.Monads .
102
102
Require Import ExtLib.Structures.Applicative.
103
103
104
104
Section traversable.
@@ -123,7 +123,14 @@ Monomorphic Universe listU.
123
123
Global Instance Monad_list@{} : Monad@{listU listU} list :=
124
124
{ ret := fun _ x => x :: nil
125
125
; bind := fun _ _ x f =>
126
- List.fold_right (fun x acc => f x ++ acc) nil x
126
+ flat_map f x
127
+ }.
128
+
129
+ Global Instance MonadZero_list : MonadZero list :=
130
+ { mzero := @nil }.
131
+
132
+ Global Instance MonadPlus_list : MonadPlus list :=
133
+ { mplus _A _B a b := List.map inl a ++ List.map inr b
127
134
}.
128
135
129
136
Section list.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments