From f8c11165cbbbb01a243939998e2ffec0cfc7eb5d Mon Sep 17 00:00:00 2001 From: Myoungjin JEON Date: Thu, 8 Oct 2020 14:53:55 +1100 Subject: [ch-081/jeongoon] Haskell solution modified --- challenge-081/jeongoon/haskell/ch-1.hs | 3 +-- challenge-081/jeongoon/haskell/ch-2.hs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'challenge-081') diff --git a/challenge-081/jeongoon/haskell/ch-1.hs b/challenge-081/jeongoon/haskell/ch-1.hs index ea32cf086f..269c0ec152 100644 --- a/challenge-081/jeongoon/haskell/ch-1.hs +++ b/challenge-081/jeongoon/haskell/ch-1.hs @@ -1,6 +1,5 @@ import System.Environment import System.Exit -import Data.List (intercalate) --commonDivisors :: (Integral a) => [a] -> [a] commonDivisors [] = [] @@ -26,4 +25,4 @@ main = do strs <- getArgs if length strs < 2 then die $ "usage: runhaskell ch-1.hs " - else putStrLn $ ((intercalate " ").commonBaseStrings) strs + else putStrLn $ (unwords.commonBaseStrings) strs diff --git a/challenge-081/jeongoon/haskell/ch-2.hs b/challenge-081/jeongoon/haskell/ch-2.hs index d56022e832..cb5b8e31d6 100644 --- a/challenge-081/jeongoon/haskell/ch-2.hs +++ b/challenge-081/jeongoon/haskell/ch-2.hs @@ -9,7 +9,7 @@ import Data.Map.Strict (Map) -} {- comment: - when using Data.Text, it becomes allmost twice faster than regular [Char] + when using Data.Text, it becomes almost twice faster than regular [Char] complie with: ghc -O2 ch-2 tested with ./ch-2 -- cgit