Skip to content
Snippets Groups Projects
Commit 07f46536 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

[project @ 2000-10-05 15:33:03 by simonpj]

Add a bit more documentation of generics
parent 4131bc33
No related merge requests found
......@@ -4279,6 +4279,22 @@ That is, just leave off the "where" clasuse. Of course, you can put in the
where clause and over-ride whichever methods you please.
<Sect2> <Title> Using generics </Title>
</Sect2>
<Para>
To use generics you need to
<ItemizedList>
<ListItem>
Use the <Option>-fgenerics</Option> flag.
</ListItem>
<ListItem>
Import the module <Literal>Generics</Literal> from the <Literal>lang</Literal> package.
This import brings into scope the data types <Literal>Unit</Literal>, <Literal>:*:</Literal>,
and <Literal>:+:</Literal>. (You don't need this import if you don't mention these
types explicitly; for example, if you are simply giving instance declarations.)
</ListItem>
</ItemizedList>
<Sect2> <Title> Changes wrt the paper </Title>
<Para>
Note that the type constructors <Literal>:+:</Literal> and <Literal>:*:</Literal>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment