{-# LANGUAGE EmptyDataDecls #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeInType #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}

-- | This module exports orphan instances to make
-- [@servant-queryparam-core@](https://hackage.haskell.org/package/servant-queryparam-core) work with servers.
module Servant.QueryParam.Server.Record () where

import Data.Kind
import Data.Proxy
import GHC.Generics
import GHC.TypeLits
import Servant.API
import Servant.QueryParam.Record
import Servant.QueryParam.TypeLevel
import Servant.Server
import Servant.Server.Internal

instance (Generic a, GHasServer mod (Rep a) context api) => HasServer (RecordParam mod a :> api) context where
  type ServerT (RecordParam mod a :> api) m = a -> ServerT api m
  route :: forall env.
Proxy (RecordParam mod a :> api)
-> Context context
-> Delayed env (Server (RecordParam mod a :> api))
-> Router env
route Proxy (RecordParam mod a :> api)
_ Context context
context Delayed env (Server (RecordParam mod a :> api))
env =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) env.
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Context context
-> Delayed env (a () -> Server api)
-> Router env
gRoute (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api) Context context
context forall a b. (a -> b) -> a -> b
$
      (\a -> ServerT api Handler
f (Rep a ()
x :: Rep a ()) -> a -> ServerT api Handler
f (forall a x. Generic a => Rep a x -> a
to Rep a ()
x)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed env (Server (RecordParam mod a :> api))
env
  {-# INLINE route #-}
  hoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy (RecordParam mod a :> api)
-> Proxy context
-> (forall x. m x -> n x)
-> ServerT (RecordParam mod a :> api) m
-> ServerT (RecordParam mod a :> api) n
hoistServerWithContext Proxy (RecordParam mod a :> api)
_ Proxy context
pc forall x. m x -> n x
nt ServerT (RecordParam mod a :> api) m
s a
x =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) (m :: * -> *) (n :: * -> *).
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (a () -> ServerT api m)
-> a ()
-> ServerT api n
gHoistServerWithContext (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api) Proxy context
pc forall x. m x -> n x
nt (ServerT (RecordParam mod a :> api) m
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a x. Generic a => Rep a x -> a
to) (forall a x. Generic a => a -> Rep a x
from a
x :: Rep a ())
  {-# INLINE hoistServerWithContext #-}

class GHasServer (mod :: Symbol -> Exp Symbol) (a :: Type -> Type) context api where
  gRoute ::
    Proxy mod ->
    Proxy api ->
    Context context ->
    Delayed env (a () -> Server api) ->
    Router env
  gHoistServerWithContext ::
    Proxy mod ->
    Proxy api ->
    Proxy context ->
    (forall x. m x -> n x) ->
    (a () -> ServerT api m) ->
    (a () -> ServerT api n)

data GParam (mod :: Symbol -> Exp Symbol) a

instance
  GHasServer mod a context api =>
  HasServer (GParam mod (a ()) :> api) context
  where
  type ServerT (GParam mod (a ()) :> api) m = a () -> ServerT api m
  route :: forall env.
Proxy (GParam mod (a ()) :> api)
-> Context context
-> Delayed env (Server (GParam mod (a ()) :> api))
-> Router env
route Proxy (GParam mod (a ()) :> api)
_ = forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) env.
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Context context
-> Delayed env (a () -> Server api)
-> Router env
gRoute (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api)
  {-# INLINE route #-}
  hoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy (GParam mod (a ()) :> api)
-> Proxy context
-> (forall x. m x -> n x)
-> ServerT (GParam mod (a ()) :> api) m
-> ServerT (GParam mod (a ()) :> api) n
hoistServerWithContext Proxy (GParam mod (a ()) :> api)
_ = forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) (m :: * -> *) (n :: * -> *).
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (a () -> ServerT api m)
-> a ()
-> ServerT api n
gHoistServerWithContext (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api)
  {-# INLINE hoistServerWithContext #-}

instance
  GHasServer mod c context api =>
  GHasServer mod (D1 m3 c) context api
  where
  gRoute :: forall env.
Proxy mod
-> Proxy api
-> Context context
-> Delayed env (D1 m3 c () -> Server api)
-> Router env
gRoute Proxy mod
_ Proxy api
_ Context context
context Delayed env (D1 m3 c () -> Server api)
env =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) env.
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Context context
-> Delayed env (a () -> Server api)
-> Router env
gRoute (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api) Context context
context forall a b. (a -> b) -> a -> b
$
      (\D1 m3 c () -> Server api
f c ()
x -> D1 m3 c () -> Server api
f (forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 c ()
x)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed env (D1 m3 c () -> Server api)
env
  {-# INLINE gRoute #-}
  gHoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (D1 m3 c () -> ServerT api m)
-> D1 m3 c ()
-> ServerT api n
gHoistServerWithContext Proxy mod
_ Proxy api
_ Proxy context
pc forall x. m x -> n x
nt D1 m3 c () -> ServerT api m
s (M1 c ()
x) =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) (m :: * -> *) (n :: * -> *).
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (a () -> ServerT api m)
-> a ()
-> ServerT api n
gHoistServerWithContext (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api) Proxy context
pc forall x. m x -> n x
nt (D1 m3 c () -> ServerT api m
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1) c ()
x
  {-# INLINE gHoistServerWithContext #-}

instance
  GHasServer mod a context (GParam mod (b ()) :> api) =>
  GHasServer mod (a :*: b) context api
  where
  gRoute :: forall env.
Proxy mod
-> Proxy api
-> Context context
-> Delayed env ((:*:) a b () -> Server api)
-> Router env
gRoute Proxy mod
_ Proxy api
_ Context context
context Delayed env ((:*:) a b () -> Server api)
env =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) env.
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Context context
-> Delayed env (a () -> Server api)
-> Router env
gRoute
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod)
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (GParam mod (b ()) :> api))
      Context context
context
      forall a b. (a -> b) -> a -> b
$ (\(:*:) a b () -> Server api
f a ()
x b ()
y -> (:*:) a b () -> Server api
f (a ()
x forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
:*: b ()
y)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed env ((:*:) a b () -> Server api)
env
  {-# INLINE gRoute #-}
  gHoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> ((:*:) a b () -> ServerT api m)
-> (:*:) a b ()
-> ServerT api n
gHoistServerWithContext Proxy mod
_ Proxy api
_ Proxy context
pc forall x. m x -> n x
nt (:*:) a b () -> ServerT api m
s (a ()
x :*: b ()
y) =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) (m :: * -> *) (n :: * -> *).
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (a () -> ServerT api m)
-> a ()
-> ServerT api n
gHoistServerWithContext
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod)
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (GParam mod (b ()) :> api))
      Proxy context
pc
      forall x. m x -> n x
nt
      (\a ()
x' b ()
y' -> (:*:) a b () -> ServerT api m
s (a ()
x' forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
:*: b ()
y'))
      a ()
x
      b ()
y
  {-# INLINE gHoistServerWithContext #-}

instance
  GHasServer mod a context api =>
  GHasServer mod (C1 n a) context api
  where
  gRoute :: forall env.
Proxy mod
-> Proxy api
-> Context context
-> Delayed env (C1 n a () -> Server api)
-> Router env
gRoute Proxy mod
_ Proxy api
_ Context context
context Delayed env (C1 n a () -> Server api)
env =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) env.
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Context context
-> Delayed env (a () -> Server api)
-> Router env
gRoute (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api) Context context
context forall a b. (a -> b) -> a -> b
$
      (\C1 n a () -> Server api
f a ()
x -> C1 n a () -> Server api
f (forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 a ()
x)) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed env (C1 n a () -> Server api)
env
  {-# INLINE gRoute #-}
  gHoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (C1 n a () -> ServerT api m)
-> C1 n a ()
-> ServerT api n
gHoistServerWithContext Proxy mod
_ Proxy api
_ Proxy context
pc forall x. m x -> n x
nt C1 n a () -> ServerT api m
s (M1 a ()
x) =
    forall {k} (mod :: Symbol -> Exp Symbol) (a :: * -> *)
       (context :: [*]) (api :: k) (m :: * -> *) (n :: * -> *).
GHasServer mod a context api =>
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (a () -> ServerT api m)
-> a ()
-> ServerT api n
gHoistServerWithContext (forall {k} (t :: k). Proxy t
Proxy :: Proxy mod) (forall {k} (t :: k). Proxy t
Proxy :: Proxy api) Proxy context
pc forall x. m x -> n x
nt (C1 n a () -> ServerT api m
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1) a ()
x
  {-# INLINE gHoistServerWithContext #-}

instance
  {-# OVERLAPPING #-}
  ( HasServer (api :: Type) context
  , KnownSymbol sym
  , KnownSymbol (Eval (mod sym))
  ) =>
  GHasServer
    mod
    (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool))
    context
    api
  where
  gRoute :: forall env.
Proxy mod
-> Proxy api
-> Context context
-> Delayed
     env
     (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) () -> Server api)
-> Router env
gRoute Proxy mod
_ Proxy api
_ Context context
context Delayed
  env
  (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) () -> Server api)
env =
    forall {k} (api :: k) (context :: [*]) env.
HasServer api context =>
Proxy api
-> Context context -> Delayed env (Server api) -> Router env
route
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryFlag (Eval (mod sym)) :> api))
      Context context
context
      forall a b. (a -> b) -> a -> b
$ (\S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) () -> Server api
f Bool
x -> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) () -> Server api
f (forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (forall k i c (p :: k). c -> K1 i c p
K1 Bool
x))) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed
  env
  (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) () -> Server api)
env
  {-# INLINE gRoute #-}
  gHoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) ()
    -> ServerT api m)
-> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) ()
-> ServerT api n
gHoistServerWithContext Proxy mod
_ Proxy api
_ Proxy context
pc forall x. m x -> n x
nt S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) () -> ServerT api m
s (M1 (K1 Bool
x)) =
    forall {k} (api :: k) (context :: [*]) (m :: * -> *) (n :: * -> *).
HasServer api context =>
Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> ServerT api m
-> ServerT api n
hoistServerWithContext
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryFlag (Eval (mod sym)) :> api))
      Proxy context
pc
      forall x. m x -> n x
nt
      (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 Bool) () -> ServerT api m
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i c (p :: k). c -> K1 i c p
K1)
      Bool
x
  {-# INLINE gHoistServerWithContext #-}

instance
  {-# OVERLAPPING #-}
  ( HasServer (api :: Type) context
  , FromHttpApiData a
  , KnownSymbol sym
  , KnownSymbol (Eval (mod sym))
  , HasContextEntry (context .++ DefaultErrorFormatters) ErrorFormatters
  ) =>
  GHasServer
    mod
    (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]))
    context
    api
  where
  gRoute :: forall env.
Proxy mod
-> Proxy api
-> Context context
-> Delayed
     env
     (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) () -> Server api)
-> Router env
gRoute Proxy mod
_ Proxy api
_ Context context
context Delayed
  env
  (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) () -> Server api)
env =
    forall {k} (api :: k) (context :: [*]) env.
HasServer api context =>
Proxy api
-> Context context -> Delayed env (Server api) -> Router env
route
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryParams (Eval (mod sym)) a :> api))
      Context context
context
      forall a b. (a -> b) -> a -> b
$ (\S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) () -> Server api
f [a]
x -> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) () -> Server api
f (forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (forall k i c (p :: k). c -> K1 i c p
K1 [a]
x))) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed
  env
  (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) () -> Server api)
env
  {-# INLINE gRoute #-}
  gHoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) ()
    -> ServerT api m)
-> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) ()
-> ServerT api n
gHoistServerWithContext Proxy mod
_ Proxy api
_ Proxy context
pc forall x. m x -> n x
nt S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) () -> ServerT api m
s (M1 (K1 [a]
x)) =
    forall {k} (api :: k) (context :: [*]) (m :: * -> *) (n :: * -> *).
HasServer api context =>
Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> ServerT api m
-> ServerT api n
hoistServerWithContext
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryParams (Eval (mod sym)) a :> api))
      Proxy context
pc
      forall x. m x -> n x
nt
      (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 [a]) () -> ServerT api m
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i c (p :: k). c -> K1 i c p
K1)
      [a]
x
  {-# INLINE gHoistServerWithContext #-}

instance
  {-# OVERLAPPING #-}
  ( HasServer (api :: Type) context
  , FromHttpApiData a
  , KnownSymbol sym
  , KnownSymbol (Eval (mod sym))
  , HasContextEntry (context .++ DefaultErrorFormatters) ErrorFormatters
  ) =>
  GHasServer
    mod
    (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)))
    context
    api
  where
  gRoute :: forall env.
Proxy mod
-> Proxy api
-> Context context
-> Delayed
     env
     (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
      -> Server api)
-> Router env
gRoute Proxy mod
_ Proxy api
_ Context context
context Delayed
  env
  (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
   -> Server api)
env =
    forall {k} (api :: k) (context :: [*]) env.
HasServer api context =>
Proxy api
-> Context context -> Delayed env (Server api) -> Router env
route
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryParam (Eval (mod sym)) a :> api))
      Context context
context
      forall a b. (a -> b) -> a -> b
$ (\S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
-> Server api
f Maybe a
x -> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
-> Server api
f (forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (forall k i c (p :: k). c -> K1 i c p
K1 Maybe a
x))) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed
  env
  (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
   -> Server api)
env
  {-# INLINE gRoute #-}
  gHoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
    -> ServerT api m)
-> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
-> ServerT api n
gHoistServerWithContext Proxy mod
_ Proxy api
_ Proxy context
pc forall x. m x -> n x
nt S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
-> ServerT api m
s (M1 (K1 Maybe a
x)) =
    forall {k} (api :: k) (context :: [*]) (m :: * -> *) (n :: * -> *).
HasServer api context =>
Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> ServerT api m
-> ServerT api n
hoistServerWithContext
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryParam (Eval (mod sym)) a :> api))
      Proxy context
pc
      forall x. m x -> n x
nt
      (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 (Maybe a)) ()
-> ServerT api m
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i c (p :: k). c -> K1 i c p
K1)
      Maybe a
x
  {-# INLINE gHoistServerWithContext #-}

instance
  {-# OVERLAPPABLE #-}
  ( HasServer (api :: Type) context
  , FromHttpApiData a
  , KnownSymbol sym
  , KnownSymbol (Eval (mod sym))
  , HasContextEntry (context .++ DefaultErrorFormatters) ErrorFormatters
  ) =>
  GHasServer
    mod
    (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a))
    context
    api
  where
  gRoute :: forall env.
Proxy mod
-> Proxy api
-> Context context
-> Delayed
     env (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) () -> Server api)
-> Router env
gRoute Proxy mod
_ Proxy api
_ Context context
context Delayed
  env (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) () -> Server api)
env =
    forall {k} (api :: k) (context :: [*]) env.
HasServer api context =>
Proxy api
-> Context context -> Delayed env (Server api) -> Router env
route
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryParam' '[Required, Strict] (Eval (mod sym)) a :> api))
      Context context
context
      forall a b. (a -> b) -> a -> b
$ (\S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) () -> Server api
f a
x -> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) () -> Server api
f (forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (forall k i c (p :: k). c -> K1 i c p
K1 a
x))) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Delayed
  env (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) () -> Server api)
env
  {-# INLINE gRoute #-}
  gHoistServerWithContext :: forall (m :: * -> *) (n :: * -> *).
Proxy mod
-> Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) ()
    -> ServerT api m)
-> S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) ()
-> ServerT api n
gHoistServerWithContext Proxy mod
_ Proxy api
_ Proxy context
pc forall x. m x -> n x
nt S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) () -> ServerT api m
s (M1 (K1 a
x)) =
    forall {k} (api :: k) (context :: [*]) (m :: * -> *) (n :: * -> *).
HasServer api context =>
Proxy api
-> Proxy context
-> (forall x. m x -> n x)
-> ServerT api m
-> ServerT api n
hoistServerWithContext
      (forall {k} (t :: k). Proxy t
Proxy :: Proxy (QueryParam' '[Required, Strict] (Eval (mod sym)) a :> api))
      Proxy context
pc
      forall x. m x -> n x
nt
      (S1 ('MetaSel ('Just sym) d1 d2 d3) (Rec0 a) () -> ServerT api m
s forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall k i c (p :: k). c -> K1 i c p
K1)
      a
x
  {-# INLINE gHoistServerWithContext #-}