Proposal: Add Semigroup and Monoid instances for (:~:)

These are not likely to be *useful*, but they fall easily into the general bucket of "exactly one sensible instance exists". instance Semigroup (a :~: b) where r <> _ = r instance a ~ b => Monoid (a :~: b) where mempty = Refl mappend r _ = r

What does this smiley :~: stand for? On 13.01.2016 06:58, David Feuer wrote:
These are not likely to be *useful*, but they fall easily into the general bucket of "exactly one sensible instance exists".
instance Semigroup (a :~: b) where r <> _ = r
instance a ~ b => Monoid (a :~: b) where mempty = Refl mappend r _ = r _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel@gu.se http://www2.tcs.ifi.lmu.de/~abel/

Refl, I believe.
On Thu, Jan 14, 2016 at 1:56 PM Andreas Abel
What does this smiley :~: stand for?
On 13.01.2016 06:58, David Feuer wrote:
These are not likely to be *useful*, but they fall easily into the general bucket of "exactly one sensible instance exists".
instance Semigroup (a :~: b) where r <> _ = r
instance a ~ b => Monoid (a :~: b) where mempty = Refl mappend r _ = r _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Andreas Abel <>< Du bist der geliebte Mensch.
Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden
andreas.abel@gu.se http://www2.tcs.ifi.lmu.de/~abel/ _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries

(:~:) is from Data.Type.Equality.
data a :~: b where
Refl :: a :~: a
On Jan 14, 2016 8:56 AM, "Andreas Abel"
What does this smiley :~: stand for?
On 13.01.2016 06:58, David Feuer wrote:
These are not likely to be *useful*, but they fall easily into the general bucket of "exactly one sensible instance exists".
instance Semigroup (a :~: b) where r <> _ = r
instance a ~ b => Monoid (a :~: b) where mempty = Refl mappend r _ = r _______________________________________________ Libraries mailing list Libraries@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
-- Andreas Abel <>< Du bist der geliebte Mensch.
Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden
andreas.abel@gu.se http://www2.tcs.ifi.lmu.de/~abel/
participants (3)
-
Andreas Abel
-
David Feuer
-
Oliver Charles