11module Node.FS.Stream
22 ( createWriteStream
33 , fdCreateWriteStream
4- , WriteStreamOptions ()
4+ , WriteStreamOptions
55 , defaultWriteStreamOptions
66 , createWriteStreamWith
77 , fdCreateWriteStreamWith
88 , createReadStream
99 , fdCreateReadStream
10- , ReadStreamOptions ()
10+ , ReadStreamOptions
1111 , defaultReadStreamOptions
1212 , createReadStreamWith
1313 , fdCreateReadStreamWith
1414 ) where
1515
1616import Prelude
1717
18- import Data.Maybe (Maybe (..))
19- import Data.Nullable (Nullable , toNullable )
18+ import Data.Nullable (Nullable , notNull , null )
2019import Effect (Effect )
2120import Effect.Uncurried (EffectFn2 , runEffectFn2 )
2221import Node.FS (FileDescriptor )
@@ -34,12 +33,6 @@ readWrite = Perms.mkPerms rw rw rw
3433 where
3534 rw = Perms .read + Perms .write
3635
37- null :: forall a . Nullable a
38- null = toNullable Nothing
39-
40- nonnull :: forall a . a -> Nullable a
41- nonnull = toNullable <<< Just
42-
4336-- | Create a Writable stream which writes data to the specified file, using
4437-- | the default options.
4538createWriteStream
@@ -72,7 +65,7 @@ createWriteStreamWith
7265 -> Effect (Writable ())
7366createWriteStreamWith opts file = runEffectFn2
7467 createWriteStreamImpl
75- (nonnull file)
68+ (notNull file)
7669 { mode: Perms .permsToInt opts.perms
7770 , flags: fileFlagsToNode opts.flags
7871 }
@@ -124,7 +117,7 @@ createReadStreamWith
124117 -> Effect (Readable ())
125118createReadStreamWith opts file = runEffectFn2
126119 createReadStreamImpl
127- (nonnull file)
120+ (notNull file)
128121 { mode: Perms .permsToInt opts.perms
129122 , flags: fileFlagsToNode opts.flags
130123 , autoClose: opts.autoClose
0 commit comments