Running one of your examples under Windows, I get the following error:
C:\Users\hgolden\Documents\Automation\Haskell>ghci
GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help
[snip]
Prelude> import Turtle
Prelude Turtle> dir <- pwd
[snip]
Prelude Turtle> time <- datefile dir
*** Exception: CreateFile "C:\Users\hgolden\Documents\Automation\Haskell": permission denied (Access is denied.)
Prelude Turtle>
It appears that this problem only occurs if the file is a directory. For example, this works:
Prelude Turtle> time <- datefile $ fromString ".\example.hs"
Prelude Turtle> print time
2015-03-16 21:40:36.697 UTC
Prelude Turtle>
Running one of your examples under Windows, I get the following error:
C:\Users\hgolden\Documents\Automation\Haskell>ghci
GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help
[snip]
Prelude> import Turtle
Prelude Turtle> dir <- pwd
[snip]
Prelude Turtle> time <- datefile dir
*** Exception: CreateFile "C:\Users\hgolden\Documents\Automation\Haskell": permission denied (Access is denied.)
Prelude Turtle>
It appears that this problem only occurs if the file is a directory. For example, this works:
Prelude Turtle> time <- datefile $ fromString ".\example.hs"
Prelude Turtle> print time
2015-03-16 21:40:36.697 UTC
Prelude Turtle>