Skip to content

Instantly share code, notes, and snippets.

@cutsea110
Created July 26, 2012 08:47
Show Gist options
  • Save cutsea110/3181052 to your computer and use it in GitHub Desktop.
Save cutsea110/3181052 to your computer and use it in GitHub Desktop.
てすと
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE RankNTypes #-}
module Test where
data X = X String
deriving Show
type Y = Int
class Z a where
instance Z X
instance Z Y
data D = D { x :: X
, y :: Y
, z :: (Show a, Z a) => a
}
deriving Show
{-
*Test> :load "/home/cutsea110/devel/haskell/metadata/Test.hs"
[1 of 1] Compiling Test ( /home/cutsea110/devel/haskell/metadata/Test.hs, interpreted )
/home/cutsea110/devel/haskell/metadata/Test.hs:18:17:
Can't make a derived instance of `Show D':
Constructor `D' must have a Haskell-98 type
Possible fix: use a standalone deriving declaration instead
In the data type declaration for `D'
Failed, modules loaded: none.
Prelude>
-}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment