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

[ bsd3, language, library ] [ Propose Tags ]

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.

Modules

  • Flags_exference
  • Language
    • Haskell
      • Language.Haskell.Exference
        • Language.Haskell.Exference.BindingsFromHaskellSrc
        • Language.Haskell.Exference.ClassEnvFromHaskellSrc
        • Language.Haskell.Exference.Core
          • Language.Haskell.Exference.Core.ExferenceStats
          • Language.Haskell.Exference.Core.Expression
          • Language.Haskell.Exference.Core.ExpressionSimplify
          • Language.Haskell.Exference.Core.FunctionBinding
          • Language.Haskell.Exference.Core.SearchTree
          • Language.Haskell.Exference.Core.TypeUtils
          • Language.Haskell.Exference.Core.Types
        • Language.Haskell.Exference.EnvironmentParser
        • Language.Haskell.Exference.ExpressionToHaskellSrc
        • Language.Haskell.Exference.FunctionDecl
        • Language.Haskell.Exference.SimpleDict
        • Language.Haskell.Exference.TypeDeclsFromHaskellSrc
        • Language.Haskell.Exference.TypeFromHaskellSrc
  • Paths_exference

Flags

Manual Flags

NameDescriptionDefault
build-executables

build the executables, not just the library

Enabled
linknodes

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

Disabled
buildsearchtree

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

Disabled
exference-devDisabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 1.6.0.0
Dependencies base (>=4.7.0.2 && <5), base-orphans (>=0.5.1 && <0.6), bifunctors (>=5.4.1 && <5.5), containers (>=0.5.0.0 && <0.6), data-pprint (>=0.2.4), deepseq (>=1.3.0.1 && <1.5), deepseq-generics (>=0.1.1.2 && <0.3), directory (>=1.2 && <1.3), either (>=4.4 && <4.5), exference, hashable (>=1.2.4.0 && <1.3), haskell-src-exts (>=1.17.1 && <1.18), hood (>=0.3 && <0.4), lens (>=4.12 && <4.15), mmorph (>=1.0.4 && <1.1), mtl (>=2.1 && <2.3), multistate (>=0.6.2 && <0.8), parsec (>=3.1.11 && <3.2), pqueue (>=1.3.1 && <1.4), pretty (>=1.1 && <1.2), process (>=1.2.3.0 && <1.5), safe (>=0.3.10 && <0.4), split (>=0.2.3.1 && <0.3), template-haskell (>=2.8.0.0 && <2.12.0.0), transformers (>=0.3 && <0.6), unordered-containers (>=0.2.5 && <0.3), vector (>=0.11 && <0.13.0.0) [details]
License BSD-3-Clause
Author Lennart Spitzner
Maintainer Lennart Spitzner <hexagoxel@hexagoxel.de>
Revised Revision 4 made by lspitzner at 2017-08-01T21:49:06Z
Category Language
Home page https://github.com/lspitzner/exference
Bug tracker https://github.com/lspitzner/exference/issues
Source repo head: git clone git@github.com:lspitzner/exference.git
Uploaded by lspitzner at 2017-02-13T15:41:03Z
Distributions
Executables exference
Downloads 1597 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
Last success reported on 2017-02-13 [all 3 reports]