-
-
Save maoe/3181377 to your computer and use it in GitHub Desktop.
てすと
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE RankNTypes #-} | |
module Test where | |
data X = X String | |
deriving Show | |
type Y = Int | |
class Z a where | |
zed :: a | |
instance Z X where | |
zed = X "zed" | |
instance Z Y where | |
zed = 0 | |
data D = D { x :: X | |
, y :: Y | |
, z :: forall a. (Show a, Z a) => a | |
} | |
{- | |
*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> :t D (X "Hello") 123 zed | |
D (X "Hello") 123 zed :: D | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment