HTML5 introduced a standard file API. Does GHCJS give access to that? Can I use the standard Haskell IO facilities in System.IO
?
Asked
Active
Viewed 302 times
4

Tobias Brandt
- 3,393
- 18
- 28
-
@bheklilr Nothing, I'm evaluating whether to use GHCJS for GUI programming. – Tobias Brandt Mar 07 '14 at 23:21
1 Answers
5
I don't think it is possible to implement standard System.IO
facilities using the HTML5 file api.
Here are some things that are possible with System.IO
, but aren't possible with the HTML5 File API:
- Writing files
- Reading arbitrary files. In fact, there is no way to get any identifier for a file, the only way to get access to a file is by letting the user select the file in some way. There is no way to refer to a file by name.
- Any operations on directories
As you can see, the HTML5 file API can pretty much only be used to upload files, and not to implement standard haskell System.IO
actions. The only thing you could do is provide a way to get a Handle
by letting the user select a file, and then provide hRead
for that handle (but that's the only operation you can provide).

bennofs
- 11,873
- 1
- 38
- 62