emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Simon Beaumont <simon@datalligator.com>
To: emacs-orgmode@gnu.org
Subject: Bug: Babel Haskell mode [8.0.3 (8.0.3-30-g56b864-elpa @ /Users/ix/.emacs.d/elpa/org-20130610/)]
Date: Mon, 10 Jun 2013 21:07:41 +0100	[thread overview]
Message-ID: <m1fvwprape.fsf@psi.home> (raw)


Whenever I try and evaluate the Haskell code block I get:
"Code block returned no value."

#+begin_src haskell :results value
  let fac n = product [1..n]
  [(x,fac x) | x <- [0..11]]
#+end_src

#+results:


I am using ghci as my haskell-program
The Haskell source is correctly executed in the *haskell* inferior mode.

> let fac n = product [1..n]
[(x,fac x) | x <- [0..11]]
"org-babel-haskell-eoe"
> [(0,1),(1,1),(2,2),(3,6),(4,24),(5,120),(6,720),(7,5040),(8,40320),(9,362880),(10,3628800),(11,39916800)]
> "org-babel-haskell-eoe"
> 

The raw binding receives appropriate data below but the "parse" is
always null
 
...
(defun org-babel-execute:haskell (body params)
  "Execute a block of Haskell code."
  (let* ((session (cdr (assoc :session params)))
         (vars (mapcar #'cdr (org-babel-get-header params :var)))
         (result-type (cdr (assoc :result-type params)))
         (full-body (org-babel-expand-body:generic
                     body params
		     (org-babel-variable-assignments:haskell params)))
         (session (org-babel-haskell-initiate-session session params))
         ;; ++ we get something like the above here
         (raw (org-babel-comint-with-output
                  (session org-babel-haskell-eoe t full-body)
                (insert (org-babel-trim full-body))
                (comint-send-input nil t)
                (insert org-babel-haskell-eoe)
                (comint-send-input nil t)))
         ;; ++ this is null
         (results (mapcar
                   #'org-babel-haskell-read-string
                   (cdr (member org-babel-haskell-eoe
                                (reverse (mapcar #'org-babel-trim raw)))))))
...

What am I doing wrong?
Thanks for any assistance to fix this - what should we be getting in results?

_________________
Emacs  : GNU Emacs 24.3.1 (x86_64-apple-darwin12.3.0)
 of 2013-05-04 on psi
Package: Org-mode version 8.0.3 (8.0.3-30-g56b864-elpa @ /Users/ix/.emacs.d/elpa/org-20130610/)

current state:
==============
(setq
 org-tab-first-hook '(org-hide-block-toggle-maybe org-src-native-tab-command-maybe org-babel-hide-result-toggle-maybe
                      org-babel-header-arg-expand)
 org-speed-command-hook '(org-speed-command-default-hook org-babel-speed-command-hook)
 org-occur-hook '(org-first-headline-recenter)
 org-metaup-hook '(org-babel-load-in-session-maybe)
 org-confirm-shell-link-function 'yes-or-no-p
 org-after-todo-state-change-hook '(org-clock-out-if-current)
 org-src-mode-hook '(org-src-babel-configure-edit-buffer org-src-mode-configure-edit-buffer)
 org-agenda-before-write-hook '(org-agenda-add-entry-text)
 org-babel-pre-tangle-hook '(save-buffer)
 org-mode-hook '(#[nil "\300\301\302\303\304$\207"
                   [org-add-hook change-major-mode-hook org-show-block-all append local] 5]
                 #[nil "\300\301\302\303\304$\207"
                   [org-add-hook change-major-mode-hook org-babel-show-result-all append local] 5]
                 org-babel-result-hide-spec org-babel-hide-all-hashes)
 org-ctrl-c-ctrl-c-hook '(org-babel-hash-at-point org-babel-execute-safely-maybe)
 org-cycle-hook '(org-cycle-hide-archived-subtrees org-cycle-hide-drawers org-cycle-hide-inline-tasks
                  org-cycle-show-empty-lines org-optimize-window-after-visibility-change)
 org-babel-tangle-lang-exts '(("haskell" . "hs") ("python" . "py") ("emacs-lisp" . "el"))
 org-confirm-elisp-link-function 'yes-or-no-p
 org-metadown-hook '(org-babel-pop-to-session-maybe)
 org-babel-load-languages '((python . t) (R . t) (haskell . t) (emacs-lisp . t))
 org-clock-out-hook '(org-clock-remove-empty-clock-drawer)
 )

             reply	other threads:[~2013-06-10 20:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 20:07 Simon Beaumont [this message]
2013-06-10 22:53 ` Bug: Babel Haskell mode [8.0.3 (8.0.3-30-g56b864-elpa @ /Users/ix/.emacs.d/elpa/org-20130610/)] Eric Schulte
2013-06-11 15:15   ` Simon Beaumont
2013-06-13  5:18     ` Eric Schulte
2013-06-13  9:35       ` Simon Beaumont
2013-06-13 13:04         ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1fvwprape.fsf@psi.home \
    --to=simon@datalligator.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).