Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
9c5aa098
Commit
9c5aa098
authored
Sep 19, 2006
by
bjorn@bringert.net
Browse files
First documentation on stand-alone instance deriving.
parent
8611d7d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/users_guide/glasgow_exts.xml
View file @
9c5aa098
...
...
@@ -3727,6 +3727,33 @@ the standard method is used or the one described here.)
</sect2>
<sect2
id=
"stand-alone-deriving"
>
<title>
Stand-alone deriving declarations
</title>
<para>
GHC now allows stand-alone
<literal>
deriving
</literal>
declarations:
</para>
<programlisting>
data Foo = Bar Int | Baz String
deriving Eq for Foo
</programlisting>
<para>
Deriving instances of multi-parameter type classes for newtypes is
also allowed:
</para>
<programlisting>
newtype Foo a = MkFoo (State Int a)
deriving (MonadState Int) for Foo
</programlisting>
<para>
</para>
</sect2>
<sect2
id=
"typing-binds"
>
<title>
Generalised typing of mutually recursive bindings
</title>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment