Closed raymond-h closed 3 years ago
strengthen allows you to fabricate refinements that are incorrect:
strengthen
n = $$(refineTH @Positive 5) n' :: Refined (Positive && Even) Integer n' = strengthen n n'' :: Refined Even Integer n'' = andRight n' print n''
Output:
n :: Refined Positive Integer n' :: Refined (Positive && Even) Integer n'' :: Refined Even Integer Refined 5
Nothing is wrong with the Even predicate as it does correctly catch the error when not using strengthen.
Even
This was tested with refined-0.6.1.
refined-0.6.1
I could've sworn I fixed this already.
Fix incoming
corrected in efa5aaad04da2334f138d1ac70e342cc3a2d0975
released at https://hackage.haskell.org/package/refined-0.6.2
strengthen
allows you to fabricate refinements that are incorrect:Output:
Nothing is wrong with the
Even
predicate as it does correctly catch the error when not usingstrengthen
.This was tested with
refined-0.6.1
.