forked from haskell/haskell-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathT24.hs.expected
32 lines (30 loc) · 2.83 KB
/
T24.hs.expected
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
32
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module T24 where
import GHC.TypeNats (type (-))
data Proxy a = Stop | Next (Proxy a)
type family LongP n a where
LongP 0 a = a
LongP n a = Next (LongP (n - 1) a)
-- >>> :kind! ((LongP 10 Stop) :: Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy Double)))))))))))))
-- ((LongP 10 Stop) :: Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy Double))))))))))))) :: Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- (Proxy
-- Double))))))))))))
-- = 'Next
-- ('Next
-- ('Next
-- ('Next ('Next ('Next ('Next ('Next ('Next ('Next 'Stop)))))))))