jtkristensen / pun-lang

The Fun programming language, extended with built-in utilities for property based testing.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The pun Programming Language,The fun Language with Properties.

tests hlint

Pun is an extension of a minimal garden variety functional programming langauge (similar to the Fun langauge from Pierce's "Types and Progamming Languages", and the REC language from Glynn Winskel's "The Formal Semantics of Programming Langauges").

The main feature is a property declaration, which has the form:

propery <name> <parameters> . <term> .

that lets the programmer specify properties to be checked by QuickCheck, only that rather than having to write a generator by hand, the pun interpreter will generate terms to substitute in for the parameters.

Example, here is a property.

property plus-is-commutative m n . m + n = n + m .

Which will check that the term m + n = n + m normalizes to true for a suitable handful of choices of m and n that make the term well-typed.

Installation

Assuming that you have the haskell build-tool stack installed. You should be able to install pun by running

> stack install

from within the repository.

Getting started.

To typecheck a a program, run:

> pun --types <program-name>.pun

and start typing in terms to evaluate.

To run the properties specified in a program, pass the flag --check like so:

> pun --check <program-name>.pun

the folder ./examples contains a number of example programs to get you started.

About

The Fun programming language, extended with built-in utilities for property based testing.

License:Other


Languages

Language:Haskell 100.0%