blob: bde05fb8cf7d1ff7cac7500d458485bd5b0933e8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
{-# LANGUAGE TypeFamilies #-}
module TypeFamilies3 where
-- | A closed type family
type family Foo a where
Foo () = Int
Foo _ = ()
-- | An open family
type family Bar a
type instance Bar Int = ()
type instance Bar () = Int
-- | A data family
data family Baz a
data instance Baz () = Baz1
data instance Baz Int = Baz2 Bool
newtype instance Baz Double = Baz3 Float
|