~ubuntu-branches/ubuntu/wily/agda/wily-proposed

« back to all changes in this revision

Viewing changes to src/core/Thierry/Cont.hs

  • Committer: Package Import Robot
  • Author(s): Iain Lane
  • Date: 2014-08-05 06:38:12 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20140805063812-io8e77niomivhd49
Tags: 2.4.0.2-1
* [6e140ac] Imported Upstream version 2.4.0.2
* [2049fc8] Update Build-Depends to match control
* [93dc4d4] Install the new primitives
* [e48f40f] Fix typo dev→doc

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
module Cont where
2
 
 
3
 
import Val
4
 
import Core.Abs
5
 
import Exp1
6
 
import Conv
7
 
 
8
 
 
9
 
 
10
 
type Cont = [(Ident,Val,Val)]
11
 
 
12
 
envCon :: Cont -> Env
13
 
envCon = map (\ (s,u,_) -> (s,u))
14
 
 
15
 
getVT s ((s1,u,v):rest) = if s == s1 then (u,v) else getVT s rest
16
 
getVT s [] = error ("getVT " ++ show s)  -- this should never occur after scope analysis
17
 
 
18
 
upCon :: Ident -> Val -> Val -> Cont -> Cont
19
 
upCon s u a con = (s,u,a):con
20
 
 
21
 
genCon :: Cont -> Ident -> Val -> G Val
22
 
genCon con (Ident s) = gensym (length con) s
23
 
 
24
 
evalCon :: Cont -> Exp -> Val
25
 
evalCon con = eval (envCon con)
26
 
 
27
 
evalBodyCon :: Cont -> Val -> Exp -> Val
28
 
evalBodyCon con = evalBody (envCon con)