packages feed

ghc-exactprint-0.5.0.0: tests/examples/ghc8/update-existential.hs

{-# 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.)
}