@takano32 has joined the channel
@ has joined the channel
@ has joined the channel
@mwrote has joined the channel
@com01evi has joined the channel
@karky7 has joined the channel
@ has joined the channel
@ has joined the channel
@ has joined the channel
@Hiroto has joined the channel
@legokichi has joined the channel
@yoshi has joined the channel
@ has joined the channel

@ has joined the channel
またメンバーが増えた & 上に流れてしまったまま忘れてた ので再掲します。
@ has joined the channel
@H.Umehara has joined the channel
```data (Show a) => Color a = Red | Green | Blue | Rgb {r :: a, g :: a, b :: a} deriving (Show)
```

ないし
```data (Show a) => Color a where
Red :: Color
Green :: Color
Blue :: Color
Rgb :: {r ::a, g :: a, b :: a} -> Color
deriving (Show)
```

という制約はどう書いたら良いでしょうか？
```data Color a where
Red :: Color
Green :: Color
Blue :: Color
Rgb :: (Show a) => {r ::a, g :: a, b :: a} -> Color
deriving (Show)
```

でどうでしょうか？
```{-# LANGUAGE GADTs #-}
data Color a where
Red :: Color
Green :: Color
Blue :: Color
Rgb :: (Show a) => {r ::a, g :: a, b :: a} -> Color
deriving (Show)
main = print (Red :: (Color Integer))
```

とすると
```prog.hs:3:10: error:
• Expecting one more argument to ‘Color’
Expected a type, but ‘Color’ has kind ‘k0 -> *’
• In the type ‘Color’
In the definition of data constructor ‘Red’
In the data declaration for ‘Color’
|
3 |   Red :: Color
|          ^^^^^
```

となります。注釈はどうつければよいでしょうか？
おお、すみません、よく見てませんでした。

```data Color a where
Red :: Color a
Green :: Color a
Blue :: Color a
Rgb :: (Show a) => {r ::a, g :: a, b :: a} -> Color a
deriving (Show)
main = print (Red :: (Color Integer))
```

ではないかと。
```prog.hs:7:13: error:
• Can't make a derived instance of ‘Show (Color a)’:
Constructor ‘Rgb’ has constraints in its type
Possible fix: use a standalone deriving declaration instead
• In the data declaration for ‘Color’
|
7 |   deriving (Show)
|
```

となるので

```{-# LANGUAGE GADTs #-}
data (Show a) => Color a where
Red :: Color a
Green :: Color a
Blue :: Color a
Rgb :: {r ::a, g :: a, b :: a} -> Color a
deriving (Show)
main = print (Red :: (Color Integer))
```

```{-# LANGUAGE GADTs #-}
data Color a where
Red :: (Show a) => Color a
Green :: (Show a) => Color a
Blue :: (Show a) => Color a
Rgb :: (Show a) => {r ::a, g :: a, b :: a} -> Color a
deriving (Show)
main = print (Red :: (Color Integer))
```

```prog.hs:7:13: error:
• Can't make a derived instance of ‘Show (Color a)’:
Constructor ‘Red’ has constraints in its type
Constructor ‘Green’ has constraints in its type
Constructor ‘Blue’ has constraints in its type
Constructor ‘Rgb’ has constraints in its type
Possible fix: use a standalone deriving declaration instead
• In the data declaration for ‘Color’
|
7 |   deriving (Show)
|             ^^^^
```

のようになり、導出できないようです

ちなみに、それなんで必要なんですか？
ふと
```data Color a = Red | Green | Blue | Rgb {r :: a, g :: a, b :: a}　deriving (Show)
```

```{-# LANGUAGE GADTs, StandaloneDeriving #-}

data Color a where
Red :: (Show a) => Color a
Green :: (Show a) => Color a
Blue :: (Show a) => Color a
Rgb :: (Show a) => {r ::a, g :: a, b :: a} -> Color a

deriving instance Show (Color a)

main = print (Red :: (Color Integer))
```
@krdlab has joined the channel
@karako has joined the channel
@ has joined the channel
@ has joined the channel
@oganao has joined the channel
@ has joined the channel
@Tomohiro has joined the channel
random で以前から話していた件が実現しました。 github-trends でGitHubのトレンドをslackで購読することが出来るようになりました。
@jabara has joined the channel