Skip to content

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 22:09
· 21 commits to master since this release
b8da6ca

Laws

  • law declares a claim the compiler proves for every value of its parameters, and one it cannot prove is a compile error.
  • A false law is refused with a counterexample, and one nothing settles with the goal left open, the case it is in and what was known.
  • A law cites another by calling it, and is an induction by calling itself on a part a pattern took apart; the compiler tries an induction on each vector parameter on its own.
  • A generic law is proved at every set of types the program uses what it calls at, each copy on its own.
  • A law reaches only code that ends and answers the same every time: no library call, no async, no loop but for each and a counting loop the bounds pass trusts.
  • A law inside a type is kept by every value of it: each construction and each write is proved to keep it, from what that function knows there.
  • A type's laws are known wherever a value of it is read, by function laws and by the bounds pass.
  • A decoder refuses a value that breaks its type's law as Broken, beside Mismatch for a document of the wrong shape.
  • hive indent keeps an empty line around a type's law, which touches only other laws.
  • A law for table <name> is a SQL filter every query on the table carries, read off the query's SQL: in what it reads, changes and deletes, wherever the law's if holds.
  • A row a query inserts or updates has to land inside a table law's filter, by writing one of its column = value parts.
  • table is a keyword only after a law's for, so a name spelled table still compiles.
  • law is a keyword, so a name spelled law no longer compiles.
  • axiom is reserved: any use of it is a compile error, so a later version can give it a meaning without breaking a name.

Fixes

  • An assignment never lets a write through one name reach another: rec.f = xs copies an immutable xs, as a binding does.

Breaking

was is
a variable/parameter/field named law something else
a variable/parameter/field named axiom something else
hive.json.JsonError, hive.crypto.JwtError, hive.net.QueryParamsError and hive.term.FlagError as structs unions of Mismatch and Broken, sharing path, expected and found
hive.sql.raw(connection, text) hive.sql.unsafe(connection, text), which no table law reads

To bootstrap from this release, seed/pinned.txt becomes:

tag:    v0.4.0
asset:  hivec-linux-amd64
sha256: db824fdcce0b9c16ce7dc9a37015d5019c43204b7164e7d6f75813ef1f21bb04