diff options
author | Andreas Klebinger <klebinger.andreas@gmx.at> | 2019-07-30 17:46:41 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-08-02 08:14:10 -0400 |
commit | 9552114006ea81e379228706caf30cbe3323e1d2 (patch) | |
tree | cee4a1aba3e50f1f5425fcb5f7e78b081f57fc47 | |
parent | 986643cb3506f2eedce96bf2d2c03873f105fad5 (diff) | |
download | haskell-9552114006ea81e379228706caf30cbe3323e1d2.tar.gz |
Add StandaloneDeriving example for DerivingVia.
[skip-ci]
-rw-r--r-- | docs/users_guide/glasgow_exts.rst | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst index 570548095b..c46812baeb 100644 --- a/docs/users_guide/glasgow_exts.rst +++ b/docs/users_guide/glasgow_exts.rst @@ -5422,6 +5422,12 @@ as in the following example: :: Here we make use of the ``Monoid ((->) a)`` instance. +When used in combination with :extension:`StandaloneDeriving` we swap the order +for the instance we base our derivation on and the instance we define e.g.: :: + + deriving via (a -> App m b) instance Monoid (Kleisli m a b) + + .. _pattern-synonyms: Pattern synonyms |