merge
[coq-hetmet.git] / examples / ImmutableHeap.hs
1 {-# OPTIONS_GHC -XModalTypes -XScopedTypeVariables -ddump-types -XNoMonoPatBinds #-}
2 module ImmutableHeap
3 where
4 import IsomorphismForCodeTypes
5 import Prelude hiding ( id, (.) )
6
7 class GuestLanguageHeap c where
8   alloc  :: <[ (Integer,Integer) ->  Integer      ]>@c
9   lookup :: <[ Integer       -> (Integer,Integer) ]>@c
10
11 onetwocycle = back onetwocycle'
12  where
13   onetwocycle' xy = <[ let (x,y) = ~~xy 
14                        in let x' = ~~alloc (1,x)
15                        in let y' = ~~alloc (2,y)
16                        in (x',y')
17                      ]>