definition module Snug.Compile

from Data.Map import :: Map

from MIPS.MIPS32 import :: Line
from Snug.Syntax import :: ConstructorDef, :: ConstructorIdent, :: Definition,
	:: SymbolIdent, :: Type

:: Namespace :== String

:: Namespaced id =
	{ ns :: !Namespace
	, id :: !id
	}

:: Globals =
	{ constructors :: !Map (Namespaced ConstructorIdent) ConstructorDef
	, functions    :: !Map (Namespaced SymbolIdent) FunctionInfo
	}

:: FunctionInfo =
	{ arity :: !Int
	, type :: !Type
	}

compile :: !Namespace ![Definition] -> [Line]

compileDefinition :: !Namespace !Globals !Definition -> [Line]