From de88ed815e26ef76868c2e0fb6fd069511d311d2 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 22 Dec 2022 10:50:42 +0200 Subject: [FP/HW3] Added file reading to second exercise --- Year 2/Functional Programming/hw3.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Year 2/Functional Programming/hw3.hs') diff --git a/Year 2/Functional Programming/hw3.hs b/Year 2/Functional Programming/hw3.hs index 3192d90..446c83c 100644 --- a/Year 2/Functional Programming/hw3.hs +++ b/Year 2/Functional Programming/hw3.hs @@ -38,7 +38,7 @@ countUniques inpt = length (filter (\v -> elem v [2, 3, 4, 7]) (map length (drop main :: IO() main = do - print(generate [10, 15, 25, 35] [1, 5, 20, 30, 40]) - print(countUniques "be cfbegad cbdgef fgaecd cgeb fdcge agebfd fecdb fabcd edb | fdgacbe cefdb cefbgd gcbe") - + print(generate [10, 15, 25, 35] [1, 5, 20, 30, 40]) + inpt <- readFile "input.txt" + print(foldr (\el accum -> accum + (countUniques el)) 0 (lines inpt)) -- cgit v1.3.1-26-gb76a