Open RyanGlScott opened 7 years ago
Aargh -- I know what this is. It may shock you that in your case, adding:
{-@ LIQUID "--automatic-instances=liquidinstances" @-}
to the Bug.hs
works. In fact, just
{-@ LIQUID "--higherorder" @-}
{-@ LIQUID "--totality" @-}
{-@ LIQUID "--exactdc" @-}
{-@ LIQUID "--automatic-instances=liquidinstances" @-}
module Bug where
import Compose
import Language.Haskell.Liquid.ProofCombinators
data U1 p = U1
{-@ axiomatize fmapU1 @-}
fmapU1 :: (p -> q) -> U1 p -> U1 q
fmapU1 _ _ = U1
{-@ fmapU1Compose :: f:(q -> r)
-> g:(p -> q)
-> x:U1 p
-> { fmapU1 (compose f g) x == compose (fmapU1 f) (fmapU1 g) x }
@-}
fmapU1Compose :: (q -> r) -> (p -> q)
-> U1 p -> Proof
fmapU1Compose f g x
= trivial
works :)
But anyways, will fix this perhaps first thing tomorrow (so your code works properly.)
LH deems this safe:
But if you try factoring out
compose
into a separate module:Then LH deems it unsafe: