emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-haskell: Line Continuations Mangle Block Output


From: Nick Daly
Subject: Re: [PATCH] ob-haskell: Line Continuations Mangle Block Output
Date: Sun, 17 May 2020 15:07:27 -0500

Hi Org Maintainers,

Attached is an updated patch that makes output trimming work with
blocks that do and don't produce results.  The old patch creates a
=let: Wrong type argument: arrayp, nil= error when evaluating blocks
that don't produce output.  This necessarily incorporates yesterday's
patch.

Thanks for your time,
Nick


Multi-line function declarations with output still work fine.

#+BEGIN_SRC haskell
  :{
  chain :: (Integral a) => a -> [a]
  chain 1 = [1]
  chain n
      | even n = n:chain (n `div` 2)
      | odd n  = n:chain (n*3 + 1)
  :}
  chain 10
#+END_SRC

#+RESULTS:
| 10 | 5 | 16 | 8 | 4 | 2 | 1 |


Silent declaration-only blocks correctly evaluate silently.

#+BEGIN_SRC haskell :results silent
  :{
  flip' :: (a -> b -> c) -> (b -> a -> c)
  flip' f = \x y -> f y x
  :}
#+END_SRC


Single-line function calls also return the expected results.

#+name: flip'-hello
#+BEGIN_SRC haskell
  flip' zip [1,2,3,4,5,6] "hello"
#+END_SRC

#+RESULTS: flip'-hello
| h | 1 |
| e | 2 |
| l | 3 |
| l | 4 |
| o | 5 |

Attachment: ob-haskell-trim-prelude-2.diff
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]