[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
1 character fix to make ob-haskell compatible with table outputs
From: |
ParetoOptimalDev |
Subject: |
1 character fix to make ob-haskell compatible with table outputs |
Date: |
Tue, 14 Mar 2023 22:22:13 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Just change the `[` and `]` to `(` and `)` respectively.
List of lists aren't parsed correctly by ob-haskell, but tuples of
tuples are.
That means this code change I just tested works:
(defun org-babel-haskell-var-to-haskell (var)
"Convert an elisp value VAR into a haskell variable.
The elisp VAR is converted to a string of haskell source code
specifying a variable of the same value."
(if (listp var)
(concat "(" (mapconcat #'org-babel-haskell-var-to-haskell var ", ") ")")
(format "%S" var)))
For something like:
name:tbl
#+begin_src sh
echo -e "1\t2\t3"
#+end_src
#+RESULTS:
| 1 | 2 | 3 |
#+begin_src haskell :var table=tbl
print table
#+end_src
#+RESULTS:
| 1 | 2 | 3 |
Whereas before it would not print the table out because it isn't parsed
correctly.
- 1 character fix to make ob-haskell compatible with table outputs,
ParetoOptimalDev <=