Lists in haskell

Cale Gibbard cgibbard at
Sat Mar 25 13:11:33 EST 2006

Could you be more specific on what it is that you're having trouble
with? It's not clear what point it is that you're stuck on. What have
you tried? Surely question (a) is easy enough. (hint: a Store is just
a list) If you need general information about Haskell, you might try
one of the tutorials, like Hal Daume's "Yet Another Haskell Tutorial",
which you can get from
(Of course, you don't have to read the whole thing to understand
enough to do your assignment, just Chapter 3 ought to be enough.)

Apart from that, I'm not sure what anyone could tell you without
spoiling the assignment. I'm sure that once you get going on it, it
won't take too long.

If you have more specific questions, don't hesitate to ask -- though
the libraries mailing list is less appropriate than, say, haskell-cafe

- Cale

On 25/03/06, iliali16 <iliali16 at> wrote:
> people pls help me i have this weekend to finish my assignment on
> haskell.thats questuion1 of my assignment if somebody can help pls do so 10x
> in advance
> The aim of this assignment is to build a simulator of a programming
> language. The programming language contains variables (referred to by
> their name, given as a string), which can store an integer value:
> type Data = Integer
> type Variable = String
> The variable values are to be stored in a lookup table relating variable
> names and values, using the data synonym Store:
> type Store = [(Variable, Data)]
> (a) Define the empty Store, which contains no information about variables.
> (b) Define a function getVal, which takes a Store and a variable name,
> and returns its value. You may assume that the variable is defined
> in the Store.
> getVal :: Store -> Variable -> Data
> (c) Define a function setVar, which takes a Store, a variable name and a
> value, and returns an updated Store with the variable value updated.
> setVal :: Store -> (Variable, Data) -> Store
> --
> View this message in context:
> Sent from the Haskell - Libraries forum at
> _______________________________________________
> Libraries mailing list
> Libraries at

More information about the Libraries mailing list