Skip to content

Conversation

jh3141
Copy link

@jh3141 jh3141 commented Aug 22, 2016

using the Data.Data.Data typeclass, isDataConstr and isDataValue

Examples:

`import Data.Data
import Contorl.Rematch
import Control.Rematch.Data
data MyStructure = First | Second Int | Third Bool String deriving (Data)

myTests = [runMatch (isDataConstr Second) First,
runMatch (isDataConstr Second) $ Second 4,
runMatch (isDataValue Second 0 $ equalTo 10) $ Second 10,
runMatch (isDataValue Third 1 $ equalTo "Hello") $ Third False "Goodbye"]`

(with obviously the second and third matchers succeeding while the others fail)

I've isolated this pull request from my others, but this does mean some (relatively trivial) merging work would be required to accept all of them. If you decide to do so, it may be easier to directly pull my changes from my fork's master rather than merge them manually.

using the Data.Data.Data typeclass, isDataConstr and isDataValue
@jh3141
Copy link
Author

jh3141 commented Aug 22, 2016

Note - the CI build failure is apparently caused by a version conflict between rematch-quickcheck (which wants base == 4.5.*) and the selected version of ghc in the configuration for the build (7.6.3, which requires base == 4.6.0.1). I'd suggest changing rematch-quickcheck to use base >= 4.5.0.0 & < 5 the same as core. (In fact, I'll just go and add that as an issue, as it seems it's likely to effect users as well as the CI build).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant