gas-0.0.0.1: Limit how many steps a program may take.

Safe HaskellSafe
LanguageHaskell2010

Control.Applicative.Free.Gas

Description

Static gas consumption for free applicatives.

Synopsis

Documentation

requiredGas Source #

Arguments

:: (forall x. f x -> Word)

Given an action, its cost.

-> Ap f a

Program to compute required gas of.

-> Word 

Compute the number of steps the interpretation of a free applicative action would take. The number of steps is the cummulative result of the cost function given to requiredGas. The limit is called the gas, by typical car analogy.