The portable-lines package
Provides an alternative implementation of the Prelude.lines function that treats the following sequences as newline characters:
"\r\n" (Windows style)
"\r" (Macintosh style, before OS X)
"\n" (Unix style)
Haskell's IO system supports both platform-specific line ending conversion (by opening the file in "text mode"), and explicit setting of the newline mode for input and output (see System.IO.hSetNewlineMode). However:
If you don't know the line ending format in advance, you would have to open the file and detect the newline format manually.
ByteString currently honors neither of these; see http://stackoverflow.com/questions/6837628.
Properties
| Version | 0.1 |
|---|---|
| Dependencies | base (4.*), bytestring |
| License | BSD3 |
| Copyright | Copyright (c) Joseph Adams 2011 |
| Author | Joey Adams |
| Maintainer | joeyadams3.14159@gmail.com |
| Category | Text |
| Source repository | git clone git://github.com/joeyadams/haskell-portable-lines.git |
| Upload date | Mon Nov 14 06:53:12 UTC 2011 |
| Uploaded by | JoeyAdams |
| Built on | ghc-7.2 |
Modules
Downloads
- portable-lines-0.1.tar.gz (Cabal source package)
- package description (included in the package)