Haskell is the most powerfull and interesting "thing" I'v ever
encountered in IT world. But with an imparative background and lack of
understanding (because of any thing include that maybe I am not that
smart) has brought me problems. I know this is an old issue. But
please help it.
Question : Could anyone show me a sample of using a monad as a
statefull variable?
For example see this code in C# :
//
public class Test
{
   int var;
   static void Fun1() { var = 0; Console.Write(var); }
   static void Fun2() { var = var + 4; Console.Write(var); }
   static void Main() { Fun1(); Fun2(); var = 10; Console.Write("var
= " + var.ToString()); }
}
//
I want to see this code in haskell.
Thankyou
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to