-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QuickCheck test failures #441
Comments
This is caused by an improved We also cannot use
Another fun case is instance (Arbitrary obj, Arbitrary a, Arbitrary (f a), CoArbitrary (f a))·
=> Arbitrary (SharedObj obj f a) where
shrink = genericShrink
arbitrary = oneof
[ Translate <$> arbitrary <*> decayArbitrary 2
, Scale <$> arbitrary <*> decayArbitrary 2
....
] to instance (Arbitrary obj, Arbitrary a, Arbitrary (f a), CoArbitrary (f a)
, Object (SharedObj obj f a) f a
)
=> Arbitrary (SharedObj obj f a) where
shrink = genericShrink
arbitrary = oneof
[ translate <$> arbitrary <*> decayArbitrary 2
scale <$> arbitrary <*> decayArbitrary 2
...
] by making a data SharedObj obj f a
= Empty -- ^ The empty object
...
| SharedNest (SharedObj obj f a)
deriving (Generic, Show) and a nasty instance instance Object obj f a => Object (SharedObj obj f a) f a where
_Shared :: Prism' (SharedObj obj f a) (SharedObj (SharedObj obj f a) f a)
_Shared = prism' embed project
where embed :: SharedObj (SharedObj obj f a) f a
-> SharedObj obj f a
embed x = unsafeCoerce @(SharedObj (SharedObj obj f a) f a) @(SharedObj obj f a) (SharedNest x)
project = \case
SharedNest y -> Just $
unsafeCoerce @(SharedObj obj f a) @(SharedObj (SharedObj obj f a) f a) y
_ -> Nothing
--_Shared = prism' SharedNest (\case
-- SharedNest y -> Just y
-- _ -> Nothing
-- )
getBox x = getBox (Shared x)
getImplicit' ctx x = getImplicit' ctx (Shared x) While this works, it doesn't solve the actual problem which is described above using Another fun discovery was that stuff that is failing in QC testsuite works when copied into repl because of custom Finally, the immediate solution seems to be adding the zero-guard-clauses directly to |
Related to Haskell-Things#441 This will get factored out into canonicalization pass
Related to Haskell-Things#441 This will get factored out into canonicalization pass
Related to Haskell-Things#441 This will get factored out into canonicalization pass
looks like we've fixed this. |
found on Hydra. Seems mostly related to
(full|empty)Space
and
The text was updated successfully, but these errors were encountered: