Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ob-idris support? #470

Open
zwild opened this issue Dec 14, 2017 · 2 comments
Open

ob-idris support? #470

zwild opened this issue Dec 14, 2017 · 2 comments

Comments

@zwild
Copy link

zwild commented Dec 14, 2017

Hi, thanks for the great work.
I want to literate programming with idris. Will idris-mode add ob-idris?
Thanks a lot.

@david-christiansen
Copy link
Member

david-christiansen commented Dec 14, 2017 via email

@dpkatz
Copy link

dpkatz commented Jul 3, 2018

I've been playing with this a bit, and have gotten somewhere but not far enough.

My first attempt was to use comint-mode with the *idris-process* buffer, but that didn't do anything. If I understood what I read, most of the Idris interaction is via a socket rather than through comint.

My second attempt got single line execution going using org-babel-eval with the command line idris -q. Simple evaluation, but no sessions and no multi-line blocks of code:

#+BEGIN_SRC idris :results raw :session none 
3 + 4
#+END_SRC

#+RESULTS:
7 : Integer

My current attempt is to try to get sessions and blocks going. I am trying to use something like

(idris-eval '(:load-file (expand-file-name "~/junk/test.idr")) nil)

where we'd save the contents of the org-babel block to a temp file and then run idris-eval on that. The contents of the test file I'm working with is

import Data.Vect

mymap : (a -> b) -> Vect n a -> Vect n b
mymap f [] = []
mymap f (x :: xs) = f x :: mymap f xs

but if I try to evaluate the elisp directly I get errors:

error in process filter: idris-dispatch-event: Unexpected reply: 66 (:error "parse failure")
error in process filter: Unexpected reply: 66 (:error "parse failure")

I'm not sure what that's about or how to diagnose it. If you have any pointers, I'd be happy to keep this moving forward...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants