Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Hy on Adderall - a miniKanren implementation in Hy
Hy Python
branch: master

Release adderall 1.0.0

Having been used in production for about a year, it is time to admit
defeat, and declare adderall stable. As such, the version number has
been set to 1.0.0.

(run* [q]
    (cheer-forᵒ ?release q)
    (personᵒ q)
    (≡ ?release "adderall 1.0.0")))
;=> ['_.0']

Signed-off-by: Gergely Nagy <>
latest commit bb7a1b4fab
@algernon authored


Build Status Downloads Version

This library contains an implementation of miniKanren in Hy. It is a naive implementation, speed isn't the primary concern.


(import [adderall.dsl [*]])
(require adderall.dsl)

(run* [q] (condᵉ [(≡ q :tea)]
                 [(≡ q :coffee) succeed]))
;; => [:tea :coffee]

(run* [q] (condᵉ [(≡ q :tea)]
                 [(≡ q :coffee) fail]))
;; => [:tea]

(import [getpass [getuser]])

(defreader h [_] "#hy")
(defn lovesᵒ [u v] (≡ v #hy))
(run* [who what] (lovesᵒ who what)
                 (≡ who (getuser))
                 (≡ what #hy))
;; => [['algernon' '#hy']]

More examples can be found in the test suite, and in particular, the tests adapted from The Reasoned Schemer.

Adderall also comes with a set of extra functions, which are there mostly to show the power of the system, or for fun:

(import [adderall.dsl [*]]
        [adderall.extra.zebra [*]])
(require adderall.dsl)
(require adderall.extra.zebra)

(run* [water-drinker horse-owner] (zebraᵖ water-drinker horse-owner))
;; => [['norvegian 'japanese]]

For a practical use, see Hydiomatic, a static analyser and code transformer built upon Adderall, or wynck, a tool to reason about your window layout.


All the code is licensed under the GNU Lesser General Public License (v3+).

Something went wrong with that request. Please try again.