obsidiansystems / dependent-sum-template

Template Haskell code to generate instances of classes in some package
1 stars 6 forks source link

deriveGEq fails to generate GEq instance for some combinations of versions #9

Open newhoggy opened 2 years ago

newhoggy commented 2 years ago

For the following data type, deriveGEq fails to generate a GEq instance when using dependent-sum-template-0.1.1.1 with dependent-sum-0.6.2.0.

The example code is here:

data DefaultUni a where
    DefaultUniInteger    :: DefaultUni (Esc Integer)
    DefaultUniByteString :: DefaultUni (Esc BS.ByteString)
    DefaultUniString     :: DefaultUni (Esc Text.Text)
    DefaultUniUnit       :: DefaultUni (Esc ())
    DefaultUniBool       :: DefaultUni (Esc Bool)
    DefaultUniProtoList  :: DefaultUni (Esc [])
    DefaultUniProtoPair  :: DefaultUni (Esc (,))
    DefaultUniApply      :: !(DefaultUni (Esc f)) -> !(DefaultUni (Esc a)) -> DefaultUni (Esc (f a))
    DefaultUniData       :: DefaultUni (Esc Data)

deriveGEq ''DefaultUni

Adding a lower bound dependent-sum >= 0.7.1.0 fixes the problem for us. Perhaps dependent-sum-template should add a lower bound in a new revision so that the solver picks versions that work together?

michaelpj commented 1 year ago

This is still a problem.