-
Notifications
You must be signed in to change notification settings - Fork 7
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
EC symbolic #396
EC symbolic #396
Conversation
Change the `Point` type and friends so that they may support Symbolic computation.
…base into eitan-ec-symbolic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! RebindableSyntax is such a nice touch
@@ -65,8 +64,6 @@ deriving instance Show (c Par1) => Show (Bool c) | |||
instance {-# OVERLAPPING #-} (Eq a, MultiplicativeMonoid a) => Show (Bool (Interpreter a)) where | |||
show (fromBool -> x) = if x == one then "True" else "False" | |||
|
|||
deriving newtype instance Symbolic c => SymbolicData (Bool c) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did this instance have to be moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, it might not have to have been. I had a cycle at one point but not sure if this in fact solved it or something else.
Really like the way elliptic curve API changed! So clean and polymorphic now Hope we will sort the stuff with Conditional/Eq/Ord out so that modules in |
I agree. Conceptually the |
(Though I still believe that we should have Symbolic-specific versions of Eq and Ord classes for a cleaner API for Symbolic users who are not involved in language-polymorphic stuff) |
^ I think this is best handled by re-exporting and properly documenting in friendly ways these terms and others in a |
Well, I'm only concerned about Symbolic functions which are polymorphic in datatypes. Take an example like this: find :: a -> Vector n a -> Maybe c (UInt k r c) What should the constraints look like? With language-agnostic Eq find :: (Symbolic c, SymbolicData a, Context a ~ c, Support a ~ Proxy c, Eq a, BooleanOf a ~ Bool c) => a -> Vector n a -> Maybe c (UInt k r c) With Symbolic-specific Eq class SymbolicData a => Eq a where
(==) :: a -> a -> Bool (Context a)
find :: (Eq a, Context a ~ c) => a -> Vector n a -> Maybe c (UInt k r c) P.S. We can introduce type aliases however we want, sure, but the real interface the user is going to interact with are compiler errors, and usually type aliases are not present there P.P.S. Also good point about similarity to algebraic classes, though I think algebraic classes have advantage of behaving pretty much the same as usual Haskell, and |
Change the
Point
type and friends so that they may support Symbolic computation.Resolves #400