hoon-mold-and-type-system

A mold is a data type in hoon.

Raw values may be type-cast to a mold, and molds can also be called as functions to coerce a value to its type (“molding”, “clamming”).

Three kinds of types:

  • Atoms: values with auras.
  • Molds: structures. Think of cells, lists, and sets.
  • Marks: file types. Compare to conventional files distinguished by extension and definite internal structure.

Molds are actually gates. They operate on a value and coerce it into a certain structure. it’s a function from noun to noun.

!> zapgar will tell you what mold the compiler thinks is being used:

> !>(0xace2.bead)
[#t/@ux q=2.900.541.101]