@@ -4,12 +4,19 @@ Servant allows you to talk about the exceptions you throw in your API
44types. This is not limited to actual exceptions, you can write
55handlers that respond with arbitrary open unions of types.
66
7+ ## Compatibility
8+
9+ :warning: This cookbook is compatible with GHC 8.6.1 or higher :warning:
10+
711## Preliminaries
812
913`` `haskell
1014{-# LANGUAGE ConstraintKinds #-}
1115{-# LANGUAGE DataKinds #-}
1216{-# LANGUAGE DeriveGeneric #-}
17+ {-# LANGUAGE DerivingStrategies #-}
18+ {-# LANGUAGE DeriveAnyClass #-}
19+ {-# LANGUAGE DerivingVia #-}
1320{-# LANGUAGE FlexibleContexts #-}
1421{-# LANGUAGE FlexibleInstances #-}
1522{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -154,12 +161,8 @@ Example usage:
154161
155162```haskell
156163data Foo = Foo Int Int Int
157- deriving (Show, Eq, GHC.Generic)
158-
159- instance ToJSON Foo
160-
161- instance HasStatus Foo where
162- type StatusOf Foo = 200
164+ deriving (Show, Eq, GHC.Generic, ToJSON)
165+ deriving HasStatus via WithStatus 200 Foo
163166
164167data Bar = Bar
165168 deriving (Show, Eq, GHC.Generic)
0 commit comments