File: Newtype.hs

package info (click to toggle)
haskell-syb 0.7.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 360 kB
  • sloc: haskell: 2,264; makefile: 2
file content (20 lines) | stat: -rw-r--r-- 382 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# LANGUAGE CPP                #-}
{-# LANGUAGE DeriveDataTypeable #-}

module Newtype (tests) where

-- The type of a newtype should treat the newtype as opaque

import Test.Tasty.HUnit

import Data.Generics

newtype T = MkT Int deriving( Typeable )

tests = show (typeOf (undefined :: T)) @?= output

#if __GLASGOW_HASKELL__ >= 701
output = "T"
#else
output = "Newtype.T"
#endif