From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IJlfN06U0V/tOAAA0tVLHw (envelope-from ) for ; Thu, 10 Dec 2020 03:21:50 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id io4DM06U0V9lMwAAbx9fmQ (envelope-from ) for ; Thu, 10 Dec 2020 03:21:50 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5C8D79403EB for ; Thu, 10 Dec 2020 03:21:50 +0000 (UTC) Received: from localhost ([::1]:57948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knCWa-00029O-Ev for larch@yhetil.org; Wed, 09 Dec 2020 22:21:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60832) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knCVm-00028w-Pq for emacs-orgmode@gnu.org; Wed, 09 Dec 2020 22:20:58 -0500 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:33477) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knCVk-0001F7-T8 for emacs-orgmode@gnu.org; Wed, 09 Dec 2020 22:20:58 -0500 Received: by mail-ed1-x532.google.com with SMTP id k4so3954227edl.0 for ; Wed, 09 Dec 2020 19:20:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=9pZ73YbOtUgyPPlannPV2quotclJ3+vOgJtfTKReD4w=; b=qPnFu13c46yoOUhzPfEhDEmY+xY+YokLNWGpO5spIXUack+XcyRQRzUjSMadaQwkrz Hl6E/6GjbZgEb8ab8yZ7U22wyGMRAmRj7K2APs2bBmAsd748Q54QH5S+bLkN5zMtlzxh Y33yBDx5GTMFfgIrgYtIInCW9NHM3z9QXoVDhxZQENCQRPL2uuaQRzOzBOv/1YOBxbxj lrkLJ2flkNVrz+9t9nktirx2oEwJlYAX4AXDvvt7eFtndkigO9y60r318wTNntl+DFBl hufmmuTLv5gMoKgafManf10zw4cUiaKG0zCwhytDBSgLRAvsBF0WFuobiqmjCHAIXUro Nf5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9pZ73YbOtUgyPPlannPV2quotclJ3+vOgJtfTKReD4w=; b=DvXvBb5/8hhYYYHs+uR47jMAcCqoNE/ldoVztNXPvVR8Im9a/7ZlcCGFjyL0CdaVL9 lb/6k8kBjcSoRjLxlr5jOtjrrlxtpHTmj4qbXXhdUunjNh7kFgOhocyaPpTWe09ImriD VigvFhS/uMexU29vaKRrXXT/EF6jxLDiBZeuYjCiB0696dlTN+JCI+VCgQn37bGMjwvl qXVMxU2/jNi4L+Eri7nunAAucprCB+1vpTvs10DxeWdOz4lSdvSginowH6uY/p79RfU2 BnQXm/BOh/p1JQuhIUq4+ODzV4jyxJBSLqzBtF27/dfYK3QX8GG26rKcuqruOO7L+zsy NPFw== X-Gm-Message-State: AOAM533omVRzBEhTLIJar8pG45m7kvsDG+7HB9lVhow8shI0hhQSEfe8 VcxZTTBabE2Q3Fe1i0l1kNn2UnEud8XpKvGjXs/+uqU5cvE= X-Google-Smtp-Source: ABdhPJxc4aYr0/z0xPnLwD2ZJ6ER44Q9mB24BIgEwwSEGuJdvb3l87OL4TzdCJ6LDbt9cgBQQ57bYtQxdTe4KggDLEI= X-Received: by 2002:aa7:c2d8:: with SMTP id m24mr4822090edp.300.1607570454604; Wed, 09 Dec 2020 19:20:54 -0800 (PST) MIME-Version: 1.0 From: Lawrence Bottorff Date: Wed, 9 Dec 2020 21:20:42 -0600 Message-ID: Subject: Unhealthy Haskell babel To: emacs-orgmode Mailinglist Content-Type: multipart/alternative; boundary="000000000000e5f06605b613a9ef" Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=borgauf@gmail.com; helo=mail-ed1-x532.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.50 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=qPnFu13c; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 5C8D79403EB X-Spam-Score: -1.50 X-Migadu-Scanner: scn1.migadu.com X-TUID: XZ2uuMRfLB9d --000000000000e5f06605b613a9ef Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm looking into Haskell (latest ghci) again on org-mode. This #+begin_src haskell :results verbatim :exports both :set +m doubleSmallNumber x =3D if x > 100 then x else x*2 #+end_src works, but still the :set +m is necessary for it to see the whole. But this #+begin_src haskell :results verbatim :exports both :set +m factorial :: Int -> Int factorial 0 =3D 1 factorial n =3D n * factorial (n - 1) #+end_src results in this on the REPL side: Prelude> :set +m factorial :: Int -> Int factorial 0 =3D 1 factorial n =3D n * factorial (n - 1) "org-babel-haskell-eoe" Prelude> :26:1-23: error: =E2=80=A2 No instance for (Show (Int -> Int)) arising from a use of =E2= =80=98print=E2=80=99 (maybe you haven't applied a function to enough arguments?) =E2=80=A2 In a stmt of an interactive GHCi command: print it Prelude> Prelude> Prelude> "org-babel-haskell-eoe" which is the same behavior if I try to feed the program into the REPL one line at a time, i.e., Prelude> factorial :: Int -> Int :40:1-23: error: =E2=80=A2 No instance for (Show (Int -> Int)) arising from a use of =E2= =80=98print=E2=80=99 (maybe you haven't applied a function to enough arguments?) =E2=80=A2 In a stmt of an interactive GHCi command: print it So the :set +m trick (take multiple lines) doesn't help here. Obviously, Haskell is not ready to be used with Babel. Can it be fixed? BTW, this does work with the regular ghci REPL and haskell-mode. If it helps, Standard ML, which has very similar syntax (it was Haskell's parent), works fine. LB --000000000000e5f06605b613a9ef Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I'm looking into Haskell (latest ghci) again on org-mo= de. This

#+begin_src haskell :results verbatim :exports = both
:set +m
doubleSmallNumber x =3D if x > 100
=C2=A0 then x=C2=A0 else x*2
#+end_src

works, but stil= l the :set=C2=A0+m is necessary for it to see the whole. But this

#+begin_src haskell :results verbatim :exports both
:set= +m
factorial :: Int -> Int
factorial 0 =3D 1
factorial n =3D n= * factorial (n - 1)
#+end_src

results in t= his on the REPL side:

Prelude> :set +m
facto= rial :: Int -> Int
factorial 0 =3D 1
factorial n =3D n * factorial= (n - 1)
"org-babel-haskell-eoe"
Prelude>
<intera= ctive>:26:1-23: error:
=C2=A0 =C2=A0 =E2=80=A2 No instance for (Show = (Int -> Int)) arising from a use of =E2=80=98print=E2=80=99
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 (maybe you haven't applied a function to enough ar= guments?)
=C2=A0 =C2=A0 =E2=80=A2 In a stmt of an interactive GHCi comma= nd: print it
Prelude> Prelude> Prelude> "org-babel-haskell= -eoe"

which is the same behavior if I try= to feed the program into the REPL one line at a time, i.e.,=C2=A0

Prelude> factorial :: Int -> Int

<interact= ive>:40:1-23: error:
=C2=A0 =C2=A0 =E2=80=A2 No instance for (Show (I= nt -> Int)) arising from a use of =E2=80=98print=E2=80=99
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 (maybe you haven't applied a function to enough argum= ents?)
=C2=A0 =C2=A0 =E2=80=A2 In a stmt of an interactive GHCi command:= print it

So the :set +m trick (take multiple = lines) doesn't help here. Obviously, Haskell is not ready to be used wi= th Babel. Can it be fixed? BTW, this does work with the regular ghci REPL a= nd haskell-mode. If it helps, Standard ML, which has very similar syntax (i= t was Haskell's parent), works fine.

LB
<= /div> --000000000000e5f06605b613a9ef--