Core libs summary

Simon Marlow simonmar@microsoft.com
Fri, 29 Jun 2001 17:46:06 +0100


> Ok, I've marked against your list anything that I think is problematic
> for nhc98, despite being designated portable.

Cool, thanks.  Comments below.
=20
> Regards,
>     Malcolm
>=20
> ------------------
>     Control.
>         Monad.
>             Identity            ( portable, experimental )
> 			***	Re-exports Control.Monad.Fix, which
> 			***	is designated non-portable.

I've made Control.Monad.Fix portable by moving the IO and ST instances
to the correct places.  Identity should now be portable too.

>             ST.
>                 Lazy            ( portable, provisional )
>                 Strict          ( portable, provisional )
> 			***	Don't both variants of ST  require
runtime
> 			***	system support?  If so, then  not yet
portable.

Sorry, I thought NHC had the ST monad.  Ok, I'll mark it non-portable
for the time being.  Actually to implement it all you need is a bit of
typechecker support for runST and that's it, though.

>             Trans               ( portable, experimental )
> 			***	I can't imagine what the name means, but
> 			***	the code does look like pure Haskell'98.

It's the monad transformer class.  Andy G - would you like to change the
name?  (and would you like to be the maintainer? :-)

>         Monad                   ( portable, provisional )
>     Data.
>         Array                   ( portable, provisional )
>         Bits                    ( portable, experimental )
> 			***	Not portable.  requires either  RTS
support
> 			***	or an FFI'd implementation in C  I would
think.

I was thinking that Bits is required by Data.Word & Data.Int, which are
in turn required by the Foreign stuff, but you can perhaps get away
without exporting Bits instances from these modules.  However, I think
Bits is desirable if not essential when doing FFI stuff - we can discuss
& change the interface if you like (but IIRC it was already discussed to
death when Alastair designed it).

Perhaps we could make 'instance Bits Integer' optional, because that's
probably the hardest bit.

>         Bool                    ( portable, experimental )
>         Char                    ( portable, provisional )
>         Complex                 ( portable, provisional )
>         Dynamic                 ( portable, experimental )
> 			***	Doesn't contain a data decl for Dynamic,
> 			***	but otherwise looks ok.  This doesn't
require
> 			***	any RTS support does it?

It requires unsafePerformIO & IORefs, but that's all.  The data decl for
Dynamic is in GHC.Dynamic because GHC needs it for the Exception data
type.  (but it's generic so it can probably be moved out of there).

>         Either                  ( portable, experimental )
>         IORef                   ( portable, experimental )
>         Int                     ( portable, experimental )
>         Ix                      ( portable, provisional )
> 			***	H'98 compliance: rangeSize should now be
> 			***	a class member.

Yup, still ToDo.

>         List                    ( portable, provisional )
>         Maybe                   ( portable, experimental )
>         PackedString            ( portable, experimental )
> 			***	nhc98 implements only the `classic' HBC
> 			***	interface.  In particular, none of the
> 			***	ByteArray ops are portable.

oops, I hadn't noticed it mentioned ByteArrays.  Ok, I'll remove these.

>         Ratio                   ( portable, provisional )
>         STRef                   ( portable, experimental )
> 			***	As with the ST monad, I believe RTS
support
> 			***	or an FFI'd implementation is required?

Ok.

>         Word                    ( portable, experimental )
>     Database.
>     Debug.
>         Trace                   ( portable, provisional )
>     FileFormat.
>     Foreign.
> 			***	I haven't looked at the Foreign stuff in
> 			***	detail for quite a while, so apart from
> 			***	some RTS implementation in nhc98, I'm
> 			***	assuming everything else is
straightforward.
>     GHC.
>     Hugs.
>     NHC.
> 			***	I'd prefer Nhc or Nhc98.  All caps is
horrible.

Ok, Nhc it is.  But it looks horrible next to GHC :-)

>     Network.
>     Prelude                     ( portable, provisional )
>     System.
> 			***	The sample implementations of many of
these
> 			***	System libraries are not very portable,
but
> 			***	the interfaces are probably ok.

The implementations of CPUTime, Cmd, Environment, Exit, Time, and
Directory are all rewrites of the original GHC versions to use the new
FFI & Foreign libraries, so they should be quite portable.  You do need
hsc2hs and a suitable config.h, though.  I think it would be great if we
could all use the same implementations of these libs, though.

>         CPUTime                 ( portable, provisional )
>         Cmd                     ( portable, provisional )
>         Environment             ( portable, provisional )
>         Exit                    ( portable, provisional )
>         IO.
>             Directory           ( portable, provisional )
> 			***	Incorrect interface: Permissions should
not
> 			***	be abstract.

well spotted, thanks.

>             Unsafe              ( portable, provisional )
>         IO                      ( portable, provisional )
>         Info                    ( portable, provisional )
> 			***	A great idea.  Status should be
experimental.

done.

>         Locale                  ( portable, provisional )
>         Random                  ( portable, provisional )
>         Time                    ( portable, provisional )
>     Text.
>         Read                    ( portable, provisional )
>         Show.
>             Functions           ( portable, provisional )
>         Show                    ( portable, provisional )