Jump to content

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)
(T.readFile "coverageOutline.txt"fp >>= (T.putStrLn . updatedCoverageOutline)
 
-- UPDATED COVERAGE OUTLINE -------------------------------
Line 473 ⟶ 479:
tabulation :: T.Text -> [T.Text] -> T.Text
tabulation delimiter =
T.intercalate delimiter . zipWith (`T.justifyLeft`append 'delimiter '" ") [31, 9, 9, 9].
zipWith (`T.justifyLeft` ' ') [31, 9, 9, 9]
 
justifyRight :: Int -> a -> [a] -> [a]
9,655

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.