From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aKa5D3P40V/xXwAA0tVLHw (envelope-from ) for ; Thu, 10 Dec 2020 10:29:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id kBSHC3P40V8iewAAB5/wlQ (envelope-from ) for ; Thu, 10 Dec 2020 10:29:07 +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 D198A940357 for ; Thu, 10 Dec 2020 10:29:06 +0000 (UTC) Received: from localhost ([::1]:48850 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knJC5-0001ZE-Qt for larch@yhetil.org; Thu, 10 Dec 2020 05:29:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:60320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knJBI-0001WV-Jy for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 05:28:16 -0500 Received: from mail-io1-xd2c.google.com ([2607:f8b0:4864:20::d2c]:46796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1knJBG-0004QH-UH for emacs-orgmode@gnu.org; Thu, 10 Dec 2020 05:28:16 -0500 Received: by mail-io1-xd2c.google.com with SMTP id 81so4925882ioc.13 for ; Thu, 10 Dec 2020 02:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=iNYGhbYhqPqpeYUbKjP2fvwXJhYwW3qvwEIziLkht74=; b=uJ46EphXWShFq5AbQ01HwPOfBmp4hEqWJ9Ofoj5A5uk3cgcwJ0pigAp0Hk7BEMYhwg MgT9IHG3yNDTtS+SC1Lh3MqSbgoGmw7JjUs7+axle+KyuF2w9usgFzTQr1y42aVDc0cV 4/g84RjuOaO6pO5tPkRmATh/8Mdx/wicyoSug8BqiRHnOFX2vhzMbzpFK6uWnOLhORfF MnFr/shFhZPuKXTWDiuZwtqaJ5fSpEC/lt5OdqBThr0JRpI/pPwyxX8mNAyKK4wvqdpp NvFes8InC/aUSmSuVBc7C3RF43CVTV+wQH8mwGhMlgxIiMRoidiNSjigPcqS7R/uISMc cyyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=iNYGhbYhqPqpeYUbKjP2fvwXJhYwW3qvwEIziLkht74=; b=PpCqWwegFFquWjqJ0JO/5X4hniCIPvL74ukwxNN2BKHGGd+MGDLLowCegztocEHfCi pb/NgtXCrp5jyH7XrJ1oBfBOjMEyuBA0YchXZM4O7Cp9FBNRo8f5PjnLu5/9oTQsiuU6 tZQH8uAc6lN3BAlHQTbJC/wedwwinYu9jePrZkWx3SY3DwNSuEIQsvG7OIF9tsqoyMP1 CDubpR/0DbdtR9pX7byd2Our+SXC0qb2kz5lU4viH1y6nLfIwUZmZ12t0/8wf2s4uULA w3rAQLT9TmO/KDL4jwdihSC3x6wsZcybbZHvN3qzFf55xwx9jgvJcNh7xwx4IHF/mOCG Y4MQ== X-Gm-Message-State: AOAM530/vFy32knNVPowCNfciwi62/3VD4j5szIsVqBYN9MsKza5cLF6 zwA38ZTyATxen2+ZSvXId9FS5oUJZVV/X4uKIA== X-Google-Smtp-Source: ABdhPJz7MYgju4cQxj4xLDPT0MgW/l2me2EOAVbxJctaUTU+DUYt5W7a5v5PU6xTQrijm3Tq0X4P2gFR25pek5cal4Y= X-Received: by 2002:a02:6557:: with SMTP id u84mr8118320jab.82.1607596093498; Thu, 10 Dec 2020 02:28:13 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Immanuel Litzroth Date: Thu, 10 Dec 2020 11:27:37 +0100 Message-ID: Subject: Re: Unhealthy Haskell babel To: Lawrence Bottorff Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2607:f8b0:4864:20::d2c; envelope-from=immanuel.litzroth@gmail.com; helo=mail-io1-xd2c.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, 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: , Cc: emacs-orgmode Mailinglist 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=uJ46EphX; 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: D198A940357 X-Spam-Score: -1.50 X-Migadu-Scanner: scn1.migadu.com X-TUID: tkfH2dKK8qP5 I don't think org-babel is a good fit for compiled languages. If the idea is to just take 1 snippet, and "execute" that it means that to have a consistent whole you'd need to put all the modules of your program into that snippet (already impossible in Haskell, you can have only 1 module per file), compile that, run the resulting binary. Or org mode would have to have some idea of what needs to be retangled & rebuilt. I think that using org-babel for compiled, multifile languages will only work in very simple cases -- and even then.. -- but will lead to problems very soon. Immanuel On Thu, Dec 10, 2020 at 4:21 AM Lawrence Bottorff wrote= : > > 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 th= is > > #+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 --=20 -- Researching the dual problem of finding the function that has a given point as fixpoint.