Exference is a Haskell tool for generating expressions from a type, e.g.
Input: (Show b) => (a -> b) -> [a] -> [String]
Output: \ b -> fmap (\ g -> show (b g))
Djinn is a well known tool that does something similar; the main difference is that Exference supports a larger subset of the haskell type system - most prominently type classes. This comes at a cost, however: Exference makes no promise regarding termination. Where Djinn tells you "there are no solutions", exference will keep trying, sometimes stopping with "i could not find any solutions".
:exf prefix, i.e. :exf "Monad m => m (m a) -> m a"/msg exferenceBot helpgit clone git@github.com:lspitzner/exference.git
cd exference
cabal sandbox init
# note that ghc-7.10 does not work yet;
# i recommend ghc-7.8.4 for now.
cabal install --only-dependencies
cabal configure
cabal build
# and, for example
cabal run -- "(Show b) => (a->b) -> [a] -> [String]"
Alternatively:
git clone git@github.com:lspitzner/exference.git
cd exference
stack build
There are certain types of queries where Exference will not be able to find any / the right solution. Some common current limitations are:
(a, b) -> a will not find a solution (unless given --allowunused flag).
Often this is the desired behaviour, consider queries such as
(a->b) -> [a] -> [b] where a trivial solution would be \_ _ -> [].
This also means that certain functions are not included in the environment,
e.g. length or mapM_, as they "lose information";String -> [Char] will not give
solutions. Should be easy to implement, but I have not come around to it yet;Maybe -> Either
(which can be seen as both advantage and disadvantage, see report);-c --patternMatchMC, but reduces performance significantly for any
non-trivial queries. Core algorithm needs re-write to optimize stuff
sufficiently I fear.If you want to add new elements to the environment, be careful not to add functions that
mapM vs forM);void :: Functor f => f a -> f ();and avoid adding functions that
#exference
Haskell
100.0%
Exference is a Haskell tool for generating expressions from a type, e.g.
Input: (Show b) => (a -> b) -> [a] -> [String]
Output: \ b -> fmap (\ g -> show (b g))
Djinn is a well known tool that does something similar; the main difference is that Exference supports a larger subset of the haskell type system - most prominently type classes. This comes at a cost, however: Exference makes no promise regarding termination. Where Djinn tells you "there are no solutions", exference will keep trying, sometimes stopping with "i could not find any solutions".
:exf prefix, i.e. :exf "Monad m => m (m a) -> m a"/msg exferenceBot helpgit clone git@github.com:lspitzner/exference.git
cd exference
cabal sandbox init
# note that ghc-7.10 does not work yet;
# i recommend ghc-7.8.4 for now.
cabal install --only-dependencies
cabal configure
cabal build
# and, for example
cabal run -- "(Show b) => (a->b) -> [a] -> [String]"
Alternatively:
git clone git@github.com:lspitzner/exference.git
cd exference
stack build
There are certain types of queries where Exference will not be able to find any / the right solution. Some common current limitations are:
(a, b) -> a will not find a solution (unless given --allowunused flag).
Often this is the desired behaviour, consider queries such as
(a->b) -> [a] -> [b] where a trivial solution would be \_ _ -> [].
This also means that certain functions are not included in the environment,
e.g. length or mapM_, as they "lose information";String -> [Char] will not give
solutions. Should be easy to implement, but I have not come around to it yet;Maybe -> Either
(which can be seen as both advantage and disadvantage, see report);-c --patternMatchMC, but reduces performance significantly for any
non-trivial queries. Core algorithm needs re-write to optimize stuff
sufficiently I fear.If you want to add new elements to the environment, be careful not to add functions that
mapM vs forM);void :: Functor f => f a -> f ();and avoid adding functions that
#exference
Haskell
100.0%