module Types where

import Data.Text (Text)

type Identifier = Text
type Module = Text

data Kind
  = KStar
  | KArr Kind Kind
    deriving (Eq, Show)

data Doc = Doc Text

data Type
  = TNamed Identifier
  | TVar Identifier
  | TArr Type Type
  | TPair [Type]
  | TListOf Type
  | TApp Type [Type]
    deriving (Eq, Show)

data Decl = Decl
  { dModule :: Module
  , dName   :: Identifier
  , dKind   :: DeclKind
  } deriving (Eq, Show)

data DeclKind
  = TypeDecl Kind [Constructor]
  | ValDecl Type
    deriving (Eq, Show)

data Constructor = Constructor
  { csName :: Identifier
  , csArgs :: [Type]
  } deriving (Eq, Show)
