Epigram uses a two-dimensional, natural deduction style syntax, with versions in LaTeX and ASCII. Here are some examples from The Epigram Tutorial:
The following declaration defines the natural numbers:
The declaration says that Nat is a type with kind * (i.e., it is a simple type) and two constructors: zero and suc. The constructor suc takes a single Nat argument and returns a Nat. This is equivalent to the Haskell declaration "data Nat = Zero | Suc Nat".
In LaTeX, the code is displayed as:
The horizontal-line notation can be read as "assuming (what is on the top) is true, we can infer that (what is on the bottom) is true." For example, "assuming n is of type Nat, then suc n is of type Nat." If nothing is on the top, then the bottom statement is always true: "zero is of type Nat (in all cases)."
...And in ASCII:
Epigram is essentially a typed lambda calculus with generalized algebraic data type extensions, except for two extensions. First, types are first-class entities, of type ⋆ {\displaystyle \star } ; types are arbitrary expressions of type ⋆ {\displaystyle \star } , and type equivalence is defined in terms of the types' normal forms. Second, it has a dependent function type; instead of P → Q {\displaystyle P\rightarrow Q} , ∀ x : P ⇒ Q {\displaystyle \forall x:P\Rightarrow Q} , where x {\displaystyle x} is bound in Q {\displaystyle Q} to the value that the function's argument (of type P {\displaystyle P} ) eventually takes.
Full dependent types, as implemented in Epigram, are a powerful abstraction. (Unlike in Dependent ML, the value(s) depended upon may be of any valid type.) A sample of the new formal specification capabilities dependent types bring may be found in The Epigram Tutorial.