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 l p a Source #

Constructors

ListItem 

Fields

Instances

Instances details
Generic1 (ListItem l p :: k -> Type) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Associated Types

type Rep1 (ListItem l p) :: k -> Type #

Methods

from1 :: forall (a :: k0). ListItem l p a -> Rep1 (ListItem l p) a #

to1 :: forall (a :: k0). Rep1 (ListItem l p) a -> ListItem l p a #

(Representable l, Representable p) => Representable (ListItem l p) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Associated Types

type Rep (ListItem l p) #

Methods

tabulate :: (Rep (ListItem l p) -> a) -> ListItem l p a #

index :: ListItem l p a -> Rep (ListItem l p) -> a #

(Functor l, Functor p) => Functor (ListItem l p) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Methods

fmap :: (a -> b) -> ListItem l p a -> ListItem l p b #

(<$) :: a -> ListItem l p b -> ListItem l p a #

(Representable l, Representable p) => Distributive (ListItem l p) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

Methods

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

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

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

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

type Rep1 (ListItem l p :: k -> Type) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Rep1 (ListItem l p :: k -> 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 l) :*: (S1 ('MetaSel ('Just "headLayout") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 l) :*: S1 ('MetaSel ('Just "headPayload") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 p))))
type Rep (ListItem l p) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.List

type Rep (ListItem l p) = GRep (ListItem l p)

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 (Layout x) (Payload 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 #