Skip to content
The Flix Programming Language
Branch: master
Clone or download
magnus-madsen Improved toString of ConstraintSystem. (#785)
* Improved toString of ConstraintSystem.

* Added sorting of facts.
Latest commit e80335c Mar 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Bump version number. Feb 26, 2019
examples Refined record samples. Feb 27, 2019
lib Replace RpcServer with WebSockets (#766) Jan 22, 2019
main Improved toString of ConstraintSystem. (#785) Mar 23, 2019
.gitignore Remove Various Obsolete Code (#641) Jun 7, 2018
.travis.yml Issue 705 solve (#706) Nov 29, 2018
AUTHORS.md Add JVM Support for Extensible Records (#763) Feb 20, 2019
LICENSE.md
README.md
build.xml

README.md

The Flix Programming Language

Flix is a statically typed functional- and logic programming language inspired by Scala, OCaml, F#, Haskell, and Datalog. The syntax of Flix resembles Scala and Datalog. The type system supports local type inference and is based on Hindley-Milner. Flix runs on the Java Virtual Machine and compiles directly to JVM bytecode.

See the official Flix website for more information about Flix.

Build Status Gitter

Example

///
/// The expressions of the lambda calculus are: variables, lambda abstractions, and applications.
///
enum Expression {
    // A variable expression. A variable is represented by an integer.
    case Var(Int),

    // A lambda abstraction expression. A variable is represented by an integer.
    case Abs(Int, Expression),

    // A function application expression.
    case App(Expression, Expression)
}

///
/// Performs alpha conversion by introducing fresh variables for all variables in the given expression `e0`.
///
def alpha(e0: Expression, m: Map[Int, Int]): Expression = match e0 with {
    case Var(x) =>
        // Check if we need to rename the variable.
        match Map.get(x, m) with {
            case None    => Var(x)
            case Some(y) => Var(y)
        }
    case Abs(x, e) =>
        // Generate a fresh variable name for `x`.
        let y = freshVar();
        Abs(y, alpha(e, Map.insert(x, y, m)))

    case App(e1, e2) =>
        // Recursively perform alpha conversion on each expression.
        App(alpha(e1, m), alpha(e2, m))
}

License

Flix is available under the Apache 2.0 license.

Sponsors

We kindly thank EJ Technologies for providing us with JProfiler and JetBrains for providing us with IntelliJ IDEA.

You can’t perform that action at this time.