From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruno Barbier Subject: Re: Haskell org-mode problems redux Date: Thu, 30 May 2019 23:25:08 +0200 Message-ID: <5cf03c32.1c69fb81.2b66a.5651@mx.google.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:44415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hWRc7-00025H-Jk for emacs-orgmode@gnu.org; Thu, 30 May 2019 16:25:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hWRc6-0007rf-Ls for emacs-orgmode@gnu.org; Thu, 30 May 2019 16:25:27 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:38070) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hWRc6-0007pP-Es for emacs-orgmode@gnu.org; Thu, 30 May 2019 16:25:26 -0400 Received: by mail-wm1-x332.google.com with SMTP id t5so4561737wmh.3 for ; Thu, 30 May 2019 13:25:26 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Lawrence Bottorff , emacs-orgmode Mailinglist Hi Lawrence, Lawrence Bottorff 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