[Haskell-cafe] Mutual recursive data types

rodrigo.bonifacio rodrigo.bonifacio at uol.com.br
Tue Apr 29 10:54:07 EDT 2008


Hi all, 

I have the following data types: 

type Id = String
type Action = String
type State = String
type Response = String

data Scenario = Scenario Description [Step]
data Step = Step Id Scenario Action State Response 

So, there is a mutual recursion between Scenario and Step. Now, consider the following function: 

xmlScenario2Scenario :: XmlScenario -> Scenario
xmlScenario2Scenario (XmlScenario description steps) = 
 Scenario  description [xmlStep2Step x | x <-steps]

How can I send "scenario" as an argument for xmlStep2Step?

I've tried let and where but I get in a loop.

Thanks a lot,

Rodrigo.



-----------------------------------
Rodrigo Bonifácio de Almeida
Universidade Católica de Brasília
 - Grupo de Engenharia de Software
 - JavaComBr (www.ucb.br/java)



More information about the Haskell-Cafe mailing list