<br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Notice that Scenario depends on a list of steps and Step has a dependence with scenario. I know that this is a kind of "bad smell".... in Haskell, are there any pattern or language idiom to deal with cyclical dependences?
</blockquote><div><br>Just a little something to add, this is not a "bad smell" at all... in fact, recursive (including mutually recursive) data types are the bread and butter of Haskell (and functional languages in general). For example:
<br><br>data BinTree a = Empty | Branch a (BinTree a) (BinTree a)<br><br>This says that a binary tree containing 'a's is either Empty, or a Branch consisting of an 'a' and two binary trees. This isn't stinky, it's quite elegant. Your Scenario and Step data types look just peachy from an idiomatic point of view; the solution (as others have pointed out) is to use data declarations rather than type synonyms.
<br><br>-Brent<br></div></div>