git.iko.soy/typeable/servant
on master help sign in
Exclude quantified constraints code for GHCJS
861cd4fGaël Deest
servant-client-core/src/Servant/Client/Generic.hs+10−1
@@ -1,16 +1,21 @@
1{-# OPTIONS_GHC -fno-warn-orphans #-}
1{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# LANGUAGE ConstraintKinds #-}
2{-# LANGUAGE ConstraintKinds #-}
3+{-# LANGUAGE CPP #-}
3{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleContexts #-}
4{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE FlexibleInstances #-}
5{-# LANGUAGE InstanceSigs #-}
6{-# LANGUAGE InstanceSigs #-}
6{-# LANGUAGE KindSignatures #-}
7{-# LANGUAGE KindSignatures #-}
7{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE MultiParamTypeClasses #-}
8−{-# LANGUAGE QuantifiedConstraints #-}
9{-# LANGUAGE RankNTypes #-}
9{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE TypeApplications #-}
11{-# LANGUAGE TypeApplications #-}
12{-# LANGUAGE TypeFamilies #-}
12{-# LANGUAGE TypeFamilies #-}
13{-# LANGUAGE UndecidableInstances #-}
13{-# LANGUAGE UndecidableInstances #-}
14+
15+#if __GLASGOW_HASKELL__ >= 806
16+{-# LANGUAGE QuantifiedConstraints #-}
17+#endif
18+
14module Servant.Client.Generic (
19module Servant.Client.Generic (
15 AsClientT,
20 AsClientT,
16 genericClient,
21 genericClient,
@@ -58,6 +63,8 @@ genericClientHoist nt
58 m = Proxy :: Proxy m
63 m = Proxy :: Proxy m
59 api = Proxy :: Proxy (ToServantApi routes)
64 api = Proxy :: Proxy (ToServantApi routes)
60
65
66+#if __GLASGOW_HASKELL__ >= 806
67+
61type GClientConstraints api m =
68type GClientConstraints api m =
62 ( GenericServant api (AsClientT m)
69 ( GenericServant api (AsClientT m)
63 , Client m (ToServantApi api) ~ ToServant api (AsClientT m)
70 , Client m (ToServantApi api) ~ ToServant api (AsClientT m)
@@ -95,3 +102,5 @@ instance
95 fromServant @api @(AsClientT mb) $
102 fromServant @api @(AsClientT mb) $
96 hoistClientMonad @m @(ToServantApi api) @ma @mb Proxy Proxy nat $
103 hoistClientMonad @m @(ToServantApi api) @ma @mb Proxy Proxy nat $
97 toServant @api @(AsClientT ma) clientA
104 toServant @api @(AsClientT ma) clientA
105+
106+#endif
servant-server/src/Servant/Server/Generic.hs+10
@@ -1,6 +1,7 @@
1{-# OPTIONS_GHC -fno-warn-orphans #-}
1{-# OPTIONS_GHC -fno-warn-orphans #-}
2{-# LANGUAGE AllowAmbiguousTypes #-}
2{-# LANGUAGE AllowAmbiguousTypes #-}
3{-# LANGUAGE ConstraintKinds #-}
3{-# LANGUAGE ConstraintKinds #-}
4+{-# LANGUAGE CPP #-}
4{-# LANGUAGE DataKinds #-}
5{-# LANGUAGE DataKinds #-}
5{-# LANGUAGE DefaultSignatures #-}
6{-# LANGUAGE DefaultSignatures #-}
6{-# LANGUAGE FlexibleContexts #-}
7{-# LANGUAGE FlexibleContexts #-}
@@ -15,6 +16,11 @@
15{-# LANGUAGE TypeFamilies #-}
16{-# LANGUAGE TypeFamilies #-}
16{-# LANGUAGE TypeOperators #-}
17{-# LANGUAGE TypeOperators #-}
17{-# LANGUAGE UndecidableInstances #-}
18{-# LANGUAGE UndecidableInstances #-}
19+
20+#if __GLASGOW_HASKELL__ >= 806
21+{-# LANGUAGE QuantifiedConstraints #-}
22+#endif
23+
18-- | @since 0.14.1
24-- | @since 0.14.1
19module Servant.Server.Generic (
25module Servant.Server.Generic (
20 AsServerT,
26 AsServerT,
@@ -113,6 +119,8 @@ genericServerT
113 -> ToServant routes (AsServerT m)
119 -> ToServant routes (AsServerT m)
114genericServerT = toServant
120genericServerT = toServant
115
121
122+#if __GLASGOW_HASKELL__ >= 806
123+
116-- | Set of constraints required to convert to / from vanilla server types.
124-- | Set of constraints required to convert to / from vanilla server types.
117type GServerConstraints api m =
125type GServerConstraints api m =
118 ( ToServant api (AsServerT m) ~ ServerT (ToServantApi api) m
126 ( ToServant api (AsServerT m) ~ ServerT (ToServantApi api) m
@@ -173,3 +181,5 @@ instance
173 toServant server
181 toServant server
174 servantSrvN :: ServerT (ToServantApi api) n =
182 servantSrvN :: ServerT (ToServantApi api) n =
175 hoistServerWithContext (Proxy @(ToServantApi api)) pctx nat servantSrvM
183 hoistServerWithContext (Proxy @(ToServantApi api)) pctx nat servantSrvM
184+
185+#endif