summaryrefslogtreecommitdiff
path: root/testsuite/tests/tcplugins/Definitions.hs
blob: 5a84967c0709108f9f116269bcd6b3e856a83296 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{-# LANGUAGE Haskell2010 #-}

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE TypeFamilies #-}

module Definitions where

-- base
import Data.Kind
  ( Type, Constraint )
import Numeric.Natural
  ( Natural )

--------------------------------------------------------------------------------

-- This module defines some common types/classes that the various type-checking
-- plugins in this test-suite will be interested in manipulating.

type Nullary :: Constraint
class Nullary where { }

type MyClass :: Type -> Constraint
class MyClass a where
  methC :: a

type MyTyFam :: Type -> Type -> Type
type family MyTyFam a b where

data Nat = Zero | Succ Nat

type Add :: Nat -> Nat -> Nat
type family Add a b where
  Add   Zero     b = b
  Add ( Succ a ) b = Succ ( Add a b )