
By the way, more advanced stuff of this kind is called "Tying the
knot"; you can do doubly linked lists with it and much more.
http://www.haskell.org/haskellwiki/Tying_the_Knot
2009/1/29 Belka
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.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
-- Евгений Кирпичев Разработчик Яндекс.Маркета