-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #260 from zkFold/TurtlePU/drop-bs-orphans
Drop bs-aeson-orphans; use our combinators
- Loading branch information
Showing
7 changed files
with
45 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
module ZkFold.Base.Protocol.Plonkup.LookupConstraint where | ||
|
||
import Data.Binary (Binary, encode) | ||
import Data.ByteString (ByteString, toStrict) | ||
import Data.Binary (Binary) | ||
import Data.ByteString (ByteString) | ||
import Prelude hiding (Num (..), drop, length, sum, take, (!!), | ||
(/), (^)) | ||
import Test.QuickCheck (Arbitrary (..)) | ||
|
||
import ZkFold.Base.Data.ByteString (toByteString) | ||
import ZkFold.Base.Data.Vector (Vector) | ||
import ZkFold.Symbolic.Compiler.ArithmeticCircuit.Internal | ||
|
||
newtype LookupConstraint i a = LookupConstraint { lkVar :: Var (Vector i) } | ||
deriving (Show, Eq) | ||
|
||
instance (Arbitrary a, Binary a) => Arbitrary (LookupConstraint i a) where | ||
arbitrary = LookupConstraint . NewVar . toStrict . encode @a <$> arbitrary | ||
arbitrary = LookupConstraint . NewVar . toByteString @a <$> arbitrary | ||
|
||
toLookupConstraint :: forall a i . ByteString -> LookupConstraint i a | ||
toLookupConstraint = LookupConstraint . NewVar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters