
2 Aug
2009
2 Aug
'09
5:46 a.m.
Hello Michal, Sunday, August 2, 2009, 9:25:40 AM, you wrote:
data Stmt = SIf Test [Stmt] [Stmt] | ...
data Stmt = SIf Test Int Int | ...
data Stmt a = SIf Test [Stmt a] [Stmt a] | ... where a will represent type of your statement. this may be read as "IF statement with a left and right parts consisting of sequence of statements returning a, have type a" btw, you may need to use GADTs to implement more complex statement types machinery, this is rather popular example in various GADT papers, f.e. http://www.iai.uni-bonn.de/~ralf/publications/With.pdf -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com