sebfisch / haskell-regexp

Regular Expression Matching in Haskell
http://sebfisch.github.com/haskell-regexp/
Other
34 stars 5 forks source link

Add additional Eq constraints for class instances with Num constraints #22

Closed iainlane closed 12 years ago

iainlane commented 12 years ago

Hey, thanks for closing my other issue so fast. :-)

Here's one other GHC 7.4.1 thing. After this, weighted-regexp builds fine for me (also on 7.0.4).

Starting from GHC 7.4.1, the Num class no longer has Eq (or Show) superclasses. Therefore, specifying Num as a constraing no longer implies these class constraints, so we have to add them manually where they are required.

sebfisch commented 12 years ago

Thanks!

On GHC 7.2.1 I get warnings for the SPECIALIZE pragmas:

src/Text/RegExp/Matching.hs:53:1:
    Warning: Forall'd constraint `Eq a' is not bound in RULE lhs
               fullMatch
                 @ c
                 @ c
                 @ (Numeric a)
                 (Text.RegExp.Data.$fWeightccNumeric
                    @ a @ c (GHC.Num.$p1Num @ a $dNum) $dNum)

src/Text/RegExp/Matching.hs:70:1:
    Warning: Forall'd constraint `Eq a' is not bound in RULE lhs
               partialMatch
                 @ c
                 @ c
                 @ (Numeric a)
                 (Text.RegExp.Data.$fWeightccNumeric
                    @ a @ c (GHC.Num.$p1Num @ a $dNum) $dNum)

src/Text/RegExp/Matching.hs:81:1:
    Warning: Forall'd constraint `Eq a' is not bound in RULE lhs
               matchW
                 @ (Numeric a)
                 @ c
                 (Data.Semiring.$fSemiringNumeric
                    @ a (GHC.Num.$p1Num @ a $dNum) $dNum)

I'll investigate later whether the rules still fire and push a new version to Hackage.

P.S. It seems a major version bumb is required as (textually) the type of some entities changed. Semantically, they didn't change, though..