summaryrefslogtreecommitdiff
path: root/packages/base/src/Internal/Static.hs
diff options
context:
space:
mode:
Diffstat (limited to 'packages/base/src/Internal/Static.hs')
-rw-r--r--packages/base/src/Internal/Static.hs16
1 files changed, 8 insertions, 8 deletions
diff --git a/packages/base/src/Internal/Static.hs b/packages/base/src/Internal/Static.hs
index 649fbb5..566506c 100644
--- a/packages/base/src/Internal/Static.hs
+++ b/packages/base/src/Internal/Static.hs
@@ -324,34 +324,34 @@ isDiagg (Dim (Dim x))
324instance KnownNat n => Show (R n) 324instance KnownNat n => Show (R n)
325 where 325 where
326 show s@(R (Dim v)) 326 show s@(R (Dim v))
327 | singleV v = "("++show (v!0)++" :: R "++show d++")" 327 | singleV v = "(" ++ show (v!0) ++ " :: R " ++ show d ++ ")"
328 | otherwise = "(vector"++ drop 8 (show v)++" :: R "++show d++")" 328 | otherwise = "(vector " ++ show v ++ " :: R " ++ show d ++")"
329 where 329 where
330 d = size s 330 d = size s
331 331
332instance KnownNat n => Show (C n) 332instance KnownNat n => Show (C n)
333 where 333 where
334 show s@(C (Dim v)) 334 show s@(C (Dim v))
335 | singleV v = "("++show (v!0)++" :: C "++show d++")" 335 | singleV v = "(" ++ show (v!0) ++ " :: C " ++ show d ++ ")"
336 | otherwise = "(vector"++ drop 8 (show v)++" :: C "++show d++")" 336 | otherwise = "(vector " ++ show v ++ " :: C " ++ show d ++")"
337 where 337 where
338 d = size s 338 d = size s
339 339
340instance (KnownNat m, KnownNat n) => Show (L m n) 340instance (KnownNat m, KnownNat n) => Show (L m n)
341 where 341 where
342 show (isDiag -> Just (z,y,(m',n'))) = printf "(diag %s %s :: L %d %d)" (show z) (drop 9 $ show y) m' n' 342 show (isDiag -> Just (z,y,(m',n'))) = printf "(diag %s %s :: L %d %d)" (show z) (show y) m' n'
343 show s@(L (Dim (Dim x))) 343 show s@(L (Dim (Dim x)))
344 | singleM x = printf "(%s :: L %d %d)" (show (x `atIndex` (0,0))) m' n' 344 | singleM x = printf "(%s :: L %d %d)" (show (x `atIndex` (0,0))) m' n'
345 | otherwise = "(matrix"++ dropWhile (/='\n') (show x)++" :: L "++show m'++" "++show n'++")" 345 | otherwise = "(matrix" ++ dropWhile (/='\n') (show x) ++ " :: L " ++ show m' ++ " " ++ show n' ++ ")"
346 where 346 where
347 (m',n') = size s 347 (m',n') = size s
348 348
349instance (KnownNat m, KnownNat n) => Show (M m n) 349instance (KnownNat m, KnownNat n) => Show (M m n)
350 where 350 where
351 show (isDiagC -> Just (z,y,(m',n'))) = printf "(diag %s %s :: M %d %d)" (show z) (drop 9 $ show y) m' n' 351 show (isDiagC -> Just (z,y,(m',n'))) = printf "(diag %s %s :: M %d %d)" (show z) (show y) m' n'
352 show s@(M (Dim (Dim x))) 352 show s@(M (Dim (Dim x)))
353 | singleM x = printf "(%s :: M %d %d)" (show (x `atIndex` (0,0))) m' n' 353 | singleM x = printf "(%s :: M %d %d)" (show (x `atIndex` (0,0))) m' n'
354 | otherwise = "(matrix"++ dropWhile (/='\n') (show x)++" :: M "++show m'++" "++show n'++")" 354 | otherwise = "(matrix" ++ dropWhile (/='\n') (show x) ++ " :: M " ++ show m' ++ " " ++ show n' ++ ")"
355 where 355 where
356 (m',n') = size s 356 (m',n') = size s
357 357