12. Monoid a(1)
prod (id, mappend’)
(a, a), a
((x, y), z) -> (x, (y, z))
a, (a, a) (a, a)
prod (mappend’, id) mappend’
mappend’
(a, a) prod (f, g) (x, y) = (f x, g y) a
mappend’ = uncurry mappend
13. Monoid a(1)
(x <> y) <> z = x <> (y <> z)
prod (id, mappend’)
(a, a), a
((x, y), z) -> (x, (y, z))
a, (a, a) (a, a)
prod (mappend’, id) mappend’
mappend’
(a, a) prod (f, g) (x, y) = (f x, g y) a
mappend’ = uncurry mappend
14. Monoid a(2)
prod (mempty’, id) prod (id, mempty’)
((), a) (a, a) (a, ())
mappend’
snd fst
a
mempty’ = const mempty
15. Monoid a(2)
mempty <> x = x
x <> mempty = x
prod (mempty’, id) prod (id, mempty’)
((), a) (a, a) (a, ())
mappend’
snd fst
a
mempty’ = const mempty
16. Monoid a(2)
mempty <> x = x
x <> mempty = x
prod (mempty’, id) prod (id, mempty’)
((), a) (a, a) (a, ())
mappend’
snd fst
a
”集合”
mempty’ = const mempty