git.iko.soy/typeable/servant
on master help sign in
removing DerivingStrategies extension (not compatible ghc < 8.2.1)
commit9357583459f6d406dc80d23d61115ef2345a9877 authorakhesacaro <caroline.gaudreau@gmail.com> dateTue 16 Mar 2021, 21:03 (6 years ago) parent08b5e86
1 file changed+7−5
doc/cookbook/uverb/UVerb.lhs+7−5
doc/cookbook/uverb/UVerb.lhs+7−5
@@ -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
135133newtype 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
158156data Foo = Foo Int Int Int
159− deriving (Show, Eq, GHC.Generic, ToJSON)
157+ deriving (Show, Eq, GHC.Generic)
158+
159+instance ToJSON Foo
160160
161161instance HasStatus Foo where
162162 type StatusOf Foo = 200
163163
164164data Bar = Bar
165− deriving (Show, Eq, GHC.Generic, ToJSON)
165+ deriving (Show, Eq, GHC.Generic)
166+
167+instance ToJSON Bar
166168
167169h :: Handler (Union '[Foo, WithStatus 400 Bar])
168170h = runUVerbT $ do