Permalink
Browse files

TFP updates

  • Loading branch information...
1 parent 5d2d6a7 commit 8b113af1f5b0b1afe53ff27afe2e71fedff5a654 Edwin Brady committed May 25, 2011
View
@@ -34,6 +34,8 @@ Raw data types. Int, Char, Bool are unboxed.
> | TyData -- generic data type
> | TyCType String -- Exported, C typedef
> | TyFun -- any function
+> | TyLin Type -- guarantee at most one instance
+> | TyEval Type -- guarantee evaluated
> deriving Eq
> instance Show Type where
@@ -50,6 +52,8 @@ Raw data types. Int, Char, Bool are unboxed.
> show TyData = "Data"
> show (TyCType s) = "CType " ++ s
> show TyFun = "Fun"
+> show (TyLin s) = "Linear(" ++ show s ++ ")"
+> show (TyEval s) = "Eval(" ++ show s ++ ")"
> data Const = MkInt Int
> | MkBigInt Integer
View
@@ -64,6 +64,8 @@
> | TokenAnyType
> | TokenDataType
> | TokenTyCType
+> | TokenTyLinear
+> | TokenTyEval
> | TokenFunType
> | TokenForeign
> | TokenCInclude
@@ -248,6 +250,8 @@
> ("Unit",rest) -> cont TokenUnitType rest
> ("Data",rest) -> cont TokenDataType rest
> ("CType",rest) -> cont TokenTyCType rest
+> ("Linear",rest) -> cont TokenTyLinear rest
+> ("Eval",rest) -> cont TokenTyEval rest
> ("Fun",rest) -> cont TokenFunType rest
> ("Any",rest) -> cont TokenAnyType rest
> -- values
View
@@ -41,6 +41,8 @@ import Epic.Lexer
funtype { TokenFunType }
datatype { TokenDataType }
tyctype { TokenTyCType }
+ tylinear { TokenTyLinear }
+ tyeval { TokenTyEval }
anytype { TokenAnyType }
unit { TokenUnit }
con { TokenCon }
@@ -147,6 +149,8 @@ Type : inttype { TyInt }
| anytype { TyAny }
| datatype { TyData }
| tyctype string { TyCType $2 }
+ | tylinear '(' Type ')' { TyLin $3 }
+ | tyeval '(' Type ')' { TyEval $3 }
| funtype { TyFun }
Declaration :: { Decl }
@@ -3,7 +3,7 @@ PAPER = epic
all: ${PAPER}.pdf
TEXFILES = ${PAPER}.tex intro.tex language.tex example.tex \
- implementation.tex performance.tex conclusions.tex
+ implementation.tex performance.tex conclusions.tex bigexample.tex
DIAGS =
Oops, something went wrong.

0 comments on commit 8b113af

Please sign in to comment.