Skip to content

Update Question 1 to be more precise #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2023

Conversation

cipherlogs
Copy link

Hi there! It seems like the homework is not matching what I saw in the solutions section. Could you please clarify the question so that it is more clear to others ? Thank you!

what I thought it needed to be done from question 1

-- Q1
listFiles :: IO ()
listFiles
  = listDirectory (".")
  >>= filterM doesFileExist
  >>= return . length
  >>= (\num -> putStrLn ("Found " ++ show num ++ " files."))

however looking at the solution, listFiles here is counting directories too, which isn't what the exercise was asking for

listFiles :: IO ()
listFiles = do
  x <- listDirectory "."
  let amount = length x
  putStrLn $ "Files and folders in current directory: " ++ show amount

@rober-m rober-m merged commit 7b27908 into input-output-hk:main Jul 27, 2023
@rober-m
Copy link
Member

rober-m commented Jul 27, 2023

Thank you, @cipherlogs! 🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants