aboutsummaryrefslogtreecommitdiff
path: root/html-test/src/TypeFamilies3.hs
blob: 80279e365876fc649e66aac34954e80a142fd17c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE Haskell2010 #-}
{-# 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