ds-kanren-0.2.0.1: A subset of the miniKanren language

Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.DSKanren.Sugar

Synopsis

Documentation

conde :: [Predicate] -> Predicate Source

Disjunction of many clauses. This can be thought as a logical switch.

program :: [Predicate] -> Predicate Source

Conjuction of many clauses. Think of this as a sort of logical semicolon.

runN :: Int -> (Term -> Predicate) -> [(Term, [Neq])] Source

Only grab n solutions. Useful for when the full logic program might not terminate. Or takes its sweet time to do so.

class MkFresh a where Source

We often want to introduce many fresh variables at once. We've encoded this in DSKanren with the usual type class hackery for variadic functions.

Methods

manyFresh :: a -> Predicate Source

Instantiate a with as many fresh terms as needed to produce a predicate.

Instances

list :: [Term] -> Term Source

Build a lispish list out of terms. The atom "nil" will serve as the empty list and Pair will be :.