symbolic-base-0.1.0.0: ZkFold Symbolic compiler and zero-knowledge proof protocols
Safe HaskellSafe-Inferred
LanguageHaskell2010

ZkFold.Symbolic.Data.List

Synopsis

Documentation

data ListItem x a Source #

Constructors

ListItem 

Fields

Instances

Instances details
Generic1 (ListItem x :: Type -> Type) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Associated Types

type Rep1 (ListItem x) :: k -> Type #

Methods

from1 :: forall (a :: k). ListItem x a -> Rep1 (ListItem x) a #

to1 :: forall (a :: k). Rep1 (ListItem x) a -> ListItem x a #

(Representable (Layout x), Representable (Payload x)) => Representable (ListItem x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Associated Types

type Rep (ListItem x) #

Methods

tabulate :: (Rep (ListItem x) -> a) -> ListItem x a #

index :: ListItem x a -> Rep (ListItem x) -> a #

(Functor (Layout x), Functor (Payload x)) => Functor (ListItem x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Methods

fmap :: (a -> b) -> ListItem x a -> ListItem x b #

(<$) :: a -> ListItem x b -> ListItem x a #

(Representable (Layout x), Representable (Payload x)) => Distributive (ListItem x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Methods

distribute :: Functor f => f (ListItem x a) -> ListItem x (f a) #

collect :: Functor f => (a -> ListItem x b) -> f a -> ListItem x (f b) #

distributeM :: Monad m => m (ListItem x a) -> ListItem x (m a) #

collectM :: Monad m => (a -> ListItem x b) -> m a -> ListItem x (m b) #

type Rep1 (ListItem x :: Type -> Type) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Rep1 (ListItem x :: Type -> Type) = D1 ('MetaData "ListItem" "ZkFold.Symbolic.Data.List" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "ListItem" 'PrefixI 'True) (S1 ('MetaSel ('Just "tailHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (Layout x)) :*: (S1 ('MetaSel ('Just "headLayout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (Layout x)) :*: S1 ('MetaSel ('Just "headPayload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 (Payload x)))))
type Rep (ListItem x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Rep (ListItem x) = GRep (ListItem x)

data List c x Source #

Constructors

List 

Fields

Instances

Instances details
Generic (List c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Associated Types

type Rep (List c x) :: Type -> Type #

Methods

from :: List c x -> Rep (List c x) x0 #

to :: Rep (List c x) x0 -> List c x #

(SymbolicData x, c ~ Context x) => SymbolicData (List c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Associated Types

type Context (List c x) :: (Type -> Type) -> Type Source #

type Support (List c x) Source #

type Layout (List c x) :: Type -> Type Source #

type Payload (List c x) :: Type -> Type Source #

Methods

arithmetize :: List c x -> Support (List c x) -> Context (List c x) (Layout (List c x)) Source #

payload :: List c x -> Support (List c x) -> Payload (List c x) (WitnessField (Context (List c x))) Source #

restore :: Context (List c x) ~ c0 => (Support (List c x) -> (c0 (Layout (List c x)), Payload (List c x) (WitnessField c0))) -> List c x Source #

(SymbolicInput x, c ~ Context x) => SymbolicInput (List c x) Source #

TODO: Maybe some isValid check for Lists?..

Instance details

Defined in ZkFold.Symbolic.Data.List

Methods

isValid :: List c x -> Bool (Context (List c x)) Source #

type Rep (List c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Rep (List c x) = D1 ('MetaData "List" "ZkFold.Symbolic.Data.List" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "List" 'PrefixI 'True) (S1 ('MetaSel ('Just "lHash") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (c (Layout x))) :*: (S1 ('MetaSel ('Just "lSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (c Par1)) :*: S1 ('MetaSel ('Just "lWitness") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Payloaded (Infinite :.: ListItem x) c)))))
type Context (List c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Context (List c x) = GContext (Rep (List c x))
type Layout (List c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Layout (List c x) = GLayout (Rep (List c x))
type Payload (List c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Payload (List c x) = GPayload (Rep (List c x))
type Support (List c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Support (List c x) = GSupport (Rep (List c x))

emptyList :: forall context x. SymbolicData x => Context x ~ context => List context x Source #

TODO: A proof-of-concept where hash == id. Replace id with a proper hash if we need lists to be cryptographically secure.

null :: forall context x. Symbolic context => List context x -> Bool context Source #

A list is empty if it's size is 0, in which case the first element of runInvert is one.

(.:) :: forall context x. SymbolicOutput x => Context x ~ context => x -> List context x -> List context x infixr 5 Source #

hashFun :: MonadCircuit i a w m => i -> i -> i -> m i Source #

uncons :: forall c x. SymbolicOutput x => Context x ~ c => List c x -> (x, List c x) Source #

head :: SymbolicOutput x => Context x ~ c => List c x -> x Source #

TODO: Is there really a nicer way to handle empty lists?

tail :: SymbolicOutput x => Context x ~ c => List c x -> List c x Source #

last :: List context x -> x Source #

(++) :: List context x -> List context x -> List context x Source #

filter :: (x -> Bool context) -> List context x -> List context x Source #

delete :: x -> List context x -> List context x Source #

(\\) :: List context x -> List context x -> List context x Source #

singleton :: forall context x. SymbolicOutput x => Context x ~ context => x -> List context x Source #

(!!) :: List context x -> UInt n Auto context -> x Source #

concat :: List context (List context x) -> List context x Source #