Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
d751a9f1
by Pierre Thierry at 2025-07-21T13:37:28-04:00
1 changed file:
Changes:
| ... | ... | @@ -392,9 +392,14 @@ module GHC.Generics ( |
| 392 | 392 | -- instance (Encode a) => Encode (Tree a)
|
| 393 | 393 | -- @
|
| 394 | 394 | --
|
| 395 | --- The generic default is being used. In the future, it will hopefully be
|
|
| 396 | --- possible to use @deriving Encode@ as well, but GHC does not yet support
|
|
| 397 | --- that syntax for this situation.
|
|
| 395 | +-- The generic default is being used. Alternatively the @DeriveAnyClass@ language extension can be
|
|
| 396 | +-- used to derive Encode:
|
|
| 397 | +--
|
|
| 398 | +-- @
|
|
| 399 | +-- {-# LANGUAGE DeriveAnyClass #-}
|
|
| 400 | +-- data Tree a = Leaf a | Node (Tree a) (Tree a)
|
|
| 401 | +-- deriving (Generic, Encode)
|
|
| 402 | +-- @
|
|
| 398 | 403 | --
|
| 399 | 404 | -- Having @Encode@ as a class has the advantage that we can define
|
| 400 | 405 | -- non-generic special cases, which is particularly useful for abstract
|