----------------------------------------------------------------------
-- |
-- Module      : Values
-- Maintainer  : AR
-- Stability   : (stable)
-- Portability : (portable)
--
-- > CVS $Date: 2005/04/21 16:22:32 $
-- > CVS $Author: bringert $
-- > CVS $Revision: 1.7 $
--
-- (Description of the module)
-----------------------------------------------------------------------------

module GF.Grammar.Values (
               -- ** Values used in TC type checking
               Val(..), Env,
               -- ** Annotated tree used in editing
               Binds, Constraints, MetaSubst,
               -- ** For TC
               valAbsInt, valAbsFloat, valAbsString, vType,
               isPredefCat,
               eType,
              ) where

import GF.Infra.Ident
import GF.Grammar.Grammar
import GF.Grammar.Predef

-- values used in TC type checking

data Val = VGen Int Ident | VApp Val Val | VCn QIdent | VRecType [(Label,Val)] | VType | VClos Env Term
  deriving (Val -> Val -> Bool
(Val -> Val -> Bool) -> (Val -> Val -> Bool) -> Eq Val
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Val -> Val -> Bool
$c/= :: Val -> Val -> Bool
== :: Val -> Val -> Bool
$c== :: Val -> Val -> Bool
Eq,Int -> Val -> ShowS
[Val] -> ShowS
Val -> String
(Int -> Val -> ShowS)
-> (Val -> String) -> ([Val] -> ShowS) -> Show Val
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Val] -> ShowS
$cshowList :: [Val] -> ShowS
show :: Val -> String
$cshow :: Val -> String
showsPrec :: Int -> Val -> ShowS
$cshowsPrec :: Int -> Val -> ShowS
Show)

type Env = [(Ident,Val)]

type Binds = [(Ident,Val)]
type Constraints = [(Val,Val)]
type MetaSubst = [(MetaId,Val)]


-- for TC

valAbsInt :: Val
valAbsInt :: Val
valAbsInt = QIdent -> Val
VCn (ModuleName
cPredefAbs, Ident
cInt)

valAbsFloat :: Val
valAbsFloat :: Val
valAbsFloat = QIdent -> Val
VCn (ModuleName
cPredefAbs, Ident
cFloat)

valAbsString :: Val
valAbsString :: Val
valAbsString = QIdent -> Val
VCn (ModuleName
cPredefAbs, Ident
cString)

vType :: Val
vType :: Val
vType = Val
VType

eType :: Term
eType :: Term
eType = Ident -> Term
Sort Ident
cType