@@ -9,9 +9,7 @@ handlers that respond with arbitrary open unions of types.
10{-# LANGUAGE ConstraintKinds #-}
10{-# LANGUAGE ConstraintKinds #-}
11{-# LANGUAGE DataKinds #-}
11{-# LANGUAGE DataKinds #-}
12−{-# LANGUAGE DeriveAnyClass #-}
13{-# LANGUAGE DeriveGeneric #-}
12{-# LANGUAGE DeriveGeneric #-}
14−{-# LANGUAGE DerivingStrategies #-}
15{-# LANGUAGE FlexibleContexts #-}
13{-# LANGUAGE FlexibleContexts #-}
16{-# LANGUAGE FlexibleInstances #-}
14{-# LANGUAGE FlexibleInstances #-}
17{-# LANGUAGE GeneralizedNewtypeDeriving #-}
15{-# LANGUAGE GeneralizedNewtypeDeriving #-}
@@ -133,7 +131,7 @@ Since `UVerb` (probably) will mostly be used for error-like responses, it may be
134```haskell
132```haskell
135newtype UVerbT xs m a = UVerbT { unUVerbT :: ExceptT (Union xs) m a }
133newtype UVerbT xs m a = UVerbT { unUVerbT :: ExceptT (Union xs) m a }
136− deriving newtype (Functor, Applicative, Monad, MonadTrans)
134+ deriving (Functor, Applicative, Monad, MonadTrans)
138-- | Deliberately hide 'ExceptT's 'MonadError' instance to be able to use
136-- | Deliberately hide 'ExceptT's 'MonadError' instance to be able to use
139-- underlying monad's instance.
137-- underlying monad's instance.
@@ -156,13 +154,17 @@ Example usage:
157```haskell
155```haskell
158data Foo = Foo Int Int Int
156data Foo = Foo Int Int Int
159− deriving (Show, Eq, GHC.Generic, ToJSON)
157+ deriving (Show, Eq, GHC.Generic)
161instance HasStatus Foo where
161instance HasStatus Foo where
162 type StatusOf Foo = 200
162 type StatusOf Foo = 200
164data Bar = Bar
164data Bar = Bar
165− deriving (Show, Eq, GHC.Generic, ToJSON)
165+ deriving (Show, Eq, GHC.Generic)
167h :: Handler (Union '[Foo, WithStatus 400 Bar])
169h :: Handler (Union '[Foo, WithStatus 400 Bar])
168h = runUVerbT $ do
170h = runUVerbT $ do