1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
module Core (Req : Preface_specs.Semigroup.WITH_COMBINE) = Req
module Operation (Core : Preface_specs.Semigroup.CORE) = struct
type t = Core.t
let times_nel n x = Preface_core.Monoid.times_nel Core.combine n x
let reduce_nel list = Preface_core.Monoid.reduce_nel Core.combine list
end
module Infix (Core : Preface_specs.Semigroup.CORE) = struct
type t = Core.t
let ( <|> ) = Core.combine
end
module Via
(Core : Preface_specs.Semigroup.CORE)
(Operation : Preface_specs.Semigroup.OPERATION)
(Infix : Preface_specs.Semigroup.INFIX) =
struct
include Core
include Operation
module Infix = Infix
include Infix
end
module Via_combine (Req : Preface_specs.Semigroup.WITH_COMBINE) = struct
module Core = Core (Req)
include Core
module Operation = Operation (Core)
module Infix = Infix (Core)
include Operation
include Infix
end
module From_alt
(Alt : Preface_specs.Alt.WITH_COMBINE)
(T : Preface_specs.Types.T0) =
Via_combine (struct
type t = T.t Alt.t
let combine = Alt.combine
end)
module From_alternative = From_alt
module From_monad_plus = From_alt