1 {-# OPTIONS_GHC -XModalTypes -XScopedTypeVariables -ddump-types -XNoMonoPatBinds #-}
4 import IsomorphismForCodeTypes
5 import Prelude hiding ( id, (.) )
8 class GuestLanguageHeap c where
9 alloc :: <[ (Integer,Integer) -> Integer ]>@c
10 lookup :: <[ Integer -> (Integer,Integer) ]>@c
13 -- Here's nice example of Sheard's observation that it's often easier
14 -- to write two-stage programs by applying "back" to some function rather than
15 -- writing the final result directly
17 onetwocycle = back onetwocycle'
19 onetwocycle' xy = <[ let (x,y) = ~~xy
20 in let x' = ~~alloc (1,x)
21 in let y' = ~~alloc (2,y)