Created
July 26, 2012 09:16
-
-
Save cutsea110/3181160 to your computer and use it in GitHub Desktop.
:t zがダメだけど、D (X "123") 123 (1::Y)やD (X "123") 123 (X "456")ではデータ構築可能
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 #-} | |
{-# LANGUAGE ExistentialQuantification #-} | |
{-# LANGUAGE GADTs #-} | |
module Test where | |
data X = X String | |
deriving Show | |
type Y = Int | |
class Z a where | |
instance Z X | |
instance Z Y | |
data D = forall a. (Show a, Z a) => D { x :: X | |
, y :: Y | |
, z :: a | |
} | |
-- deriving Show |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment