Update readDirStream to use Maybe readdirstream-maybe-patch
authorEric Mertens <emertens@galois.com>
Wed, 7 Dec 2016 07:22:53 +0000 (23:22 -0800)
committerEric Mertens <emertens@galois.com>
Wed, 7 Dec 2016 07:22:53 +0000 (23:22 -0800)
commit7c89170c19db81b76fbcda8c73e6c6fd9f364f00
tree47bd8be6002995705d54a7dfed0d9e38daae2eda
parentfb1efd1fd78c3125c14e69650a9eb5666527719f
Update readDirStream to use Maybe

This patch changes `readDirStream` to signal end of directory with a
Nothing value. In addition it changes the wrapped readdir function to
only return -1 in the case of an actual error. This change allows the
errno handling logic to take advantage of helpers from Foreign.C.Error,
simplifying the logic.

Fixes #81
System/Posix/Directory.hsc
System/Posix/Directory/ByteString.hsc
cbits/HsUnix.c
changelog.md