@hackage / exference

Tool to search/generate (haskell) expressions with a given type

Latest1.6.0.0

About

Metadata

  • Last updated , by lspitzner
  • License BSD-3-Clause
  • Maintained by: Lennart Spitzner <hexagoxel@hexagoxel.de>

  • Lottery factor: 0

Links

Installation

Package Flags

Use the -f option with cabal commands to enable flags

    build-executables (on by default)

    build the executables, not just the library

    linknodes (off by default)

    nodes keep a reference to the precessor node, allowing returning the path thad lead to a solution.

    buildsearchtree (off by default)

    use dirty hacks to create the search tree that can be observed afterwards. needs link-nodes flag.

    exference-dev (off by default)

Readme

Type inference takes an expression and tells you its type. This process can be inversed: We recursively create random expression trees while checking that they -so far- match a given input type. At each step we do the backwards step of the inference algorithm step. If you are lucky, this search yields one or more expressions.

Djinn is a similar tool that guarantees to always terminate. But the cost of that property is that Djinn does not properly handle polymorphic queries - and those are the interesting ones, really :)

Exference supports type classes, handles undeclared types well (Foo -> Foo yields id for unknown Foo), does _not_ check kinds, can pattern-match on newtypes, supports RankNTypes.

Exference reads an environment of function types, data types, type classes and instances. The user can add to this environment, but keep in mind that each addition enlarges the search space.