forked from haskell/haskell-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathT25.hs.expected
28 lines (26 loc) · 2.55 KB
/
T25.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
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
module T25 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 (Stop :: Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy (Proxy Double)))))))))))))
-- (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))))))))))))