@@ -141,10 +141,11 @@ deriving instance (Show e) => Show (Matrix e cols rows)
141141type family Count (d :: Type) where
142142 Count Void = 0
143143 Count () = 1
144+ Count Bool = 2
145+ Count (Natural n) = n
144146 Count (Either a b) = (+) (Count a) (Count b)
145147 Count (a, b) = (*) (Count a) (Count b)
146148 Count (a -> b) = (^) (Count b) (Count a)
147− Count (Natural n) = n
148149
149150-- | Type family that computes of a given type dimension from a fiven natural
150151type family FromNat (n :: Nat) where
@@ -583,12 +584,12 @@ prettyAux [[e]] m = "│ " ++ fill (show e) ++ " │\n"
583584 v = fmap show m
584585 widest = maximum $ fmap length v
585586 fill str = replicate (widest - length str - 2) ' ' ++ str
586−prettyAux [h] m = "│ " ++ fill (head $ map show h) ++ " │\n"
587+prettyAux [h] m = "│ " ++ fill (unwords $ map show h) ++ " │\n"
587588 where
588589 v = fmap show m
589590 widest = maximum $ fmap length v
590591 fill str = replicate (widest - length str - 2) ' ' ++ str
591−prettyAux (h : t) l = "│ " ++ fill (head $ map show h) ++ " │\n" ++
592+prettyAux (h : t) l = "│ " ++ fill (unwords $ map show h) ++ " │\n" ++
592593 prettyAux t l
593594 where
594595 v = fmap show l
@@ -596,9 +597,9 @@ prettyAux (h : t) l = "│ " ++ fill (head $ map show h) ++ " │\n" ++
596597 fill str = replicate (widest - length str - 2) ' ' ++ str
597598
598599pretty :: (KnownNat (Count cols), Show e) => Matrix e cols rows -> String
599−pretty m = "┌ " ++ blank ++ " ┐\n" ++
600+pretty m = "┌ " ++ unwords (replicate (columns m) blank) ++ " ┐\n" ++
600601 prettyAux (toLists m) (toLists m) ++
601− "└ " ++ blank ++ " ┘"
602+ "└ " ++ unwords (replicate (columns m) blank) ++ " ┘"
602603 where
603604 v = fmap show (toList m)
604605 widest = maximum $ fmap length v