[Haskell] ANN: hswip-0.3 embedding swi-prolog in haskell
Evgeny Tarasov
etarasov.ekb at gmail.com
Fri Aug 13 08:59:40 EDT 2010
I would like to announce a small library hswip. It is an analogue of pyswip
[1] python library in haskell.
Hswip allows to embed swi-prolog [2] interpreter into your haskell
applications in a convenient way.
Let't look at an example:
main = do
prologInit ["-q","-nosignals"]
prologCall "asserta(a(b,c))."
prologCall "asserta(parent(pam, bob))."
prologCall "asserta(parent(tom, bob))."
prologCall "asserta(parent(tom, liz))."
prologCall "asserta(parent(bob, ann))."
prologCall "asserta(parent(bob, pat))."
prologCall "asserta(parent(pat, jim))."
res <- prologCall "parent(X,Y)."
print res
Output:
[[("X","pat"),("Y","jim")],[("X","bob"),("Y","pat")],[("X","bob"),("Y","ann")],[("X","tom"),("Y","liz")],[("X","tom"),("Y","bob")],[("X","pam"),("Y","bob")]]
The library still has alpha quality and there are many things missing
including exception handling and BSD license.
Any feedback is welcome!
-Evgeny Tarasov
[1] http://code.google.com/p/pyswip/
[2] http://www.swi-prolog.org/
[3] http://hackage.haskell.org/package/hswip-0.3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell/attachments/20100813/ecd55822/attachment.html
More information about the Haskell
mailing list