@@ -21,6 +21,7 @@ module Prelude
2121 , BoolLike, (&&), (||)
2222 , not
2323 , Semigroup, (<>), (++)
24+ , Unit(..)
2425 ) where
2526
2627 flip :: forall a b c. (a -> b -> c) -> b -> a -> c
@@ -207,6 +208,8 @@ module Prelude
207208 (%) = numMod
208209 negate = numNegate
209210
211+ data Unit = Unit {}
212+
210213 infix 4 ==
211214 infix 4 /=
212215
@@ -228,6 +231,10 @@ module Prelude
228231 \ };\
229232 \}" :: forall a. a -> a -> Boolean
230233
234+ instance eqUnit :: Eq Unit where
235+ (==) (Unit {}) (Unit {}) = true
236+ (/=) (Unit {}) (Unit {}) = false
237+
231238 instance eqString :: Eq String where
232239 (==) = refEq
233240 (/=) = refIneq
@@ -297,6 +304,9 @@ module Prelude
297304 \ return n1 < n2 ? LT : n1 > n2 ? GT : EQ;\
298305 \ };\
299306 \}" :: forall a. a -> a -> Ordering
307+
308+ instance ordUnit :: Ord Unit where
309+ compare (Unit {}) (Unit {}) = EQ
300310
301311 instance ordBoolean :: Ord Boolean where
302312 compare false false = EQ
@@ -421,6 +431,9 @@ module Prelude
421431 \ };\
422432 \}" :: String -> String -> String
423433
434+ instance semigroupUnit :: Semigroup Unit where
435+ (<>) (Unit {}) (Unit {}) = Unit {}
436+
424437 instance semigroupString :: Semigroup String where
425438 (<>) = concatString
426439