summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T13025.hs
blob: 01facb8601c0402ba85174fc1ac4904a7dfb69b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE DataKinds #-}
module T13025 where
import T13025a

type MyRec = Rec '[ '("A",Int), '("B",Int), '("C",Int) ]

getC :: MyRec -> Int
getC = getField (Proxy::Proxy '("C",Int))

doubleC :: MyRec -> MyRec
doubleC r = setC (2 * (getC r)) r
  where setC = set . (Field :: Int -> Field '("C",Int))

main :: IO ()
main = print (getC (Field 1 :& Field 2 :& Field 3 :& Nil :: MyRec))