advancedtelematic / quickcheck-state-machine

Test monadic programs using state machine based models
Other
203 stars 25 forks source link

Add Show1 constraint to transition. #186

Closed stevana closed 6 years ago

Lysxia commented 6 years ago

Why is it necessary?

stevana commented 6 years ago

I have a model that uses Fun from Test.StateMachine.Z, and in the transition function I'd like to use:

(!) :: (Eq a, Show a, Show b) => Fun a b -> a -> b
f ! x = maybe (error msg) Prelude.id (lookup x f)
  where
  msg = "!: failed to lookup `" ++ show x ++ "' in `" ++ show f ++ "'"

So that I can see why the function application failed.