Re[Haskell-cafe] cursive referencing

Belka lambda-belka at yandex.ru
Thu Jan 29 02:19:20 EST 2009


Hello! 
I'm puzzled, if in Haskell it's possible to create a (pure) data structure,
consisting of 2 substructures referencing each other: 
-------------------------
data AA = AA {
        someData1 :: SomeData1
        bb :: BB
}

data BB = BB { 
        someData2 :: SomeData2
        aa :: AA
} 

f :: SomeData1 -> SomeData2 -> AA
f somedata1 somedata2 = ??????????

-- Always True:
ghci> f == aa $ bb f
True
-------------------------
Any ideas?

Belka
-- 
View this message in context: http://www.nabble.com/Recursive-referencing-tp21722002p21722002.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.



More information about the Haskell-Cafe mailing list