Functional coverage tree: Difference between revisions
m
→{{header|Haskell}}: (+ basic check for input file existence)
m (J: dissect wasn't all that informative) |
m (→{{header|Haskell}}: (+ basic check for input file existence)) |
||
Line 351:
<lang haskell>{-# LANGUAGE OverloadedStrings #-}
import System.Directory (doesFileExist)
import qualified Data.Text.Read as T
import qualified Data.Text.IO as T
Line 368 ⟶ 369:
-- TEST ---------------------------------------------------
fp = "./coverageOutline.txt"
main :: IO ()
main =
doesFileExist fp >>=
T.readFile "coverageOutline.txt" >>= (T.putStrLn . updatedCoverageOutline)▼
bool
(print $ "File not found: " ++ fp)
-- UPDATED COVERAGE OUTLINE -------------------------------
Line 473 ⟶ 479:
tabulation :: T.Text -> [T.Text] -> T.Text
tabulation delimiter =
T.intercalate
zipWith (`T.justifyLeft` ' ') [31, 9, 9, 9]
justifyRight :: Int -> a -> [a] -> [a]
|