summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T22379a.hs
blob: d4caa01048c7045bb41c8ce02294c7a1fb7e1667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{-# LANGUAGE Haskell2010 #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeFamilies #-}
module Bug where

import Data.Kind
import Data.Proxy (Proxy)

data Delayed (env :: Type) (c :: Type)
data Handler (a :: Type)
data Router (a :: Type)

-- class decl, then type decl

class HasServer api where
  type ServerT api (m :: Type -> Type) :: Type

  route ::
       Proxy api
    -> Delayed env (Server api)
    -> Router env

  hoistServerWithContext
      :: Proxy api
      -> (forall x. m x -> n x)
      -> ServerT api m
      -> ServerT api n

type Server aqi = ServerT aqi Handler