1module Main where
2
3import Effect.Console (log)
4import Prim.Row (class Lacks)
5import Type.Row (RProxy(..))
6
7data SProxy (a :: Symbol) = SProxy
8
9lacksX
10  :: forall r
11   . Lacks "x" r
12  => RProxy r
13  -> RProxy ()
14lacksX _ = RProxy
15
16lacksSym
17  :: forall sym (to :: Row Type)
18   . Lacks sym to
19  => SProxy sym
20  -> RProxy to
21lacksSym _ = RProxy
22
23test1 :: RProxy ()
24test1 = lacksX (RProxy :: RProxy (y :: Int, z :: String))
25
26test2 :: forall r. Lacks "x" r => RProxy r -> RProxy ()
27test2 _ = lacksX (RProxy :: RProxy (y :: Int, z :: String | r))
28
29test3 :: RProxy ()
30test3 = test2 (RProxy :: RProxy (a :: String))
31
32test4 :: forall sym. SProxy sym -> RProxy ()
33test4 = lacksSym
34
35main = log "Done"
36