[Haskell-beginners] Urgent: Defining Momory data Types in Haskell
Peter Verswyvelen
bugfact at gmail.com
Mon Sep 7 02:28:51 EDT 2009
I don't think you provided enough information to give a full answer,
at least not to me.
Briefly, if you want to use pointers as in C, then use IORef or STRef
and the IO resp ST monad.
If you refer to the ability to define recursive structures in C using
pointers like
struct IntNode
{
int value;
IntNode* next;
}
then you can just use Haskell's algebraic data types (ADTs), like
data IntNode = IntNodeTag Int IntNode
Of course this particular example is just a list of integers in
Haskell, and on lists you have a multitude of premade functions to
manipulate them.
But I guess this is not the answer you've been looking for? More about
this can be found in any standard Haskell text book or the wikis
On Mon, Sep 7, 2009 at 7:28 AM, Akshay Dave<akshay.v.dave at hotmail.com> wrote:
> Hi All,
> I am stuck in converting the transition semantics in Haskell. Please let
> me know how to define memory data types in Haskell( like we define pointer
> in C). Prompt help would be greatly appreciated.
>
> Sincerely,
> Akshay
> ________________________________
> With Windows Live, you can organize, edit, and share your photos. Click
> here.
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
More information about the Beginners
mailing list