Skip to content

Commit f5e8e28

Browse files
committed
Chnage value of zero in monoidic float; make monoidicType struct
1 parent 113ffcc commit f5e8e28

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/GraphBLAS-sharp/AlgebraicStructures.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type ISemiring<'a> =
3838
// => можно сделать специальный статик коснтруктор для инстансов
3939
// (если так делать, то уже не получится оставить его генерик типом)
4040
// (можно в конструктор передавать проверку на ноль первым параметром, тогда норм)
41+
[<Struct>]
4142
type MonoidicType<'a> =
4243
| Just of 'a
4344
| Zero

src/GraphBLAS-sharp/Predefined/Monoids/Add.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module Add =
4747

4848
let monoidicFloat =
4949
{ new IMonoid<MonoidicType<float>> with
50-
member this.Zero = Just 0.
50+
member this.Zero = Zero
5151
member this.Plus =
5252
<@
5353
fun x y ->

0 commit comments

Comments
 (0)