summaryrefslogtreecommitdiff
path: root/testsuite/tests/rep-poly/RepPolyRecordUpdate.hs
blob: 9ef3a0f89769d0b5740d1cefdb982d066b65e143 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
{-# LANGUAGE UnliftedNewtypes #-}

module RepPolyRecordUpdate where

import GHC.Exts

newtype X (a :: TYPE rep) = MkX { fld :: a }

class C rep (a :: TYPE rep) where
  meth :: () -> a

upd :: C rep a => X b -> X a
upd x = x { fld = meth () }