Module fungi_lang::examples [] [src]

Examples of data structures and algorithms in Fungi.

Basics

Small examples, showing the basics of the novel language features of Fungi:

  • basic_read_effects demonstrate read effects, which track which reference cells and thunks a program observes and forces, respectively.
  • basic_write_effects demonstrate write effects, which track which reference cells and thunks a program allocates.
  • basic_write_scope demonstrate write scopes, which distinctly qualify written names for different dynamic calling contexts.

Sequences

Sequences of natural numbers, represented as probabilistically-balanced binary trees (level trees):

  • seq_max finds the maximum element in a sequence.
  • seq_filter filters a sequence of elements, producing a new (smaller) sequence.

Sets

In progress

Sets of natural numbers, represented as probabilistically-balanced binary hash tries:

  • trie_join joins two sets (as tries) into a single set (as a trie).
  • trie_of_seq build a set of elements (as a hash trie) from a sequence of elements (as a level tree).

Quickhull

Computes the convex hull, in sorted order, of an unordered sequence of points in 2D space.

TODO

Modules

basic_read_effects
basic_write_effects
basic_write_scope
seq_filter

Filter a sequence of elements, producing a new (smaller) sequence

seq_max

Find the maximum element in a sequence

trie