git.iko.soy/typeable/servant
on master help sign in
reverting : removing DerivingVia extension (not compatible ghc < 8.6.1)
commitba379287c80e502e47664597370cef4b5593e417 authorakhesaCaro <caroline.gaudreau@gmail.com> dateTue 23 Mar 2021, 14:09 (6 years ago) parent0743ca7
1 file changed+4−6
doc/cookbook/uverb/UVerb.lhs+4−6
doc/cookbook/uverb/UVerb.lhs+4−6
@@ -10,6 +10,8 @@ handlers that respond with arbitrary open unions of types.
1010{-# LANGUAGE ConstraintKinds #-}
1111{-# LANGUAGE DataKinds #-}
1212{-# LANGUAGE DeriveGeneric #-}
13+{-# LANGUAGE DerivingStrategies #-}
14+{-# LANGUAGE DerivingVia #-}
1315{-# LANGUAGE FlexibleContexts #-}
1416{-# LANGUAGE FlexibleInstances #-}
1517{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -154,12 +156,8 @@ Example usage:
154156
155157```haskell
156158data 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
159+ deriving (Show, Eq, GHC.Generic, ToJSON)
160+ deriving HasStatus via WithStatus 200 Foo
163161
164162data Bar = Bar
165163 deriving (Show, Eq, GHC.Generic)