File tree Expand file tree Collapse file tree 3 files changed +9
-20
lines changed
Expand file tree Collapse file tree 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
119119theories/Data/Monads/FuelMonad.v
120120theories/Data/Monads/IdentityMonadLaws.v
121121theories/Data/Monads/IdentityMonad.v
122- theories/Data/Monads/ListMonad.v
123122theories/Data/Monads/OptionMonadLaws.v
124123theories/Data/Monads/OptionMonad.v
125124theories/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 :=
9898
9999Require Import ExtLib.Structures.Traversable.
100100Require Import ExtLib.Structures.Functor.
101- Require Import ExtLib.Structures.Monad .
101+ Require Import ExtLib.Structures.Monads .
102102Require Import ExtLib.Structures.Applicative.
103103
104104Section traversable.
@@ -123,7 +123,14 @@ Monomorphic Universe listU.
123123Global Instance Monad_list@{} : Monad@{listU listU} list :=
124124{ ret := fun _ x => x :: nil
125125; 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
127134}.
128135
129136Section list.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments