@@ -0,0 +1,33 @@
1+||| Ported from Haskell:
2+||| https://hackage.haskell.org/package/base-4.9.0.0/docs/src/Data.Monoid.html
3+module Data.Monoid
4+
5+%access public export
6+%default total
7+
8+-- TODO: These instances exist, but can't be named the same.
9+-- Decide on names for these
10+
11+-- [all] Semigroup Bool where
12+-- a <+> b = a && b
13+--
14+-- [all] Monoid Bool where
15+-- neutral = True
16+--
17+-- [any] Semigroup Bool where
18+-- a <+> b = a || b
19+--
20+-- [any] Monoid Bool where
21+-- neutral = False
22+
23+Semigroup () where
24+ (<+>) _ _ = ()
25+
26+Monoid () where
27+ neutral = ()
28+
29+(Semigroup m, Semigroup n) => Semigroup (m, n) where
30+ (a, b) <+> (c, d) = (a <+> c, b <+> d)
31+
32+(Monoid m, Monoid n) => Monoid (m, n) where
33+ neutral = (neutral, neutral)