package catala
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Compiler and library for the literate programming language for tax code specification
Install
dune-project
Dependency
Authors
Maintainers
Sources
1.3.0.tar.gz
md5=59d0dd01df52c38a4d793b594f067d14
sha512=944b755f8b47cb14920994f03f022cc3ba6cdf5def1ae8ffda00a196fa97dcc5b57baf642a03068b79e949df2a98d5f0218e3358e549be1ff0f1cddda1e5f848
doc/catala.shared_ast/Shared_ast/BoundList/index.html
Module Shared_ast.BoundListSource
Bound lists are non-empty linked lists where each element is a binder onto the next. They are useful for ordered program definitions, like nested let-ins.
let a = e1 in e2 is thus represented as Cons (e1, {a. Last e2}).
The following provides a few utility functions for their traversal and manipulation. In particular, map functions take care of unbinding, then properly rebinding the variables.
Source
val cons :
'e Var.t ->
'elt Bindlib.box ->
('e, 'elt, 'last) t Bindlib.box ->
('e, 'elt, 'last) t Bindlib.boxSource
val to_seq :
(((_, _, _) Shared_ast__.Definitions.base_gexpr,
_ Shared_ast__.Definitions.mark)
Catala_utils.Mark.ed as 'e,
'elt,
_)
t ->
('e Var.t * 'elt) Seq.tNote that the boundlist terminator is ignored in the resulting sequence
Source
val of_list :
('e Var.t * 'elt Bindlib.box) list ->
last:'last Bindlib.box ->
('e, 'elt, 'last) t Bindlib.boxSource
val fold_lr :
top:'dacc ->
down:('e Var.t -> 'elt -> 'dacc -> 'dacc) ->
bottom:('last -> 'dacc -> 'uacc) ->
up:('e Var.t -> 'elt -> 'uacc -> 'uacc) ->
('e, 'elt, 'last) t ->
'uaccBi-directional fold: down accumulates downwards, starting from top; upon reaching last, bottom is called; then up accumulates on the way back up
Source
val map :
f:('e1 Var.t -> 'elt1 -> 'e2 Var.t * 'elt2 Bindlib.box) ->
last:('last1 -> 'last2 Bindlib.box) ->
('e1, 'elt1, 'last1) t ->
('e2, 'elt2, 'last2) t Bindlib.boxSource
val map_last :
f:('e1 Var.t -> 'elt1 -> 'e2 Var.t * 'elt2 Bindlib.box) ->
last:('last1 -> ('e2, 'elt2, 'last2) t Bindlib.box) ->
('e1, 'elt1, 'last1) t ->
('e2, 'elt2, 'last2) t Bindlib.boxA more expressive version of map that allows extending the tail (e.g. to append new elements)
Source
val fold_map :
f:('ctx -> 'e1 Var.t -> 'elt1 -> 'ctx * 'e2 Var.t * 'elt2 Bindlib.box) ->
last:('ctx -> 'last1 -> 'ret * 'last2 Bindlib.box) ->
init:'ctx ->
('e1, 'elt1, 'last1) t ->
'ret * ('e2, 'elt2, 'last2) t Bindlib.box sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>