2

Well I'm following a tutorial of miniKanren in scheme using FsLogic, but I just got stuck in this example

(run 1 (q)
 (== '(lambda (x) x) '(lambda (x) x)))

And I'm writing it in f# like this:

run 1 (fun q ->
        (fun x -> x) *=* (fun x -> x)
       )

But it fails (doesn't compile) :( enter image description here

Reading the tests I tried to use project but it doesn't work either (I'm not really sure what project does yet).....

I'm following this "uncourses" from the minikanren homepage

jjchiw
  • 4,375
  • 1
  • 29
  • 30
  • 5
    "Doesn't compile" is not a good description of a problem. Please show error messages and/or other undesirable results you're getting. – Fyodor Soikin Jun 05 '17 at 12:48
  • Ok, added and image showing the error message – jjchiw Jun 05 '17 at 22:59
  • How is `( *=* )` defined? It looks like it's defined in such a way that the first argument can't be a function. – kvb Jun 07 '17 at 01:01
  • here it's the definition of `*=*` https://github.com/kurtschelfthout/FsLogic/blob/master/FsLogic/Goal.fs#L158 it works with all the other samples like `x *=* z &&& 3Z *=* z &&& q *=* x` the question is not `f#` generic (i think) it's about how to convert the `scheme` code using `miniKanren` to `f#` using `FSLogic` a port of `miniKanren` – jjchiw Jun 07 '17 at 10:00
  • 1
    @jjchiw - I don't have any experience with FsLogic, but it appears to me that the first argument to `*=*` must be a value of type `Term<_>`, so you can't just use a function there. But without knowing anything about minikanren or FsLogic I'm afraid I can't advise you on how to construct an appropriate value of that type. – kvb Jun 07 '17 at 13:56

0 Answers0