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

ZkFold.Base.Data.HFunctor

Synopsis
  • class HFunctor c where
    • hmap :: (forall a. f a -> g a) -> c f -> c g

Documentation

class HFunctor c where Source #

A type c is a higher-order functor (HFunctor) if it provides a function hmap which, given any two types f and g of kind k -> Type lets you apply any function from (forall a. f a -> g a) to turn an c f into an c g, preserving the structure of c.

Methods

hmap :: (forall a. f a -> g a) -> c f -> c g Source #

Applies a function of type (forall a. f a -> g a) to a value of type c f, where c is a higher-order functor, to produce a value of type c g. Usual laws of functors should hold:

Identity
hmap id x == x
Composition
hmap (f . g) x == hmap f (hmap g x)

Instances

Instances details
HFunctor (Interpreter a :: (k -> Type) -> Type) Source # 
Instance details

Defined in ZkFold.Symbolic.Interpreter

Methods

hmap :: (forall (a0 :: k0). f a0 -> g a0) -> Interpreter a f -> Interpreter a g Source #

HFunctor (ArithmeticCircuit a p i :: (Type -> Type) -> Type) Source # 
Instance details

Defined in ZkFold.Symbolic.Compiler.ArithmeticCircuit.Internal

Methods

hmap :: (forall (a0 :: k). f a0 -> g a0) -> ArithmeticCircuit a p i f -> ArithmeticCircuit a p i g Source #