summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonpj <unknown>2000-10-05 15:33:03 +0000
committersimonpj <unknown>2000-10-05 15:33:03 +0000
commit07f465362b11aeb73aee34af77182ba986c54460 (patch)
tree682ab2017b785d7ca1517f4c1513e1a30b66e924
parent4131bc3339d977ab0b473ee30c00f7bd6cd577f8 (diff)
downloadhaskell-07f465362b11aeb73aee34af77182ba986c54460.tar.gz
[project @ 2000-10-05 15:33:03 by simonpj]
Add a bit more documentation of generics
-rw-r--r--ghc/docs/users_guide/glasgow_exts.sgml16
1 files changed, 16 insertions, 0 deletions
diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml
index 7cb23c0520..b52adc9148 100644
--- a/ghc/docs/users_guide/glasgow_exts.sgml
+++ b/ghc/docs/users_guide/glasgow_exts.sgml
@@ -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>