Skip to content

Commit 9357583

Browse files
akhesaCaroGaël Deest
authored andcommitted
removing DerivingStrategies extension (not compatible ghc < 8.2.1)
1 parent 08b5e86 commit 9357583

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/cookbook/uverb/UVerb.lhs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@ handlers that respond with arbitrary open unions of types.
99
```haskell
1010
{-# LANGUAGE ConstraintKinds #-}
1111
{-# LANGUAGE DataKinds #-}
12-
{-# LANGUAGE DeriveAnyClass #-}
1312
{-# LANGUAGE DeriveGeneric #-}
14-
{-# LANGUAGE DerivingStrategies #-}
1513
{-# LANGUAGE FlexibleContexts #-}
1614
{-# LANGUAGE FlexibleInstances #-}
1715
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -133,7 +131,7 @@ Since `UVerb` (probably) will mostly be used for error-like responses, it may be
133131
134132
```haskell
135133
newtype UVerbT xs m a = UVerbT { unUVerbT :: ExceptT (Union xs) m a }
136-
deriving newtype (Functor, Applicative, Monad, MonadTrans)
134+
deriving (Functor, Applicative, Monad, MonadTrans)
137135
138136
-- | Deliberately hide 'ExceptT's 'MonadError' instance to be able to use
139137
-- underlying monad's instance.
@@ -156,13 +154,17 @@ Example usage:
156154
157155
```haskell
158156
data Foo = Foo Int Int Int
159-
deriving (Show, Eq, GHC.Generic, ToJSON)
157+
deriving (Show, Eq, GHC.Generic)
158+
159+
instance ToJSON Foo
160160
161161
instance HasStatus Foo where
162162
type StatusOf Foo = 200
163163
164164
data Bar = Bar
165-
deriving (Show, Eq, GHC.Generic, ToJSON)
165+
deriving (Show, Eq, GHC.Generic)
166+
167+
instance ToJSON Bar
166168
167169
h :: Handler (Union '[Foo, WithStatus 400 Bar])
168170
h = runUVerbT $ do

0 commit comments

Comments
 (0)