package querty
Build not yet checked sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
A simple build system for incremental and demand-driven computations
Install
dune-project
Dependency
Authors
Maintainers
Sources
querty-0.1.0.tbz
md5=0ffa7024073872bf1bea461dea7bac80
sha512=f2a8dbf7194439fa4c0d6304247a9923db4085a1671264c8866ae41bf0e7ad39bf7db18aa75e8b41de06c1158f3a7728d3cd7c8a804fca754b7bb72d92bc010f
Description
A typesafe query based build system inspired by Salsa and Rock
Tags
incremental memoization build system query demand-driven early cutoff effects gadtAdded to opam-repository:
README
Querty
A query based build system inspired by Rock.
Example
module CalculatorQueries = struct
type (_, _) t =
| Source : (int, Querty.input) t
| Squared : (int, Querty.derrived) t
| SquaredDoubled : (int, Querty.derrived) t
let rank : type a k. (a, k) t -> int = function
| Source -> 0
| Squared -> 1
| SquaredDoubled -> 3
let compare : type a b k1 k2. (a, k1) t -> (b, k2) t -> (a, b) Querty.Order.t
=
fun x y ->
let open Querty.Order in
match (x, y) with
| Source, Source -> Eq
| Squared, Squared -> Eq
| SquaredDoubled, SquaredDoubled -> Eq
| _ -> if rank x < rank y then Lt else Gt
end
module Engine = Querty.Make (CalculatorQueries)
let rules : type a. (a, Querty.derrived) CalculatorQueries.t -> a =
fun q ->
match q with
| Squared ->
let source = Engine.read Source in
source * source
| SquaredDoubled ->
let squared = Engine.fetch Squared in
squared * 2
let run db =
let a = Engine.fetch Squared in
let b = Engine.fetch SquaredDoubled in
(a, b)
let () =
let db = Engine.init () in
Engine.set_input db Source 10;
match Engine.run db ~rules run with
| Ok (a, b) -> Printf.printf "squared: %d\nsquared & doubled: %d\n" a b
| Error (Cycle _) -> print_endline "cycle error"
| Error (MissingInput _) -> print_endline "missing input error"
Dev Dependencies (4)
-
odoc
with-doc -
alcotest
with-test -
qcheck-alcotest
with-test -
qcheck-core
with-test
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
This version of querty was published after the check.ci.ocaml.org run of against opam-repository 8d8d144, so it has no build results yet. check.ci runs about once a week.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page