
9 Aug
2007
9 Aug
'07
11:53 a.m.
rb> data Step = Step Id Scenario Action State Response rb> instance Eq Step where rb> Step id1 scenario1 action1 state1 response1 == Step id2 rb> scenario2 action2 state2 response2 = id == id rb> _ == _ = False "id == id" must be replaced with "id1 == id2". Error message you've got might be confusing, since "id" is already defined as an identity function, and functions are not Eq instances. I'd suggest something like data Step = Step {stepId :: Id, stepScen :: Scenario, steAction :: Action, stepState :: State, stepResp :: Responce} instance Eq Step where step1 == step2 = stepId step1 == stepId step2