This is a reframe of the question that was asked at Defining variables inside a function Haskell
I have a function the beginning of which looks like this:
recursiveLs :: FilePath -> IO [FilePath]
recursiveLs dir =
do
folderExists <- doesDirectoryExist dir
if folderExists
then ...
The question is, how can I explicitly declare the type of folderExists
before I assign to it in the action?