I want to judge if a state matches a certain value.
The getState "i" command will write Just 2.0f to the console. However, when (getState "i") == (Just $ VF 2) is executed, the output is as follows.
• Couldn't match expected type ‘IO (Maybe Value)’
with actual type ‘Maybe Value’
• In the second argument of ‘(==)’, namely ‘(Just $ VF 2)’
In the expression: (getState "i") == (Just $ VF 2)
In an equation for ‘it’: it = (getState "i") == (Just $ VF 2)
How to get state values as type ‘Maybe Value’ instead of ‘IO (Maybe Value)’?
Or, just as the ‘when function’ can apply an effect to the number of cycles for a given condition, it would be great if a similar function could be defined for state values.