@@ -40,6 +40,8 @@ import Data.Kind
4040import GHC.Generics
4141import GHC.TypeLits
4242
43+import Data.Type.Bool (type (&&), If, Not)
44+
4345-- $example
4446-- @
4547-- module Example where
@@ -154,24 +156,7 @@ type family Size f :: Nat where
154156
155157--------------------------------------------------------------------------------
156158
157−type family Not (b :: Bool) where
158− Not 'True = 'False
159− Not 'False = 'True
160−
161−type family (<?) (x :: Nat) (y :: Nat) :: Bool where
162− x <? y = Not (y <=? x)
163−
159+type x <? y = Not (y <=? x)
164160infixl 4 <?
165161
166−type family If (c :: Bool) (x :: k) (y :: k) :: k where
167− If 'True x _ = x
168− If 'False _ y = y
169−
170−type family Min (a :: Nat) (b :: Nat) :: Nat where
171− Min a b = If (a <? b) a b
172−
173−type family (a :: Bool) && (b :: Bool) :: Bool where
174− 'True && 'True = 'True
175− _ && _ = 'False
176−
177−infix 3 &&
162+type Min a b = If (a <? b) a b