emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Babel Haskell mode [8.0.3 (8.0.3-30-g56b864-elpa @ /Users/ix/.emacs.d/elpa/org-20130610/)]
@ 2013-06-10 20:07 Simon Beaumont
  2013-06-10 22:53 ` Eric Schulte
  0 siblings, 1 reply; 6+ messages in thread
From: Simon Beaumont @ 2013-06-10 20:07 UTC (permalink / raw)
  To: emacs-orgmode


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)
 )

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-06-13 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-10 20:07 Bug: Babel Haskell mode [8.0.3 (8.0.3-30-g56b864-elpa @ /Users/ix/.emacs.d/elpa/org-20130610/)] Simon Beaumont
2013-06-10 22:53 ` 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

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).