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

ZkFold.Symbolic.Data.Maybe

Documentation

data Maybe context x Source #

Instances

Instances details
Foldable (Maybe context) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

Methods

fold :: Monoid m => Maybe context m -> m #

foldMap :: Monoid m => (a -> m) -> Maybe context a -> m #

foldMap' :: Monoid m => (a -> m) -> Maybe context a -> m #

foldr :: (a -> b -> b) -> b -> Maybe context a -> b #

foldr' :: (a -> b -> b) -> b -> Maybe context a -> b #

foldl :: (b -> a -> b) -> b -> Maybe context a -> b #

foldl' :: (b -> a -> b) -> b -> Maybe context a -> b #

foldr1 :: (a -> a -> a) -> Maybe context a -> a #

foldl1 :: (a -> a -> a) -> Maybe context a -> a #

toList :: Maybe context a -> [a] #

null :: Maybe context a -> Bool #

length :: Maybe context a -> Int #

elem :: Eq a => a -> Maybe context a -> Bool #

maximum :: Ord a => Maybe context a -> a #

minimum :: Ord a => Maybe context a -> a #

sum :: Num a => Maybe context a -> a #

product :: Num a => Maybe context a -> a #

Traversable (Maybe context) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

Methods

traverse :: Applicative f => (a -> f b) -> Maybe context a -> f (Maybe context b) #

sequenceA :: Applicative f => Maybe context (f a) -> f (Maybe context a) #

mapM :: Monad m => (a -> m b) -> Maybe context a -> m (Maybe context b) #

sequence :: Monad m => Maybe context (m a) -> m (Maybe context a) #

Functor (Maybe context) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

Methods

fmap :: (a -> b) -> Maybe context a -> Maybe context b #

(<$) :: a -> Maybe context b -> Maybe context a #

(SymbolicOutput x, Context x ~ c, Conditional (Bool c) x) => Conditional (Bool c) (Maybe c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

Methods

bool :: Maybe c x -> Maybe c x -> Bool c -> Maybe c x Source #

(SymbolicOutput x, Context x ~ c, Eq (Bool c) x) => Eq (Bool c) (Maybe c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

Methods

(==) :: Maybe c x -> Maybe c x -> Bool c Source #

(/=) :: Maybe c x -> Maybe c x -> Bool c Source #

Generic (Maybe context x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

Associated Types

type Rep (Maybe context x) :: Type -> Type #

Methods

from :: Maybe context x -> Rep (Maybe context x) x0 #

to :: Rep (Maybe context x) x0 -> Maybe context x #

(Eq (context Par1), Eq x) => Eq (Maybe context x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

Methods

(==) :: Maybe context x -> Maybe context x -> Bool #

(/=) :: Maybe context x -> Maybe context x -> Bool #

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

Defined in ZkFold.Symbolic.Data.Maybe

Associated Types

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

type Support (Maybe c x) Source #

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

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

Methods

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

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

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

type Rep (Maybe context x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

type Rep (Maybe context x) = D1 ('MetaData "Maybe" "ZkFold.Symbolic.Data.Maybe" "symbolic-base-0.1.0.0-inplace" 'False) (C1 ('MetaCons "Maybe" 'PrefixI 'True) (S1 ('MetaSel ('Just "isJust") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Bool context)) :*: S1 ('MetaSel ('Just "fromJust") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 x)))
type Context (Maybe c x) Source # 
Instance details

Defined in ZkFold.Symbolic.Data.Maybe

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

Defined in ZkFold.Symbolic.Data.Maybe

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

Defined in ZkFold.Symbolic.Data.Maybe

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

Defined in ZkFold.Symbolic.Data.Maybe

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

maybe :: forall a b c. Conditional (Bool c) b => b -> (a -> b) -> Maybe c a -> b Source #

just :: Symbolic c => x -> Maybe c x Source #

nothing :: forall x c. (SymbolicData x, Context x ~ c) => Maybe c x Source #

fromMaybe :: forall c x. Conditional (Bool c) x => x -> Maybe c x -> x Source #

fromJust :: Maybe context x -> x Source #

isNothing :: Symbolic c => Maybe c x -> Bool c Source #

isJust :: Maybe context x -> Bool context Source #

find :: forall a c t. (SymbolicOutput a, Context a ~ c, Foldable t, Conditional (Bool c) a) => (a -> Bool c) -> t a -> Maybe c a Source #