[nhc-bugs] Exporting class methods

Malcolm Wallace Malcolm.Wallace at cs.york.ac.uk
Tue Apr 19 07:15:01 EDT 2005


> > Yes, pretty-much all of these rely on significant extensions to
> > Haskell'98. 
> 
> Nah, many of these are implementable without changing the compiler:
> 
> >> Control.Exception (bracket_, catch, block, unblock
> >>                    catchJust, Exception(IOException)
> >>                    catchDyn, throwDynTo, bracket, ioErrors, finally )
> 
> Needs exception support, of course

Yes, an extension.  :-)

> >> Control.Concurrent ( ThreadId, myThreadId )
> >> Control.Concurrent.MVar (MVar, modifyMVar_, swapMVar, newMVar)
> 
> Easy (no forkIO)

What use are MVar's if there is only one thread?  I thought they were
a communication/synchronisation primitive.  But from the signatures
of modifyMVar_ and swapMVar, it looks like these MVars are really
just IORefs in disguise.  So the user should code them as IORefs if
that's what they mean!  More portable.

> >> System.Posix.IO (fdToHandle)
> 
> nhc98 must have something like this already.

Yeah, probably, somewhere inside the RTS.

> >> System.Posix.Types ( Fd(Fd) )
> >> System.IO ( hPutBuf, hGetBuf, hIsTerminalDevice ) -- claims to be portable!
> >> System.Posix (getFileStatus, setFileMode, unionFileModes,
> >>               ownerExecuteMode, groupExecuteMode, fileMode
> >>               EpochTime, modificationTime, sleep, FileOffset,
> >>               fileSize, setFileTimes, epochTime)
> 
> All implementable using the FFI only

Perhaps.  I think the current posix stuff in fptools relies on
exceptions, so it would need to be re-implemented.

> >> Control.Monad.Reader (Reader, runReader, ask, local)
> >> Control.Monad.Error (instance MonadPlus IO)
> 
> These have H98 implementations, as far as I'm aware.

The mtl package requires multi-param classes and functional
dependencies.  Where are the H'98 versions?

Regards,
    Malcolm


More information about the Nhc-bugs mailing list