mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-17 16:21:46 +03:00
24 lines
447 B
Idris
24 lines
447 B
Idris
module Data.Num.Implementations
|
|
|
|
%default total
|
|
|
|
namespace Semigroup
|
|
|
|
public export
|
|
[Additive] Num a => Semigroup a
|
|
where (<+>) = (+)
|
|
public export
|
|
[Multiplicative] Num a => Semigroup a
|
|
where (<+>) = (*)
|
|
|
|
namespace Monoid
|
|
|
|
public export
|
|
[Additive] Num a => Monoid a
|
|
using Semigroup.Additive
|
|
where neutral = 0
|
|
public export
|
|
[Multiplicative] Num a => Monoid a
|
|
using Semigroup.Multiplicative
|
|
where neutral = 1
|