unboxed types

Isaac Dupree isaacdupree at charter.net
Thu Jan 3 13:04:47 EST 2008


Malcolm Wallace wrote:
> It simply contains type signatures for exported functions, together with
> datatype, class, and instance decls.  A signature for function 'foo' is
> preceded by a {-# NEED foo #-} pragma; a datatype or class decl is
> preceded by a similar pragma listing precisely the exported
> constructors, fieldnames, or methods.

okay, so instance declarations don't get a "NEED" pragma because they're 
just implicitly exported?

Must the complete set of exports of the .hs module be mentioned, or 
(like in ghc) only the ones necessary for booting?

the complete type must be mentioned for syntax reasons, e.g.
{-# NEED Foo #-}
data Foo = Bar
rather than allowing to say
data Foo
?  Do the unNEEDed parts have to be accurate?

> 
> Sections of the file are introduced by
>     interface ! Foo.Bar
> or
>     interface Foo.Bar
> The former indicates re-exports from a different module.  The latter
> indicates entities (types or classes only) that are required from a
> different module in order to make sense of the type signatures exported
> here, but the external entities are _not_ re-exported.

is "Foo.Bar" a module name or a qualified name there?  It's used when a 
normal .hs file would have to use "import", right?  -how is it "sections 
of the file"?  If it's (module)(Foo.Bar), does the .hi include 
information for multiple modules?  If it's 
(module)Foo.(constructor/class/type)Bar, is it the module name you 
choose to import it from, or does it have to be the original module the 
type is defined in?

maybe a complicated example would be helpful if there is one somewhere.

-Isaac



More information about the Cvs-ghc mailing list