-
Notifications
You must be signed in to change notification settings - Fork 32
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
remove Typeable constraint on Predicate #101
Comments
Why was it introduced? |
Alternatively, do you mean to clear up the placement of |
See how my refined rewrite rerefined resolves this: class Predicate p where
-- | The predicate name, as a 'Show'-like (for nice bracketing).
predicateName :: Proxy# p -> Int -> ShowS
-- | Fill out predicate metadata using its 'Typeable' instance.
--
-- Do not use this for combinator predicates. Doing so will incur
-- insidious 'Typeable' contexts for the wrapped predicate(s).
instance Typeable a => Predicate (Typeably a) where
predicateName _ d = showsPrec d (typeRep (Proxy @a))
class Predicate p => Refine p a where
validate :: Proxy# p -> a -> Maybe (RefineFailure String)
-- ...
-- simplified
instance (Predicate l, Predicate r)
=> Predicate (And l r) where
predicateName _ d = showParen (d > 10) $
showString "And "
. predicateName (proxy# @l) 11 . showChar ' '
. predicateName (proxy# @r) 11 This way, we can continue to use |
Ping @chessai @nikita-volkov . I'd still be keen on solving this one way or another.
|
This is solved now by @raehik's work :) |
No description provided.
The text was updated successfully, but these errors were encountered: