elm-console icon indicating copy to clipboard operation
elm-console copied to clipboard

Add readFile

Open mgold opened this issue 8 years ago • 1 comments

It would be nice to read from a file. readFile : String -> IO String. An invalid path would be the same as pure ""; alternatively it may return an IO (Maybe String) or similarly with a Result.

If you like the idea but don't have time to implement it, I could sent a PR sometime next week.

mgold avatar Apr 01 '16 21:04 mgold

Actually I don't think it belongs in this library. Since I forked maxsnew/IO, I wanted to focus on using the console, specifically to support things like elm-test. writeFile only exists for historical reasons, and probably should be removed.

There are many complications with file reading & writing file (handling errors, joining paths, character encoding) which I think should exist in a separate library.

laszlopandy avatar Apr 12 '16 09:04 laszlopandy