summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/update-existential.hs
blob: e216d1da014bba3f9b3240d80ca3395f095af44e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{-# LANGUAGE
            NoImplicitPrelude
           , ExistentialQuantification
  #-}

module Test where

hGetContents handle_ = handle_{ haType=SemiClosedHandle}

data HandleType = SemiClosedHandle

class Show a where
  show :: a -> a

-- they have to check whether the handle has indeed been closed.
data Handle__
  = forall dev . (Show dev) =>
    Handle__ {
      haDevice      :: !dev,
      haType        :: HandleType           -- type (read/write/append etc.)
}