@@ -240,6 +240,14 @@ feof : File -> IO Bool
240feof (FHandle h) = do eof <- do_feof h
240feof (FHandle h) = do eof <- do_feof h
241 return (not (eof == 0))
241 return (not (eof == 0))
243+nullPtr : Ptr -> IO Bool
244+nullPtr p = do ok <- mkForeign (FFun "isNull" [FPtr] FInt) p
247+validFile : File -> IO Bool
248+validFile (FHandle h) = do x <- nullPtr h
243while : |(test : IO Bool) -> |(body : IO ()) -> IO ()
251while : |(test : IO Bool) -> |(body : IO ()) -> IO ()
244while t b = do v <- t
252while t b = do v <- t
245 if v then (do { b; while t b }) else return ()
253 if v then (do { b; while t b }) else return ()