Skip to content

Instantly share code, notes, and snippets.

@fizruk
Created March 21, 2017 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fizruk/57c43e97b9015491a9ac18a2983bc829 to your computer and use it in GitHub Desktop.
Save fizruk/57c43e97b9015491a9ac18a2983bc829 to your computer and use it in GitHub Desktop.
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Lens
import Data.Typeable
import qualified Data.Text as Text
instance {-# OVERLAPPING #-} (Typeable a, ToSchema a) => ToSchema (Either WalletError a) where
declareNamedSchema proxy = genericDeclareNamedSchema defaultSchemaOptions proxy
& mapped.name ?~ Text.pack ("Either WalletError " ++ show (typeOf (undefined :: a)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment