emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Lawrence Bottorff <borgauf@gmail.com>
To: Bruno Barbier <brubar.cs@gmail.com>
Cc: emacs-orgmode Mailinglist <emacs-orgmode@gnu.org>
Subject: Re: Haskell org-mode problems redux
Date: Thu, 30 May 2019 22:40:52 -0500	[thread overview]
Message-ID: <CAFAhFSWw+Trnc21DA1YF1UTTUtpRAwVtkJndf6i3xFZ8MMtmxg@mail.gmail.com> (raw)
In-Reply-To: <5cf03c32.1c69fb81.2b66a.5651@mx.google.com>

[-- Attachment #1: Type: text/plain, Size: 2597 bytes --]

Gosh, it worked. So I wasn't crazy or remiss, rather, I just didn't know
how deep the rabbit hole was. Thanks! One odd thing still. I tried to run

#+begin_src haskell
:set prompt-cont ""
#+end_src

and like other times before trying to run Haskell blocks it complained
saying

executing Haskell code block...
org-babel-script-escape: ‘org-babel-script-escape’ expects a string

so I add :results output to the #+begin line and it works. Would anyone
know what that is about?


On Thu, May 30, 2019 at 3:25 PM Bruno Barbier <brubar.cs@gmail.com> wrote:

>
> Hi Lawrence,
>
>
> Lawrence Bottorff <borgauf@gmail.com> writes:
>
> > I've been trying to get Haskell to work in babel code blocks for a long
> > time. A year or so ago I tried and eventually gave up. I tried again
> > recently . . . same old problems, i.e., the code block is evaluated
> > exclusively by the ghci REPL, which doesn't understand or play well with
> an
> > org babel code block.
> >
> ...
> > Soooo, any ideas?
>
> I'm using the header arguments:
>
>
>     :prologue ":{\n" :epilogue ":}\n"
>
>
>
> to request org to insert those multiline tags :{ :}
> (so, I'm not using ":set +m").
>
> I'm defining these header args as headline properties (so that I don't
> have to enter them again and again).  Something like that:
>
>   #+begin_example
>     ,** A title
>        :PROPERTIES:
>        :header-args:haskell: :prologue ":{\n" :epilogue ":}\n"
>        :END:
>   #+end_example
>
> I'm telling ghci to not insert a prompt, when waiting for the end of a
> multiline.
>
> #+begin_src haskell
> :set prompt-cont ""
> #+end_src
>
>
> Configured like this, it seems to be working quite well for me (great
> job org and GHC teams!).
>
>
> #+begin_src haskell
>   doubleSmallNumber x =
>       if x > 10
>           then x
>           else x * 2
> #+end_src
>
> No error.
>
> #+begin_src haskell
> let
>     showMe :: Int -> [String]
>     showMe x = [show x, show $ doubleSmallNumber x]
> in
>   [ ["x", "doubleSmallNumber x"]
>   , showMe 3
>   , showMe 13
>   ]
> #+end_src
>
> #+RESULTS:
>     |  x | doubleSmallNumber x |
>     |  3 |                   6 |
>     | 13 |                  13 |
>
>
>
> My config:
>
>     | ghci  | 8.6.3 |
>     | emacs |  26.1 |
>     | org   | 9.2.3 |
>     | OS    | linux |
>
>
> If it doesn't work for you on GNU/Linux, post the example and I will try
> it on my computer (sorry, I won't be able to help you with Microsoft
> Windows though).
>
>
>
> Bruno
>
>
> > LB
>

[-- Attachment #2: Type: text/html, Size: 3504 bytes --]

      reply	other threads:[~2019-05-31  3:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 17:55 Haskell org-mode problems redux Lawrence Bottorff
2019-05-30 21:25 ` Bruno Barbier
2019-05-31  3:40   ` Lawrence Bottorff [this message]

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=CAFAhFSWw+Trnc21DA1YF1UTTUtpRAwVtkJndf6i3xFZ8MMtmxg@mail.gmail.com \
    --to=borgauf@gmail.com \
    --cc=brubar.cs@gmail.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).