File tree 3 files changed +11
-23
lines changed
3 files changed +11
-23
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.
@@ -120,10 +120,16 @@ Global Instance Traversable_list@{} : Traversable list :=
120
120
121
121
Monomorphic Universe listU.
122
122
123
- Global Instance Monad_list@{} : Monad@{listU listU} list :=
124
- { ret := fun _ x => x :: nil
125
- ; bind := fun _ _ x f =>
126
- List.fold_right (fun x acc => f x ++ acc) nil x
123
+ Global Instance Monad_list : Monad list :=
124
+ { ret := fun _ v => v :: nil
125
+ ; bind := fun _ _ l f => flat_map f l
126
+ }.
127
+
128
+ Global Instance MonadZero_list : MonadZero list :=
129
+ { mzero := @nil }.
130
+
131
+ Global Instance MonadPlus_list : MonadPlus list :=
132
+ { mplus _A _B a b := List.map inl a ++ List.map inr b
127
133
}.
128
134
129
135
Section list.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments