[Haskell-cafe] How to Create Data Type of memory
akshay.v.dave at hotmail.com
Mon Sep 7 02:41:58 EDT 2009
Thanks for your prompt response. I'll try to implement the same for my semantics!
> Date: Mon, 7 Sep 2009 00:12:14 -0600
> Subject: Re: [Haskell-cafe] How to Create Data Type of memory
> From: lrpalmer at gmail.com
> To: akshay.v.dave at hotmail.com
> CC: haskell-cafe at haskell.org
> On Sun, Sep 6, 2009 at 11:45 PM, Akshay Dave<akshay.v.dave at hotmail.com> wrote:
> > Hi,
> > Thanks for your prompt reply. Actually I am trying to convert the
> > following transitive semantics to Haskell:
> > (Memory maps I to Z)
> > lookup m i = <current value of i> ( meaning lookup for I in memory m)
> > evB b m = true/(while b do c od;m) -> (c; while b do c od;m)
> > I have written the boolean expression and statement part but I am not able
> > to write the memory representation in Haskell.
> Ah, if you're trying to implement a semantics (emphasis on
> understandability and correctness), I suggest Data.Map.
> import qualified Data.Map as Map
> Map.lookup 2 (Map.insert 1 "x" (Map.insert 2 "y" Map.empty)) -- "y"
Hotmail® is up to 70% faster. Now good news travels really fast.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe