You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 18, 2023. It is now read-only.
This is probably an issue with your terminal/stdout not being set up to support unicode characters. This is more an issue of the environment; although I think that using unicode characters in the show instance instead of the more compatible ascii alternative should be avoided.
import qualified Data.Map as M
prettyMatrixASCII = putStrLn . f . prettyMatrix
where
f xs = map (\x -> case M.lookup x conv of
Nothing -> x
Just y -> y) xs
where
conv = M.fromList [('\9488','\\'),('\9474','|'),('\9484','/'),('\9492','\\'),('\9496','/')]
It is not possible to correctly display an array in WinGHCi.
prettyMatrix $ matrix 4 4 $ \(i,j) -> 2*i - j
"\9484 \9488\n\9474 1 0 -1 -2 \9474\n\9474 3 2 1 0 \9474\n\9474 5 4 3 2 \9474\n\9474 7 6 5 4 \9474\n\9492 \9496"
it :: String
(0.00 secs, 193,072 bytes)
putStrLn it
*** Exception: : hPutChar: invalid argument (invalid character)
It's all OK if:
putStrLn $ filter (
notElem['\9488','\9474','\9484','\9492','\9496'] ) $ prettyMatrix $ matrix 4 4 $ \(i,j) -> 2*i - j
1 0 -1 -2
3 2 1 0
5 4 3 2
7 6 5 4
The text was updated successfully, but these errors were encountered: