From dburke.gw at gmail.com Thu Dec 1 03:36:06 2022 From: dburke.gw at gmail.com (Doug Burke) Date: Wed, 30 Nov 2022 22:36:06 -0500 Subject: [Haskell-cafe] Debugging a test suite freeze In-Reply-To: References: Message-ID: I had a test suite loop indefinitely with ghc 9.4.3 - see https://gitlab.haskell.org/ghc/ghc/-/issues/22416 - but to be honest I don't really understand what the code did that lead to the problem, so dont know how relevant it is for you. Doug On Wed, Nov 30, 2022 at 5:46 PM David Feuer wrote: > > In particular, I think tasty does some tricky concurrency. Have there been changes in that recently, either in GHC itself or in async, that might be responsible? > > On Wed, Nov 30, 2022, 5:33 PM David Feuer wrote: >> >> The logict-sequence test suite consistently freezes up on the last >> test when compiled with GHC 9.4.3. logict-sequence and its test suite >> don't do anything special with that GHC/base version as far as I can >> see, or anything particularly strange in general, so I'm pretty >> confident the problem lies elsewhere. My best guesses are hedgehog, >> tasty, and tasty-hedgehog. Has anyone else run into weird issues with >> any/all of these on GHC 9.4.3? >> >> David > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From david.feuer at gmail.com Thu Dec 1 04:15:47 2022 From: david.feuer at gmail.com (David Feuer) Date: Wed, 30 Nov 2022 23:15:47 -0500 Subject: [Haskell-cafe] Debugging a test suite freeze In-Reply-To: References: Message-ID: I don't see anything about test suites freezing/looping in that ticket. Did you mean a different one? Note: it seems pretty clear that my test suite is *not* looping: when it freezes, the process doesn't burn CPU or memory. It seems there's a deadlock somewhere, but it's all *extremely* mysterious to me. Most mysteriously, only the last test case seems to lead to this problem, and it does so even when *dramatically* simplified in various ways (e.g., if I just `liftIO (print s)` instead of traversing with an arbitrary function, and then finish off with `3 === 3`). It would be easy to believe that the problem was in my Hedgehog test case generation code if not for the fact that it works reliably on all versions of GHC from 7.8 through 9.2! So either something is wrong with GHC 9.4 or using 9.4 is getting me a bad version of some dependency. On Wed, Nov 30, 2022 at 10:36 PM Doug Burke wrote: > > I had a test suite loop indefinitely with ghc 9.4.3 - see > https://gitlab.haskell.org/ghc/ghc/-/issues/22416 - but to be honest I > don't really understand what the code did that lead to the problem, so > dont know how relevant it is for you. > > Doug > > On Wed, Nov 30, 2022 at 5:46 PM David Feuer wrote: > > > > In particular, I think tasty does some tricky concurrency. Have there been changes in that recently, either in GHC itself or in async, that might be responsible? > > > > On Wed, Nov 30, 2022, 5:33 PM David Feuer wrote: > >> > >> The logict-sequence test suite consistently freezes up on the last > >> test when compiled with GHC 9.4.3. logict-sequence and its test suite > >> don't do anything special with that GHC/base version as far as I can > >> see, or anything particularly strange in general, so I'm pretty > >> confident the problem lies elsewhere. My best guesses are hedgehog, > >> tasty, and tasty-hedgehog. Has anyone else run into weird issues with > >> any/all of these on GHC 9.4.3? > >> > >> David > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. From dburke.gw at gmail.com Thu Dec 1 13:38:10 2022 From: dburke.gw at gmail.com (Doug Burke) Date: Thu, 1 Dec 2022 08:38:10 -0500 Subject: [Haskell-cafe] Debugging a test suite freeze In-Reply-To: References: Message-ID: Sorry, mea culpa. I got confused - there was a test loop with 9.2 (which sounded a bit like your case, but it was in 9.2 and not 9.4) and an unrelated issue with 9.4 that was found at the same time and I got that mixed up Doug On Wed, Nov 30, 2022 at 11:15 PM David Feuer wrote: > > I don't see anything about test suites freezing/looping in that > ticket. Did you mean a different one? Note: it seems pretty clear that > my test suite is *not* looping: when it freezes, the process doesn't > burn CPU or memory. It seems there's a deadlock somewhere, but it's > all *extremely* mysterious to me. Most mysteriously, only the last > test case seems to lead to this problem, and it does so even when > *dramatically* simplified in various ways (e.g., if I just `liftIO > (print s)` instead of traversing with an arbitrary function, and then > finish off with `3 === 3`). It would be easy to believe that the > problem was in my Hedgehog test case generation code if not for the > fact that it works reliably on all versions of GHC from 7.8 through > 9.2! So either something is wrong with GHC 9.4 or using 9.4 is getting > me a bad version of some dependency. > > On Wed, Nov 30, 2022 at 10:36 PM Doug Burke wrote: > > > > I had a test suite loop indefinitely with ghc 9.4.3 - see > > https://gitlab.haskell.org/ghc/ghc/-/issues/22416 - but to be honest I > > don't really understand what the code did that lead to the problem, so > > dont know how relevant it is for you. > > > > Doug > > > > On Wed, Nov 30, 2022 at 5:46 PM David Feuer wrote: > > > > > > In particular, I think tasty does some tricky concurrency. Have there been changes in that recently, either in GHC itself or in async, that might be responsible? > > > > > > On Wed, Nov 30, 2022, 5:33 PM David Feuer wrote: > > >> > > >> The logict-sequence test suite consistently freezes up on the last > > >> test when compiled with GHC 9.4.3. logict-sequence and its test suite > > >> don't do anything special with that GHC/base version as far as I can > > >> see, or anything particularly strange in general, so I'm pretty > > >> confident the problem lies elsewhere. My best guesses are hedgehog, > > >> tasty, and tasty-hedgehog. Has anyone else run into weird issues with > > >> any/all of these on GHC 9.4.3? > > >> > > >> David > > > > > > _______________________________________________ > > > Haskell-Cafe mailing list > > > To (un)subscribe, modify options or view archives go to: > > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > Only members subscribed via the mailman list are allowed to post. From simon at joyful.com Thu Dec 1 20:41:47 2022 From: simon at joyful.com (Simon Michael) Date: Thu, 1 Dec 2022 12:41:47 -0800 Subject: [Haskell-cafe] ANN: hledger 1.28 Message-ID: <4619020A-DB9F-4DDC-B54D-7D340D0C9C68@joyful.com> I'm pleased to announce hledger 1.28 ! https://github.com/simonmichael/hledger/releases/1.28 https://hledger.org/install https://hledger.org/release-notes.html#hledger-1-28 Nothing earth-shaking for users in this release, but internal changes and the usual incremental improvements. Highlights: new hledger-ui screens and default screen; new hledger-move, watchaccounts scripts. Thank you to release contributors Felix Yan, Patrick Fiaux. What is hledger ? - Fast, reliable, free, multicurrency, double-entry, plain text accounting[1] software that runs on unix, mac, windows, and the web - Built around human-readable, version-controllable plain text files - Inspired by and largely compatible with Ledger CLI[2]; convertible to and from Beancount[3] - Written in Haskell for correctness and longevity. For help getting started, or more info, see https://hledger.org and join our chat via Matrix or IRC: https://hledger.org/support Newcomers, experts, contributors, sponsors, feedback are welcome! Aloha, -Simon [1] https://plaintextaccounting.org [2] https://ledger-cli.org [3] https://beancount.github.io -------------- next part -------------- An HTML attachment was scrubbed... URL: From lysxia at gmail.com Fri Dec 2 00:14:27 2022 From: lysxia at gmail.com (Li-yao Xia) Date: Fri, 2 Dec 2022 00:14:27 +0000 Subject: [Haskell-cafe] Debugging a test suite freeze In-Reply-To: References: Message-ID: <56009f43-d100-b8cc-30b3-94802358af5c@gmail.com> GHC 9.4.3 with -O2 is miscompiling the derived Show and Eq instances for SeqT in logict-sequence.     main :: IO ()     main = print (pure 0 :: Seq Int)     -- -O0, -O1: prints the Seq     -- -O2: <> On top of that, both hedgehog and hspec fail to catch `<>`.     main :: IO ()     main = defaultMain       [ check $ property $ do           let x = x :: Int  -- obvious loop compiles to a thrown exception <>           if x == x then pure () else pure ()  ]     -- "thread blocked indefinitely in an STM transaction"     -- meaning some thread is not getting cleaned up properly     main :: IO ()     main = hspec $ do       describe "work" $ do         it "works" $ do           let x = x :: Int  -- obvious loop compiles to a thrown exception <>           if x == x then pure () else pure () :: IO ()     --- hangs Cheers, Li-yao On 2022-11-30 10:33 PM, David Feuer wrote: The logict-sequence test suite consistently freezes up on the last test when compiled with GHC 9.4.3. logict-sequence and its test suite don't do anything special with that GHC/base version as far as I can see, or anything particularly strange in general, so I'm pretty confident the problem lies elsewhere. My best guesses are hedgehog, tasty, and tasty-hedgehog. Has anyone else run into weird issues with any/all of these on GHC 9.4.3? David _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Fri Dec 2 02:51:36 2022 From: david.feuer at gmail.com (David Feuer) Date: Thu, 1 Dec 2022 21:51:36 -0500 Subject: [Haskell-cafe] Debugging a test suite freeze In-Reply-To: <56009f43-d100-b8cc-30b3-94802358af5c@gmail.com> References: <56009f43-d100-b8cc-30b3-94802358af5c@gmail.com> Message-ID: Wow, that's ... interesting. Could this have to do with the way the constraints are written? Has there been some change in UndecidableInstances? I'll try simplifying the Eq, Ord, Show, etc. constraints manually and see if that fixes it. On Thu, Dec 1, 2022, 7:14 PM Li-yao Xia wrote: > GHC 9.4.3 with -O2 is miscompiling the derived Show and Eq instances for > SeqT in logict-sequence. > > main :: IO () > main = print (pure 0 :: Seq Int) > -- -O0, -O1: prints the Seq > -- -O2: <> > > On top of that, both hedgehog and hspec fail to catch `<>`. > > main :: IO () > main = defaultMain > [ check $ property $ do > let x = x :: Int -- obvious loop compiles to a thrown exception > <> > if x == x then pure () else pure () ] > -- "thread blocked indefinitely in an STM transaction" > -- meaning some thread is not getting cleaned up properly > > main :: IO () > main = hspec $ do > describe "work" $ do > it "works" $ do > let x = x :: Int -- obvious loop compiles to a thrown exception > <> > if x == x then pure () else pure () :: IO () > --- hangs > > Cheers, > Li-yao > > > On 2022-11-30 10:33 PM, David Feuer wrote: > > The logict-sequence test suite consistently freezes up on the last > test when compiled with GHC 9.4.3. logict-sequence and its test suite > don't do anything special with that GHC/base version as far as I can > see, or anything particularly strange in general, so I'm pretty > confident the problem lies elsewhere. My best guesses are hedgehog, > tasty, and tasty-hedgehog. Has anyone else run into weird issues with > any/all of these on GHC 9.4.3? > > David > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to:http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Fri Dec 2 04:13:15 2022 From: david.feuer at gmail.com (David Feuer) Date: Thu, 1 Dec 2022 23:13:15 -0500 Subject: [Haskell-cafe] Debugging a test suite freeze In-Reply-To: <56009f43-d100-b8cc-30b3-94802358af5c@gmail.com> References: <56009f43-d100-b8cc-30b3-94802358af5c@gmail.com> Message-ID: Thank you so much for figuring this out. I've filed a bug at https://gitlab.haskell.org/ghc/ghc/-/issues/22549 In the mean time, I'll adjust the upper bounds on Hackage and release a version of logict-sequence that hopefully won't have this issue. On Thu, Dec 1, 2022 at 7:14 PM Li-yao Xia wrote: > > GHC 9.4.3 with -O2 is miscompiling the derived Show and Eq instances for SeqT in logict-sequence. > > main :: IO () > main = print (pure 0 :: Seq Int) > -- -O0, -O1: prints the Seq > -- -O2: <> > > On top of that, both hedgehog and hspec fail to catch `<>`. > > main :: IO () > main = defaultMain > [ check $ property $ do > let x = x :: Int -- obvious loop compiles to a thrown exception <> > if x == x then pure () else pure () ] > -- "thread blocked indefinitely in an STM transaction" > -- meaning some thread is not getting cleaned up properly > > main :: IO () > main = hspec $ do > describe "work" $ do > it "works" $ do > let x = x :: Int -- obvious loop compiles to a thrown exception <> > if x == x then pure () else pure () :: IO () > --- hangs > > Cheers, > Li-yao > > > On 2022-11-30 10:33 PM, David Feuer wrote: > > The logict-sequence test suite consistently freezes up on the last > test when compiled with GHC 9.4.3. logict-sequence and its test suite > don't do anything special with that GHC/base version as far as I can > see, or anything particularly strange in general, so I'm pretty > confident the problem lies elsewhere. My best guesses are hedgehog, > tasty, and tasty-hedgehog. Has anyone else run into weird issues with > any/all of these on GHC 9.4.3? > > David > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From mail at joachim-breitner.de Sat Dec 3 19:05:05 2022 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sat, 03 Dec 2022 20:05:05 +0100 Subject: [Haskell-cafe] How to create a list of each constructor value In-Reply-To: <6d3546bb-13fd-ddf8-9fe8-ccfcdb423b2@henning-thielemann.de> References: <1434982562.46277715.1669821536049.JavaMail.zimbra@synchrotron-soleil.fr> <6d3546bb-13fd-ddf8-9fe8-ccfcdb423b2@henning-thielemann.de> Message-ID: <920679b58e7b1d172b83f9df34d00b4fd61d1631.camel@joachim-breitner.de> Hi, Am Mittwoch, dem 30.11.2022 um 16:21 +0100 schrieb Henning Thielemann: > > I want to create a list of each values in order to create meaningfull > > error message for the user and simplify my Arbitrary instances. > > deriving (Enum, Bounded) > > then use [minBound .. maxBound] if you want to golf it a bit more, then [minBound..] works as well. (I vaguely remember that there was a variant that didn’t even need Bounded, just, but I don’t recall it right now. Maybe it was [toEnum 0..]? but that only works for certain instances.) Cheers, Joachim -- Joachim Breitner mail at joachim-breitner.de http://www.joachim-breitner.de/ From lemming at henning-thielemann.de Sat Dec 3 19:12:59 2022 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat, 3 Dec 2022 20:12:59 +0100 (CET) Subject: [Haskell-cafe] How to create a list of each constructor value In-Reply-To: <920679b58e7b1d172b83f9df34d00b4fd61d1631.camel@joachim-breitner.de> References: <1434982562.46277715.1669821536049.JavaMail.zimbra@synchrotron-soleil.fr> <6d3546bb-13fd-ddf8-9fe8-ccfcdb423b2@henning-thielemann.de> <920679b58e7b1d172b83f9df34d00b4fd61d1631.camel@joachim-breitner.de> Message-ID: <7bbac586-c0e1-f44e-73af-aa4b493ebe96@henning-thielemann.de> On Sat, 3 Dec 2022, Joachim Breitner wrote: > Hi, > > Am Mittwoch, dem 30.11.2022 um 16:21 +0100 schrieb Henning Thielemann: >> > I want to create a list of each values in order to create meaningfull >> > error message for the user and simplify my Arbitrary instances. >> >> deriving (Enum, Bounded) >> >> then use [minBound .. maxBound] > > if you want to golf it a bit more, then > > [minBound..] > > works as well. Wouldn't this create an infinite tail of undefined values? From mail at joachim-breitner.de Sat Dec 3 19:17:20 2022 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sat, 03 Dec 2022 20:17:20 +0100 Subject: [Haskell-cafe] How to create a list of each constructor value In-Reply-To: <7bbac586-c0e1-f44e-73af-aa4b493ebe96@henning-thielemann.de> References: <1434982562.46277715.1669821536049.JavaMail.zimbra@synchrotron-soleil.fr> <6d3546bb-13fd-ddf8-9fe8-ccfcdb423b2@henning-thielemann.de> <920679b58e7b1d172b83f9df34d00b4fd61d1631.camel@joachim-breitner.de> <7bbac586-c0e1-f44e-73af-aa4b493ebe96@henning-thielemann.de> Message-ID: Hi, Am Samstag, dem 03.12.2022 um 20:12 +0100 schrieb Henning Thielemann: > > if you want to golf it a bit more, then > > > >    [minBound..] > > > > works as well. > > Wouldn't this create an infinite tail of undefined value That’s what I thought until I learned about this. Anyways, ghci says it doesn’t: ghci> [False .. ] [False,True] ghci> [LT .. ] [LT,EQ,GT] [x..] is just enumFrom x, and the docs for Enum says > enumFrom and enumFromThen should be defined with an implicit bound, https://hackage.haskell.org/package/base-4.17.0.0/docs/Prelude.html#t:Enum Cheers, Joachim -- Joachim Breitner mail at joachim-breitner.de http://www.joachim-breitner.de/ From elenam at morris.umn.edu Sat Dec 3 23:28:02 2022 From: elenam at morris.umn.edu (Elena Machkasova) Date: Sat, 3 Dec 2022 17:28:02 -0600 Subject: [Haskell-cafe] TFPIE 2023 call for submissions (deadline Dec 27th) Message-ID: Trends in Functional Programming in Education (TFPIE) 2023 Call for papers https://wiki.tfpie.science.ru.nl/TFPIE2023 (January 12th 2023, Boston, MA, USA, co-located with TFP 2023 and followed by POPL 2023) TFPIE 2023 welcomes submissions describing techniques used in the classroom, tools used in and/or developed for the classroom and any creative use of functional programming (FP) to aid education in or outside Computer Science. Topics of interest include, but are not limited to: FP and beginning CS students FP and Computational Thinking FP and Artificial Intelligence FP in Robotics FP and Music Advanced FP for undergraduates FP in graduate education Engaging students in research using FP FP in Programming Languages FP in the high school curriculum FP as a stepping stone to other CS topics FP and Philosophy The pedagogy of teaching FP FP and e-learning: MOOCs, automated assessment etc. Best Lectures - more details below In addition to papers, we are requesting best lecture presentations. What's your best lecture topic in an FP related course? Do you have a fun way to present FP concepts to novices or perhaps an especially interesting presentation of a difficult topic? In either case, please consider sharing it. Best lecture topics will be selected for presentation based on a short abstract describing the lecture and its interest to TFPIE attendees. The length of the presentation should be comparable to that of a paper. In addition, the speaker can provide commentary on effectiveness or student feedback. Submissions Potential presenters are invited to submit an extended abstract (4-6 pages) or a draft paper (up to 20 pages) in EPTCS style. The authors of accepted presentations will have their preprints and their slides made available on the workshop's website. Papers and abstracts can be submitted via easychair at the following link: https://easychair.org/conferences/?conf=tfpie2023 After the workshop, presenters are invited to submit (a revised version of) their article for the formal review. The PC will select the best articles for publication in the Electronic Proceedings in Theoretical Computer Science (EPTCS). Articles rejected for presentation and extended abstracts will not be formally reviewed by the PC. Important Dates Submission deadline: December 27th 2022, Anywhere on Earth. Notification: December 30th 2022 (Note: earlier submissions will receive earlier response) TFPIE Registration Deadline: see https://trendsfp.github.io/register.html Workshop: January 12th 2023 Submission for formal review: April 19th 2023, Anywhere on Earth. Notification of full article: May 24th 2023 Camera ready: July 1st 2023 Program Committee Christopher Anand - McMaster University, Canada Attila Egri-Nagy - Akita International University, Japan Jason Hemann - Seton Hall University, USA Kevin Kappelmann - Technical University of Munich, Germany Elena Machkasova (Chair) - University of Minnesota Morris, USA Kristina Sojakova - INRIA, France Jørgen Villadsen - Technical University of Denmark, Denmark Invited Speaker: Shriram Krishnamurthi, Brown University Registration information: See https://wiki.tfpie.science.ru.nl/TFPIE2023 for updated information. Registration and attendance are mandatory for at least one author of every paper that is presented at the workshop. Only papers that have been presented at TFPIE may be submitted to the post-reviewing process. -- Dr. Elena Machkasova Associate Professor of Computer Science Division of Science and Mathematics University of Minnesota, Morris Office: Sci 2325 (320) 589-6308 http://cda.morris.umn.edu/~elenam/ Pronouns: she/her/hers or any other -------------- next part -------------- An HTML attachment was scrubbed... URL: From ikke at nicolast.be Sun Dec 4 17:05:28 2022 From: ikke at nicolast.be (Nicolas Trangez) Date: Sun, 04 Dec 2022 18:05:28 +0100 Subject: [Haskell-cafe] Some questions on Atkey-style indexed monads Message-ID: <355fd5fb9b7a4c870e9a19a149c464d51665f74a.camel@nicolast.be> All, For some project, I'm considering (again) to use an indexed state monad, which are now somewhat ergonomic to use with QualifiedDo. When looking into existing packages exposing relevant types/classes, I had some questions: 1. These packages provide something like ``` class IxFunctor f where imap :: (a -> b) -> f i j a -> f i j b class IxFunctor f => IxApplicative f where ... ``` Is this `IxFunctor` actually required/useful? It seems to me the implementation of `imap` for some `IxFunctor f` would be equal to `fmap` in the `Functor` implementation for `forall i j. f i j`. Hence, can `IxFunctor` be dropped in lieu of ``` class (forall i j. Functor (f i j)) => IxApplicative f where ... ``` 2. Existing packages predate MonadFail and QualifiedDo. The latter requires (in some cases) an implementation of `fail` and `mfix` to be provided by the module also providing `>>=` etc. I was wondering whether or not there need to be (or can be) `IxMonadFail` and `IxMonadFix` classes like ``` class IxMonad m => IxMonadFail m where ifail :: String -> m i j a class IxMonad m => IxMonadFix m where ifix :: (a -> m i j a) -> m i j a ``` I'm not sure it "makes sense" to have an `ifail` which returns an `m i j a` vs. having only a `MonadFail` (and hence `fail`) implementation for `m i i` only, taking into account the requirement for `fail f >>= k` to be equal to `fail f`, hence `ifail f >>=: k` to be equal to `ifail f`. I think the above question boils down to: is there any use in having `ifail :: String -> m i j a` next to `fail :: String -> m i i a`, or should (i)fail always be state-type-preserving? Similar doubts about `IxMonadFix m` vs. `MonadFix (m i i)`. Thanks for any insights, Nicolas From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Sun Dec 4 21:08:18 2022 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Sun, 4 Dec 2022 21:08:18 +0000 Subject: [Haskell-cafe] Some questions on Atkey-style indexed monads In-Reply-To: <355fd5fb9b7a4c870e9a19a149c464d51665f74a.camel@nicolast.be> References: <355fd5fb9b7a4c870e9a19a149c464d51665f74a.camel@nicolast.be> Message-ID: On Sun, Dec 04, 2022 at 06:05:28PM +0100, Nicolas Trangez wrote: > For some project, I'm considering (again) to use an indexed state > monad, which are now somewhat ergonomic to use with QualifiedDo. > > When looking into existing packages exposing relevant types/classes, I > had some questions: > > 1. These packages provide something like > > ``` > class IxFunctor f where > imap :: (a -> b) -> f i j a -> f i j b > > class IxFunctor f => IxApplicative f where > ... > ``` > > Is this `IxFunctor` actually required/useful? It seems to me the > implementation of `imap` for some `IxFunctor f` would be equal to > `fmap` in the `Functor` implementation for `forall i j. f i j`. Hence, > can `IxFunctor` be dropped in lieu of > > ``` > class (forall i j. Functor (f i j)) => IxApplicative f where > ... > ``` I suspect QualifiedConstraints didn't exist at the time that class was introduced. I agree in modern GHC-flavoured Haskell the quantified constraint version is better. Tom From ikke at nicolast.be Sun Dec 4 22:01:17 2022 From: ikke at nicolast.be (Nicolas Trangez) Date: Sun, 04 Dec 2022 23:01:17 +0100 Subject: [Haskell-cafe] Some questions on Atkey-style indexed monads In-Reply-To: References: <355fd5fb9b7a4c870e9a19a149c464d51665f74a.camel@nicolast.be> Message-ID: <73939b239f842430dfffe8f1ea3cb2bd1e9687be.camel@nicolast.be> On Sun, 2022-12-04 at 21:08 +0000, Tom Ellis wrote: > On Sun, Dec 04, 2022 at 06:05:28PM +0100, Nicolas Trangez wrote: > > For some project, I'm considering (again) to use an indexed state > > monad, which are now somewhat ergonomic to use with QualifiedDo. > > > > When looking into existing packages exposing relevant > > types/classes, I > > had some questions: > > > > 1. These packages provide something like > > > > ``` > > class IxFunctor f where > >     imap :: (a -> b) -> f i j a -> f i j b > > > > class IxFunctor f => IxApplicative f where > >     ... > > ``` > > > > Is this `IxFunctor` actually required/useful? It seems to me the > > implementation of `imap` for some `IxFunctor f` would be equal to > > `fmap` in the `Functor` implementation for `forall i j. f i j`. > > Hence, > > can `IxFunctor` be dropped in lieu of > > > > ``` > > class (forall i j. Functor (f i j)) => IxApplicative f where > >     ... > > ``` > > I suspect QualifiedConstraints didn't exist at the time that class > was > introduced.  I agree in modern GHC-flavoured Haskell the quantified > constraint version is better. Thanks, that confirms my intuition. Indeed, the aforementioned approach requires some language extensions not available when the existing packages were published. Cheers, Nicolas From ivanperezdominguez at gmail.com Wed Dec 14 13:56:20 2022 From: ivanperezdominguez at gmail.com (Ivan Perez) Date: Wed, 14 Dec 2022 05:56:20 -0800 Subject: [Haskell-cafe] [ANN] Yampa 0.14 Message-ID: Dear all, I'm happy to announce the release of Yampa 0.14! Yampa is a fast, elegant Functional Reactive Programming implementation. Yampa prides itself in being a long-standing community project. It has now been around for almost 20 years!!! See https://github.com/ivanperez-keera/yampa#features for details on Yampa's features. * Summary of Version 0.14 - Introduce new type constraint in functions that use VectorSpaces in order to support simple-affine-space 0.2. This is a breaking change, and may require applications to update code on their side providing new instances. - Unit tests in the yampa-test library for 2 more modules have been completed. As always, Yampa and yampa-test are released in sync. The CHANGELOGs are available at: https://github.com/ivanperez-keera/Yampa/blob/develop/yampa/CHANGELOG https://github.com/ivanperez-keera/Yampa/blob/develop/yampa-test/CHANGELOG * Releases You can explore the current versions at: https://hackage.haskell.org/package/Yampa https://hackage.haskell.org/package/yampa-test * Code The github repo is located at: https://github.com/ivanperez-keera/Yampa * What's coming This release comes exactly 2 months after the last release. The next release is planned for Feb 7, 2023. There are a number of issues open that you are more than welcome to contribute to: https://github.com/ivanperez-keera/Yampa/issues Following our roadmap, the pending changes remain as follows: - Complete tests: Our goal is to speed up the process of accepting new features and changes by having a comprehensive test suite that catches errors early. By automating the tests, we hope to free resources that can be dedicated to investigating other issues. - Full conformance to style guide. - Removal of unnecessarily exposed elements from the interface (e.g., FRP.Yampa.Arrow.arr3) that are not used and belong in other libraries. This topic is open to discussion. - Benchmarks: Facilitate making sound, evidence-based decisions about suggested improvements to the implementation, by completing a series of benchmarks. - New mailing list: We will in the future lose access to Yale's CS department-based mailman list, and are thinking of the best place to move the mailing list to. * Donations Our project is now seeking donations to help continue developing Yampa, create new open source libraries, new material, and give talks. Special thanks go to @johannes-riecken for sponsoring my work on the Yampa project with a regular contribution. Github will match the first 5K donated, so if you donate $1/month, github will donate the same amount. No donation is too small. Any contribution will absolutely help. See https://github.com/sponsors/ivanperez-keera for details. If you can help, please come forward. All the best, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From mlang at blind.guru Wed Dec 14 14:59:02 2022 From: mlang at blind.guru (Mario Lang) Date: Wed, 14 Dec 2022 15:59:02 +0100 Subject: [Haskell-cafe] From function body to DAG and back again? Message-ID: <87359ihw09.fsf@blind.guru> Hi. I have a binary instance for a file format[1] which describes a graph of DSP primitives. This DAG was generated from a function body[2] (in another programming language). I think that language can be boiled down to a pure language with let expressions, to allow an output to be consumed by several inputs. And there the trouble starts. I am working on this without the usual theoretical background. I am not a PLD student, I am a self-taught Haskell fan. The function body is basically a very neat way to make a DAG readable without using visualisation. Since I am blind, this topic has always fascinated me. Since I have this bidirectional binary instance, and Haskell is supposed to be great at writing small languages, I wonder what would be required to * write a decompiler which would generate a version of the original function body as a data structure and * write a compiler which would translate that data structure back to the graph. This is very much for my own learning experience, especially since there is already a Haskell library which implements at least the compilation part, and more. However, I always found it very fascinating to try to understand how this translation works, so I'd finally like to take a stab at implementing it myself. I have now searched a day for matching learning material which would shed some light on the problem for me, without any great success. Most SLC-examples I stumbled across immediately proceed to implement an evaluation fucntion, which is not quite what I need. For both directions, I need to work out the data structure for my small language first, which is where I am stuck. I have a feeling the decompiler might be easier to write then the compiler. My intuition says all I need to do is work backwards from the last graph node, resolving all inputs until I am done. However, I am stuck on the data structure and the compiler part. Any hints on what could help me to get a better grasp on the problem and how to solve it in Haskell are greatly appreciated. [1] https://github.com/mlang/sound-supercollider/blob/master/Sound/SuperCollider/SynthDef.hs [2] SynthDef(\default, { arg out=0, freq=440, amp=0.1, pan=0, gate=1; var z = LPF.ar( Mix.new( VarSaw.ar(freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)], 0, 0.3, 0.3) ), XLine.kr(Rand(4000,5000), Rand(2500,3200), 1) ) * Linen.kr(gate, 0.01, 0.7, 0.3, 2); OffsetOut.ar(out, Pan2.ar(z, pan, amp)); }, [\ir]).writeDefFile; Which translates to the following graph. The pairs are inputs, pointing at the corresponding outputs in the graph, -1 refering to the list of constants at the beginning. defaultSynthDef :: SynthDef defaultSynthDef = SynthDef [ GraphDef "default" [-0.4,0.0,0.4,0.3,4000.0,5000.0,2500.0,3200.0,1.0,1.0e-2,0.7,2.0] [0.0,440.0,0.1,0.0,1.0] [("out",0),("freq",1),("amp",2),("pan",3),("gate",4)] [ UGen "Control" Scalar 0 [] [Scalar] , UGen "Control" Control 1 [] [Control,Control,Control,Control] , UGen "VarSaw" Audio 0 [(1,0),(-1,1),(-1,3)] [Audio] , UGen "BinaryOpUGen" Audio 2 [(2,0),(-1,3)] [Audio] , UGen "Linen" Control 0 [(1,3),(-1,9),(-1,10),(-1,3),(-1,11)] [Control] , UGen "Rand" Scalar 0 [(-1,0),(-1,1)] [Scalar] , UGen "BinaryOpUGen" Control 0 [(1,0),(5,0)] [Control] , UGen "VarSaw" Audio 0 [(6,0),(-1,1),(-1,3)] [Audio] , UGen "BinaryOpUGen" Audio 2 [(7,0),(-1,3)] [Audio] , UGen "Rand" Scalar 0 [(-1,1),(-1,2)] [Scalar] , UGen "BinaryOpUGen" Control 0 [(1,0),(9,0)] [Control] , UGen "VarSaw" Audio 0 [(10,0),(-1,1),(-1,3)] [Audio] , UGen "BinaryOpUGen" Audio 2 [(11,0),(-1,3)] [Audio] , UGen "Sum3" Audio 0 [(12,0),(8,0),(3,0)] [Audio] , UGen "Rand" Scalar 0 [(-1,4),(-1,5)] [Scalar] , UGen "Rand" Scalar 0 [(-1,6),(-1,7)] [Scalar] , UGen "XLine" Control 0 [(14,0),(15,0),(-1,8),(-1,1)] [Control] , UGen "LPF" Audio 0 [(13,0),(16,0)] [Audio] , UGen "BinaryOpUGen" Audio 2 [(17,0),(4,0)] [Audio] , UGen "Pan2" Audio 0 [(18,0),(1,2),(1,1)] [Audio,Audio] , UGen "OffsetOut" Audio 0 [(0,0),(19,0),(19,1)] [] ] [] ] -- CYa, ⡍⠁⠗⠊⠕ From sergueyz at gmail.com Wed Dec 14 16:10:25 2022 From: sergueyz at gmail.com (Serguey Zefirov) Date: Wed, 14 Dec 2022 19:10:25 +0300 Subject: [Haskell-cafe] From function body to DAG and back again? In-Reply-To: <87359ihw09.fsf@blind.guru> References: <87359ihw09.fsf@blind.guru> Message-ID: What you described is a topological sorting - sort nodes by their dependencies. Inputs do not depend on anything, they may go firist as their dependence level is 0, outputs depends on intermediate values and nothing depends on them, they go last. Sort nodes in graph accoring to their dependence level and output them as let expressions. There you will have your function definition decompiled. 2022-12-14 17:59 GMT+03:00, Mario Lang : > Hi. > > I have a binary instance for a file format[1] which describes > a graph of DSP primitives. This DAG was generated from a function body[2] > (in another programming language). I think that language > can be boiled down to a pure language with let expressions, > to allow an output to be consumed by several inputs. > And there the trouble starts. I am working on this without the usual > theoretical background. I am not a PLD student, I am a self-taught Haskell > fan. > > The function body is basically a very neat way to make a DAG readable > without using visualisation. Since I am blind, this topic has always > fascinated me. > > Since I have this bidirectional binary instance, and > Haskell is supposed to be great at writing small languages, > I wonder what would be required to > * write a decompiler which would generate a version of the original function > body > as a data structure and > * write a compiler which would translate that data structure back to the > graph. > > This is very much for my own learning experience, especially > since there is already a Haskell library which implements at least the > compilation part, and more. However, I always found it very fascinating > to try to understand how this translation works, so I'd finally > like to take a stab at implementing it myself. > > I have now searched a day for matching learning material which > would shed some light on the problem for me, without any great success. > Most SLC-examples I stumbled across immediately proceed to > implement an evaluation fucntion, which is not quite what I need. > For both directions, I need to work out the data structure > for my small language first, which is where I am stuck. > I have a feeling the decompiler might be easier to write then > the compiler. My intuition says all I need to do is work backwards from > the last graph node, resolving all inputs until I am done. > However, I am stuck on the data structure and the compiler part. > > Any hints on what could help me to get a better grasp on the problem and > how to solve it in Haskell are greatly appreciated. > > > [1] > https://github.com/mlang/sound-supercollider/blob/master/Sound/SuperCollider/SynthDef.hs > > [2] > > SynthDef(\default, { arg out=0, freq=440, amp=0.1, pan=0, gate=1; > var z = LPF.ar( > Mix.new( > VarSaw.ar(freq + [0, Rand(-0.4,0.0), Rand(0.0,0.4)], 0, 0.3, 0.3) > ), > XLine.kr(Rand(4000,5000), Rand(2500,3200), 1) > ) * Linen.kr(gate, 0.01, 0.7, 0.3, 2); > OffsetOut.ar(out, Pan2.ar(z, pan, amp)); > }, [\ir]).writeDefFile; > > Which translates to the following graph. The pairs are inputs, pointing > at the corresponding outputs in the graph, -1 refering to the list of > constants at the beginning. > > defaultSynthDef :: SynthDef > defaultSynthDef = SynthDef > [ GraphDef > "default" > [-0.4,0.0,0.4,0.3,4000.0,5000.0,2500.0,3200.0,1.0,1.0e-2,0.7,2.0] > [0.0,440.0,0.1,0.0,1.0] > [("out",0),("freq",1),("amp",2),("pan",3),("gate",4)] > [ UGen "Control" Scalar 0 [] [Scalar] > , UGen "Control" Control 1 [] [Control,Control,Control,Control] > , UGen "VarSaw" Audio 0 [(1,0),(-1,1),(-1,3)] [Audio] > , UGen "BinaryOpUGen" Audio 2 [(2,0),(-1,3)] [Audio] > , UGen "Linen" Control 0 [(1,3),(-1,9),(-1,10),(-1,3),(-1,11)] [Control] > , UGen "Rand" Scalar 0 [(-1,0),(-1,1)] [Scalar] > , UGen "BinaryOpUGen" Control 0 [(1,0),(5,0)] [Control] > , UGen "VarSaw" Audio 0 [(6,0),(-1,1),(-1,3)] [Audio] > , UGen "BinaryOpUGen" Audio 2 [(7,0),(-1,3)] [Audio] > , UGen "Rand" Scalar 0 [(-1,1),(-1,2)] [Scalar] > , UGen "BinaryOpUGen" Control 0 [(1,0),(9,0)] [Control] > , UGen "VarSaw" Audio 0 [(10,0),(-1,1),(-1,3)] [Audio] > , UGen "BinaryOpUGen" Audio 2 [(11,0),(-1,3)] [Audio] > , UGen "Sum3" Audio 0 [(12,0),(8,0),(3,0)] [Audio] > , UGen "Rand" Scalar 0 [(-1,4),(-1,5)] [Scalar] > , UGen "Rand" Scalar 0 [(-1,6),(-1,7)] [Scalar] > , UGen "XLine" Control 0 [(14,0),(15,0),(-1,8),(-1,1)] [Control] > , UGen "LPF" Audio 0 [(13,0),(16,0)] [Audio] > , UGen "BinaryOpUGen" Audio 2 [(17,0),(4,0)] [Audio] > , UGen "Pan2" Audio 0 [(18,0),(1,2),(1,1)] [Audio,Audio] > , UGen "OffsetOut" Audio 0 [(0,0),(19,0),(19,1)] [] > ] > [] > ] > > -- > CYa, > ⡍⠁⠗⠊⠕ > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From jeffbrown.the at gmail.com Wed Dec 14 16:28:51 2022 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Wed, 14 Dec 2022 11:28:51 -0500 Subject: [Haskell-cafe] [ANN] Yampa 0.14 In-Reply-To: References: Message-ID: I get excited whenever I see news like this. Thanks, Ivan! What are some candidates for the best GUI apps written in Haskell to date? On Wed, Dec 14, 2022 at 8:57 AM Ivan Perez wrote: > Dear all, > > I'm happy to announce the release of Yampa 0.14! > > Yampa is a fast, elegant Functional Reactive Programming implementation. > Yampa prides itself in being a long-standing community project. It has > now been around for almost 20 years!!! > > See https://github.com/ivanperez-keera/yampa#features for details on > Yampa's features. > > * Summary of Version 0.14 > > - Introduce new type constraint in functions that use VectorSpaces in > order to support simple-affine-space 0.2. This is a breaking change, > and may require applications to update code on their side providing > new instances. > > - Unit tests in the yampa-test library for 2 more modules have been > completed. > > As always, Yampa and yampa-test are released in sync. The CHANGELOGs are > available at: > https://github.com/ivanperez-keera/Yampa/blob/develop/yampa/CHANGELOG > https://github.com/ivanperez-keera/Yampa/blob/develop/yampa-test/CHANGELOG > > * Releases > > You can explore the current versions at: > https://hackage.haskell.org/package/Yampa > https://hackage.haskell.org/package/yampa-test > > * Code > > The github repo is located at: https://github.com/ivanperez-keera/Yampa > > * What's coming > > This release comes exactly 2 months after the last release. The next > release is planned for Feb 7, 2023. > > There are a number of issues open that you are more than welcome to > contribute to: > > https://github.com/ivanperez-keera/Yampa/issues > > Following our roadmap, the pending changes remain as follows: > > - Complete tests: Our goal is to speed up the process of accepting new > features and changes by having a comprehensive test suite that catches > errors early. By automating the tests, we hope to free resources that > can be dedicated to investigating other issues. > > - Full conformance to style guide. > > - Removal of unnecessarily exposed elements from the interface (e.g., > FRP.Yampa.Arrow.arr3) that are not used and belong in other libraries. > This topic is open to discussion. > > - Benchmarks: Facilitate making sound, evidence-based decisions about > suggested improvements to the implementation, by completing a series > of benchmarks. > > - New mailing list: We will in the future lose access to Yale's CS > department-based mailman list, and are thinking of the best place to > move the mailing list to. > > * Donations > > Our project is now seeking donations to help continue developing Yampa, > create new open source libraries, new material, and give talks. > > Special thanks go to @johannes-riecken for sponsoring my work on the > Yampa project with a regular contribution. > > Github will match the first 5K donated, so if you donate $1/month, > github will donate the same amount. > > No donation is too small. Any contribution will absolutely help. > > See https://github.com/sponsors/ivanperez-keera for details. > > If you can help, please come forward. > > All the best, > > Ivan > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Jeff Brown | Jeffrey Benjamin Brown LinkedIn | Github | Twitter | Facebook -------------- next part -------------- An HTML attachment was scrubbed... URL: From twilson at csufresno.edu Wed Dec 14 17:19:30 2022 From: twilson at csufresno.edu (Todd Wilson) Date: Wed, 14 Dec 2022 09:19:30 -0800 Subject: [Haskell-cafe] Interactive book/tutorial platform Message-ID: Hi Cafe, I've taught university Computer Science for 20+ years, many of those using Haskell to both illustrate and have students explore the concepts they learn, and now I'm looking to organize my course materials as interactive books or long-form tutorials for non-commercial release to a larger audience, and I am trying to find an appropriate platform. I've looked at a few possibilities already, such as org-mode, IHaskell notebooks, and some blogging platforms, but all would seem to involve significant configuration before they would be suitable for what I'm trying to achieve. And so I'm inquiring here to see if there are some choices that I hadn't considered, or ready-made configurations for some that I have, which I could look into further and adapt. Ideally, I would like to be able to: - use LaTeX or equivalent for high-quality typesetting (most of my current non-interactive materials are LaTeX documents), - organize content hierarchically, with varying visibility of subsections, so that readers could go into as much detail as needed (extra explanations, examples, diagrams, etc., that could be viewed if desired or easily skipped if not), using cookies to remember each reader's current visibility choices starting from an initial default, - provide code snippets that are executable in place with results incorporated into the document and perhaps modifiable for experimentation, - export to PDF. Suggestions or templates for the above would be very welcome. Thanks, Todd Wilson California State University, Fresno -------------- next part -------------- An HTML attachment was scrubbed... URL: From anandc at mcmaster.ca Wed Dec 14 18:01:34 2022 From: anandc at mcmaster.ca (Anand, Christopher) Date: Wed, 14 Dec 2022 18:01:34 +0000 Subject: [Haskell-cafe] Interactive book/tutorial platform In-Reply-To: References: Message-ID: An HTML attachment was scrubbed... URL: From albert+haskell at zeitkraut.de Wed Dec 14 21:45:24 2022 From: albert+haskell at zeitkraut.de (Albert Krewinkel) Date: Wed, 14 Dec 2022 22:45:24 +0100 Subject: [Haskell-cafe] Interactive book/tutorial platform In-Reply-To: References: Message-ID: <87mt7pvds0.fsf@zeitkraut.de> Hi Todd, given that we're on a Haskell mailing list, I'd like to suggest [Quarto], which is built on top of [pandoc]. The latter is written in Haskell, and both are free and open source. The default input format for Quarto is Markdown, the program can compile diagrams and produces output as HTML, PDF (via LaTeX), and/or Word docx. It's often possible to embed LaTeX where necessary and to use some pandoc [tricks] to convert those LaTeX snippets into other formats when generating non-PDF output. The folding/visibility features would require some extra JavaScript/CSS code though. Please let me know if you have questions, esp. if they are about pandoc, where I'm involved with development. Best, Albert [Quarto]: https://quarto.org [pandoc]: https://pandoc.org [tricks]: https://github.com/tarleb/parse-latex Todd Wilson writes: > Hi Cafe, > > I've taught university Computer Science for 20+ years, many of those > using Haskell to both illustrate and have students explore the > concepts they learn, and now I'm looking to organize my course > materials as interactive books or long-form tutorials for > non-commercial release to a larger audience, and I am trying to find > an appropriate platform. I've looked at a few possibilities already, > such as org-mode, IHaskell notebooks, and some blogging platforms, > but all would seem to involve significant configuration before they > would be suitable for what I'm trying to achieve. And so I'm > inquiring here to see if there are some choices that I hadn't > considered, or ready-made configurations for some that I have, which > I could look into further and adapt. > > Ideally, I would like to be able to: > > use LaTeX or equivalent for high-quality typesetting (most of my > current non-interactive materials are LaTeX documents), > organize content hierarchically, with varying visibility of > subsections, so that readers could go into as much detail as > needed (extra explanations, examples, diagrams, etc., that could > be viewed if desired or easily skipped if not), using cookies to > remember each reader's current visibility choices starting from > an initial default, > provide code snippets that are executable in place with results > incorporated into the document and perhaps modifiable for > experimentation, > export to PDF. > > Suggestions or templates for the above would be very welcome. Thanks, > > Todd Wilson > California State University, Fresno > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Albert Krewinkel GPG: 8eed e3e2 e8c5 6f18 81fe e836 388d c0b2 1f63 1124 From luke.worth at bellroy.com Wed Dec 14 23:25:20 2022 From: luke.worth at bellroy.com (Luke Worth) Date: Thu, 15 Dec 2022 10:25:20 +1100 Subject: [Haskell-cafe] Maintenance takeover: cached-io Message-ID: <9064FC35-9853-4CEB-959B-451514A2BE58@bellroy.com> Hello, We’ve recently started using https://hackage.haskell.org/package/cached-io, but the listed maintainer’s email address is bouncing, and the GitHub repo doesn’t exist any more. It appears that the original repository is https://github.com/glasserc/haskell-cached-io, but I cannot find any way to contact the owner. The fork https://github.com/Arguggi/haskell-cached-io has many useful contributions which ought to be incorporated into the Hackage release, but even the fork has been inactive since 2016. If nobody speaks up by Wednesday 2022-12-21, I’ll submit a takeover request to Hackage admins.  Luke Worth | Senior Software Engineer ——————————— E luke.worth at bellroy.com W bellroy.com -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bellroy_logo_2017.png Type: image/png Size: 10058 bytes Desc: not available URL: From david.feuer at gmail.com Thu Dec 15 02:43:34 2022 From: david.feuer at gmail.com (David Feuer) Date: Wed, 14 Dec 2022 21:43:34 -0500 Subject: [Haskell-cafe] Maintenance takeover: cached-io In-Reply-To: <9064FC35-9853-4CEB-959B-451514A2BE58@bellroy.com> References: <9064FC35-9853-4CEB-959B-451514A2BE58@bellroy.com> Message-ID: The author appears to be active on GitHub. Perhaps you could open a PR against the existing repository with an update? Your PR can request updated contact info and an issue tracker, and offer your services as maintainer. On Wed, Dec 14, 2022, 6:25 PM Luke Worth wrote: > Hello, > > We’ve recently started using https://hackage.haskell.org/package/cached-io, > but the listed maintainer’s email address is bouncing, and the GitHub repo > doesn’t exist any more. > > It appears that the original repository is > https://github.com/glasserc/haskell-cached-io, but I cannot find any way > to contact the owner. > > The fork https://github.com/Arguggi/haskell-cached-io has many useful > contributions which ought to be incorporated into the Hackage release, but > even the fork has been inactive since 2016. > > If nobody speaks up by Wednesday 2022-12-21, I’ll submit a takeover > request to Hackage admins. > > > [image: bellroy_logo_2017.png] > > Luke Worth | Senior Software Engineer > ——————————— > E luke.worth at bellroy.com > W bellroy.com > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bellroy_logo_2017.png Type: image/png Size: 10058 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: bellroy_logo_2017.png Type: image/png Size: 10058 bytes Desc: not available URL: From jondrews at fastmail.com Mon Dec 19 01:13:02 2022 From: jondrews at fastmail.com (Jonathan Drews) Date: Sun, 18 Dec 2022 18:13:02 -0700 Subject: [Haskell-cafe] Request for a presentation on Haskell Message-ID: Hi Folks: I would like to know if anyone from the Haskell organization would like to give a presentation on Haskell to our BSD User Group (BSD = Berkeley Software Development). We are the South Eastern Michigan BSD User Group (http://www.semibug.org/). Myself and several other members are very intereested in Haskell and would like to learn more about this language. You would make the presentation online, by means of Jitsi. The date I am hoping for is January 17th, 2023. I can move that date if need be. The talks are usually given in the evenings. Contact me off list for more details. Thanks in advance. -- Kind regards, Jonathan ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ From ivanperezdominguez at gmail.com Mon Dec 19 04:02:35 2022 From: ivanperezdominguez at gmail.com (Ivan Perez) Date: Sun, 18 Dec 2022 20:02:35 -0800 Subject: [Haskell-cafe] Request for a presentation on Haskell In-Reply-To: References: Message-ID: Jonathan, I might be available, if you are interested. Most of my work is Haskell-centric. I've made commercial games and apps (mobile, desktop, web). In the last 5y I've focused on runtime monitoring and language transformation (very broadly speaking). See https://ivanperez.io/ for details. If you are interested, we can continue the discussion off-list. Thanks, Ivan On Sun, 18 Dec 2022 at 17:13, Jonathan Drews wrote: > Hi Folks: > > I would like to know if anyone from the Haskell organization would > like to give a presentation on Haskell to our BSD User Group (BSD = > Berkeley Software Development). We are the South Eastern Michigan BSD > User Group (http://www.semibug.org/). Myself and several other members > are very intereested in Haskell and would like to learn more about > this language. > > You would make the presentation online, by means of Jitsi. The date I > am hoping for is January 17th, 2023. I can move that date if need be. > The talks are usually given in the evenings. Contact me off list for > more details. > > Thanks in advance. > > -- > Kind regards, > Jonathan > > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jondrews at fastmail.com Mon Dec 19 06:28:49 2022 From: jondrews at fastmail.com (Jonathan Drews) Date: Sun, 18 Dec 2022 23:28:49 -0700 Subject: [Haskell-cafe] Request for a presentation on Haskell In-Reply-To: References: Message-ID: On Sun, Dec 18, 2022 at 08:02:35PM -0800, Ivan Perez wrote: > Jonathan, > > I might be available, if you are interested. Most of my work is > Haskell-centric. I've made commercial games and apps (mobile, desktop, > web). In the last 5y I've focused on runtime monitoring and language > transformation (very broadly speaking). > > See https://ivanperez.io/ for details. > > If you are interested, we can continue the discussion off-list. > > Thanks, > > Ivan > Hello Ivan: I am impressed with your experience. Originally, I asked Emily Pillmore to give the presentation in January and she said yes but the date was not firm. See http://www.semibug.org/ She just wrote me an hour ago saying she would like to do the January presentation. I can move the date for her to accommodate her schedule. For most people Haskell is something they are completely unfamiliar with. The whole concept of functional programming is foreign to their programming experience. So for a first presentation I would like to see: * What are the advantages of Functional programming as opposed to a procedural language like C? * What does the Haskell Foundation do? * What resources and books are good for learning Haskell? My members would be keenly interested in learning about Haskell. I am already convinced it's a terrific language. I am a complete novice programmer and I was able to write a simple program to evaluate double integrals. I did this after reading Scott Walck's book and Miran Lipovaca's book. Look, this is something I never could get to work in C: -- Computes the double integral by the trapezoid rule -- n is half the number of steps for the interval of integraion. -- See the book "Differential and Integral Calculus" -- by Richard Courant,Volume 1, page 343 {- /b /d | | | | f(x,y) dydx | | /a /c or in polar coordinates /R /2*pi | | | | f(r,q) r*dqdr | | /0 /0 dblIntgTrap.hs https://tinyurl.com/38wzfkst Anyway Ivan, you could do a future presentaion on the games and other routines you wrote in Haskell. It's going to take more than one talk for most people to get the hang of Haskell and functional programming. -- Kind regards, Jonathan From ivanperezdominguez at gmail.com Mon Dec 19 06:36:52 2022 From: ivanperezdominguez at gmail.com (Ivan Perez) Date: Sun, 18 Dec 2022 22:36:52 -0800 Subject: [Haskell-cafe] Request for a presentation on Haskell In-Reply-To: References: Message-ID: On Sun, 18 Dec 2022 at 22:29, Jonathan Drews wrote: > On Sun, Dec 18, 2022 at 08:02:35PM -0800, Ivan Perez wrote: > > Jonathan, > > > > [...] I am a complete novice > programmer and I was able to write a simple program to evaluate double > integrals. I did this after reading Scott Walck's book and Miran > Lipovaca's book. Look, this is something I never could get to work in > C > Nice! > Anyway Ivan, you could do a future presentaion on the games and other > routines you wrote in Haskell. It's going to take more than one talk > for most people to get the hang of Haskell and functional programming. > > Sounds good. Let me know. Talks about games are relatively easy to do on a shorter notice (2-3 weeks are good). Talks about my NASA work may require a longer heads up because they require going through a formal approval process (4 weeks are good). All the best, and welcome to the Haskell club :) Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From douglas.mcilroy at dartmouth.edu Mon Dec 19 15:05:07 2022 From: douglas.mcilroy at dartmouth.edu (Douglas McIlroy) Date: Mon, 19 Dec 2022 10:05:07 -0500 Subject: [Haskell-cafe] Haskell-Cafe Digest, Vol 232, Issue 6 In-Reply-To: References: Message-ID: This note is to suggest an approach to introducing Haskell. It is not a pitch for a gig to do so. A big selling point for Haskell is how clean and simple some kinds of Haskell code are. My personal hobby horse of this type is stream processing. Lazy evaluation makes for dramatic simplification, as can be seen in a couple of offerings on my website. I have given talks based on this theme to (mathematically inclined) audiences who have absolutely no Haskell nous. For folks who know freshman calculus, power series computations in Haskell are an eye-opener--no fussing with storage allocation and no subscripts at all! Only rudimentary Haskell ideas need to be discussed to make these functions intelligible. https://www.cs.dartmouth.edu/~doug/powser.html. Another Haskell example, a basic prime-number sieve, reduces a page of C code, or a half-page of shell script to two elegant lines of code. https://www.cs.dartmouth.edu/~doug/sieve/sieve.pdf Doug McIlroy On Mon, Dec 19, 2022 at 7:19 AM wrote: > > Send Haskell-Cafe mailing list submissions to > haskell-cafe at haskell.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > or, via email, send a message with subject or body 'help' to > haskell-cafe-request at haskell.org > > You can reach the person managing the list at > haskell-cafe-owner at haskell.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Haskell-Cafe digest..." > > > Today's Topics: > > 1. Request for a presentation on Haskell (Jonathan Drews) > 2. Re: Request for a presentation on Haskell (Ivan Perez) > 3. Re: Request for a presentation on Haskell (Jonathan Drews) > 4. Re: Request for a presentation on Haskell (Ivan Perez) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Sun, 18 Dec 2022 18:13:02 -0700 > From: Jonathan Drews > To: haskell-cafe at haskell.org > Subject: [Haskell-cafe] Request for a presentation on Haskell > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Hi Folks: > > I would like to know if anyone from the Haskell organization would > like to give a presentation on Haskell to our BSD User Group (BSD = > Berkeley Software Development). We are the South Eastern Michigan BSD > User Group (http://www.semibug.org/). Myself and several other members > are very intereested in Haskell and would like to learn more about > this language. > > You would make the presentation online, by means of Jitsi. The date I > am hoping for is January 17th, 2023. I can move that date if need be. > The talks are usually given in the evenings. Contact me off list for > more details. > > Thanks in advance. > > -- > Kind regards, > Jonathan > > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > ~ > > > > ------------------------------ > > Message: 2 > Date: Sun, 18 Dec 2022 20:02:35 -0800 > From: Ivan Perez > To: Jonathan Drews , Haskell Cafe > > Subject: Re: [Haskell-cafe] Request for a presentation on Haskell > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > Jonathan, > > I might be available, if you are interested. Most of my work is > Haskell-centric. I've made commercial games and apps (mobile, desktop, > web). In the last 5y I've focused on runtime monitoring and language > transformation (very broadly speaking). > > See https://ivanperez.io/ for details. > > If you are interested, we can continue the discussion off-list. > > Thanks, > > Ivan > > On Sun, 18 Dec 2022 at 17:13, Jonathan Drews wrote: > > > Hi Folks: > > > > I would like to know if anyone from the Haskell organization would > > like to give a presentation on Haskell to our BSD User Group (BSD = > > Berkeley Software Development). We are the South Eastern Michigan BSD > > User Group (http://www.semibug.org/). Myself and several other members > > are very intereested in Haskell and would like to learn more about > > this language. > > > > You would make the presentation online, by means of Jitsi. The date I > > am hoping for is January 17th, 2023. I can move that date if need be. > > The talks are usually given in the evenings. Contact me off list for > > more details. > > > > Thanks in advance. > > > > -- > > Kind regards, > > Jonathan > > > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > ~ > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Message: 3 > Date: Sun, 18 Dec 2022 23:28:49 -0700 > From: Jonathan Drews > To: haskell-cafe at haskell.org > Subject: Re: [Haskell-cafe] Request for a presentation on Haskell > Message-ID: > Content-Type: text/plain; charset=us-ascii > > On Sun, Dec 18, 2022 at 08:02:35PM -0800, Ivan Perez wrote: > > Jonathan, > > > > I might be available, if you are interested. Most of my work is > > Haskell-centric. I've made commercial games and apps (mobile, desktop, > > web). In the last 5y I've focused on runtime monitoring and language > > transformation (very broadly speaking). > > > > See https://ivanperez.io/ for details. > > > > If you are interested, we can continue the discussion off-list. > > > > Thanks, > > > > Ivan > > > Hello Ivan: > > I am impressed with your experience. Originally, I asked Emily Pillmore > to give the presentation in January and she said yes but the date was > not firm. See http://www.semibug.org/ > She just wrote me an hour ago saying she would like to do the January > presentation. I can move the date for her to accommodate her schedule. > > For most people Haskell is something they are completely unfamiliar > with. The whole concept of functional programming is foreign to their > programming experience. So for a first presentation I would like to > see: > > * What are the advantages of Functional programming as opposed to a > procedural language like C? > > * What does the Haskell Foundation do? > > * What resources and books are good for learning Haskell? > > My members would be keenly interested in learning about Haskell. I am > already convinced it's a terrific language. I am a complete novice > programmer and I was able to write a simple program to evaluate double > integrals. I did this after reading Scott Walck's book and Miran > Lipovaca's book. Look, this is something I never could get to work in > C: > > -- Computes the double integral by the trapezoid rule > -- n is half the number of steps for the interval of integraion. > -- See the book "Differential and Integral Calculus" > -- by Richard Courant,Volume 1, page 343 > {- > > /b /d > | | > | | f(x,y) dydx > | | > /a /c > or in polar coordinates > > /R /2*pi > | | > | | f(r,q) r*dqdr > | | > /0 /0 > > dblIntgTrap.hs > https://tinyurl.com/38wzfkst > > Anyway Ivan, you could do a future presentaion on the games and other > routines you wrote in Haskell. It's going to take more than one talk > for most people to get the hang of Haskell and functional programming. > > -- > Kind regards, > Jonathan > > > > ------------------------------ > > Message: 4 > Date: Sun, 18 Dec 2022 22:36:52 -0800 > From: Ivan Perez > To: Jonathan Drews > Cc: haskell-cafe at haskell.org > Subject: Re: [Haskell-cafe] Request for a presentation on Haskell > Message-ID: > > Content-Type: text/plain; charset="utf-8" > > On Sun, 18 Dec 2022 at 22:29, Jonathan Drews wrote: > > > On Sun, Dec 18, 2022 at 08:02:35PM -0800, Ivan Perez wrote: > > > Jonathan, > > > > > > [...] I am a complete novice > > programmer and I was able to write a simple program to evaluate double > > integrals. I did this after reading Scott Walck's book and Miran > > Lipovaca's book. Look, this is something I never could get to work in > > C > > > > Nice! > > > > Anyway Ivan, you could do a future presentaion on the games and other > > routines you wrote in Haskell. It's going to take more than one talk > > for most people to get the hang of Haskell and functional programming. > > > > > Sounds good. Let me know. Talks about games are relatively easy to do on a > shorter notice (2-3 weeks are good). Talks about my NASA work may require a > longer heads up because they require going through a formal approval > process (4 weeks are good). > > All the best, and welcome to the Haskell club :) > > Ivan > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > ------------------------------ > > End of Haskell-Cafe Digest, Vol 232, Issue 6 > ******************************************** From frederic-emmanuel.picca at synchrotron-soleil.fr Tue Dec 20 16:13:13 2022 From: frederic-emmanuel.picca at synchrotron-soleil.fr (PICCA Frederic-Emmanuel) Date: Tue, 20 Dec 2022 17:13:13 +0100 (CET) Subject: [Haskell-cafe] lens and Maybe value Message-ID: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> Hello, I have a data whcih contain a Maybe value data A = A (_a = Maybe a) I would like to use a lens in order to merge two values with this log replace the value only if it is a (Just a) So My question is is there something more elegant than let myA' = case ma of Nothing -> conf (Just na) -> (a .~ na) myA Thanks for your help Frederic From david.feuer at gmail.com Tue Dec 20 16:18:12 2022 From: david.feuer at gmail.com (David Feuer) Date: Tue, 20 Dec 2022 11:18:12 -0500 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: Please clarify your question. Your code doesn't compile, and I can't tell what it's supposed to do. On Tue, Dec 20, 2022, 11:13 AM PICCA Frederic-Emmanuel < frederic-emmanuel.picca at synchrotron-soleil.fr> wrote: > Hello, > > I have a data whcih contain a Maybe value > > data A = A (_a = Maybe a) > > I would like to use a lens in order to merge two values with this log > > replace the value only if it is a (Just a) > > So My question is > > is there something more elegant than > > let myA' = case ma of > Nothing -> conf > (Just na) -> (a .~ na) myA > > Thanks for your help > > Frederic > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From frederic-emmanuel.picca at synchrotron-soleil.fr Tue Dec 20 16:25:35 2022 From: frederic-emmanuel.picca at synchrotron-soleil.fr (PICCA Frederic-Emmanuel) Date: Tue, 20 Dec 2022 17:25:35 +0100 (CET) Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> ----- Le 20 Déc 22, à 17:18, David Feuer david.feuer at gmail.com a écrit : > Please clarify your question. Your code doesn't compile, and I can't tell > what it's supposed to do. replace a (Maybe a) value in a data using lens only if the new (Maybe a) is a Just Is it clearer ? From david.feuer at gmail.com Tue Dec 20 16:27:52 2022 From: david.feuer at gmail.com (David Feuer) Date: Tue, 20 Dec 2022 11:27:52 -0500 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: What is conf? If you write a small example that actually compiles, this will be easier to think about. On Tue, Dec 20, 2022, 11:25 AM PICCA Frederic-Emmanuel < frederic-emmanuel.picca at synchrotron-soleil.fr> wrote: > > > ----- Le 20 Déc 22, à 17:18, David Feuer david.feuer at gmail.com a écrit : > > > Please clarify your question. Your code doesn't compile, and I can't tell > > what it's supposed to do. > > > replace a (Maybe a) value in a data using lens only if the new (Maybe a) > is a Just > > Is it clearer ? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Tue Dec 20 16:33:41 2022 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 20 Dec 2022 16:33:41 +0000 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: On Tue, Dec 20, 2022 at 05:25:35PM +0100, PICCA Frederic-Emmanuel wrote: > > Please clarify your question. Your code doesn't compile, and I can't tell > > what it's supposed to do. > > replace a (Maybe a) value in a data using lens only if the new (Maybe a) is a Just How about over a (mb <|>) ? From frederic-emmanuel.picca at synchrotron-soleil.fr Tue Dec 20 16:35:34 2022 From: frederic-emmanuel.picca at synchrotron-soleil.fr (PICCA Frederic-Emmanuel) Date: Tue, 20 Dec 2022 17:35:34 +0100 (CET) Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: <532611313.10097042.1671554134703.JavaMail.zimbra@synchrotron-soleil.fr> import Control.Lens (makeLenses) data A = A { _a = (Maybe Int) } makeLenses A myA = A Nothing ma = Just 1 newA = case ma of Nothing -> myA (Just _) -> (a .~ ma) myA From david.feuer at gmail.com Tue Dec 20 17:43:50 2022 From: david.feuer at gmail.com (David Feuer) Date: Tue, 20 Dec 2022 12:43:50 -0500 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: That's nice and clean, but it leaves a thunk inside (since the field is lazy). Is there a strict version of `over` that avoids this? We could write one thus: over' :: ALens s t a b -> (a -> b) -> s -> t over' l f = getSolo . cloneLens l (\old -> Solo $! f old) where getSolo (Solo x) = x On Tue, Dec 20, 2022, 11:33 AM Tom Ellis < tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote: > On Tue, Dec 20, 2022 at 05:25:35PM +0100, PICCA Frederic-Emmanuel wrote: > > > Please clarify your question. Your code doesn't compile, and I can't > tell > > > what it's supposed to do. > > > > replace a (Maybe a) value in a data using lens only if the new (Maybe a) > is a Just > > How about > > over a (mb <|>) > > ? > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Tue Dec 20 18:57:46 2022 From: david.feuer at gmail.com (David Feuer) Date: Tue, 20 Dec 2022 13:57:46 -0500 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: Actually, a lens is overkill. Any traversal will do. On Tue, Dec 20, 2022, 12:43 PM David Feuer wrote: > That's nice and clean, but it leaves a thunk inside (since the field is > lazy). Is there a strict version of `over` that avoids this? We could write > one thus: > > over' :: ALens s t a b -> (a -> b) -> s -> t > over' l f = getSolo . cloneLens l (\old -> Solo $! f old) > where > getSolo (Solo x) = x > > On Tue, Dec 20, 2022, 11:33 AM Tom Ellis < > tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote: > >> On Tue, Dec 20, 2022 at 05:25:35PM +0100, PICCA Frederic-Emmanuel wrote: >> > > Please clarify your question. Your code doesn't compile, and I can't >> tell >> > > what it's supposed to do. >> > >> > replace a (Maybe a) value in a data using lens only if the new (Maybe >> a) is a Just >> >> How about >> >> over a (mb <|>) >> >> ? >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg.grenrus at iki.fi Tue Dec 20 17:56:26 2022 From: oleg.grenrus at iki.fi (Oleg Grenrus) Date: Tue, 20 Dec 2022 19:56:26 +0200 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> Message-ID: <9f3321cf-1f22-65d2-3137-d561f232a992@iki.fi> over can be only strict for traversals. Consider mapped [1], you cannot turn ordinary `fmap` into strict one. [1]: https://hackage.haskell.org/package/lens-5.2/docs/Control-Lens-Combinators.html#v:mapped Secondly, don't ask for ALens, if you don't need it. LensLike Solo is enough (and works with traversals "for free"). - Oleg On 20.12.2022 19.43, David Feuer wrote: > That's nice and clean, but it leaves a thunk inside (since the field > is lazy). Is there a strict version of `over` that avoids this? We > could write one thus: > > over' :: ALens s t a b -> (a -> b) -> s -> t > over' l f = getSolo . cloneLens l (\old -> Solo $! f old) >   where >     getSolo (Solo x) = x > > On Tue, Dec 20, 2022, 11:33 AM Tom Ellis > wrote: > > On Tue, Dec 20, 2022 at 05:25:35PM +0100, PICCA Frederic-Emmanuel > wrote: > > > Please clarify your question. Your code doesn't compile, and I > can't tell > > > what it's supposed to do. > > > > replace a (Maybe a) value in a data using lens only if the new > (Maybe a) is a Just > > How about > >     over a (mb <|>) > > ? > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Tue Dec 20 19:32:30 2022 From: david.feuer at gmail.com (David Feuer) Date: Tue, 20 Dec 2022 14:32:30 -0500 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: <9f3321cf-1f22-65d2-3137-d561f232a992@iki.fi> References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> <9f3321cf-1f22-65d2-3137-d561f232a992@iki.fi> Message-ID: Ah, yes, I should've thought of LensLike. I know it only works for traversals, but why doesn't it exist in Control.Lens.Traversal? On Tue, Dec 20, 2022, 2:30 PM Oleg Grenrus wrote: > over can be only strict for traversals. Consider mapped [1], you cannot > turn ordinary `fmap` into strict one. > > [1]: > https://hackage.haskell.org/package/lens-5.2/docs/Control-Lens-Combinators.html#v:mapped > > Secondly, don't ask for ALens, if you don't need it. LensLike Solo is > enough (and works with traversals "for free"). > > - Oleg > On 20.12.2022 19.43, David Feuer wrote: > > That's nice and clean, but it leaves a thunk inside (since the field is > lazy). Is there a strict version of `over` that avoids this? We could write > one thus: > > over' :: ALens s t a b -> (a -> b) -> s -> t > over' l f = getSolo . cloneLens l (\old -> Solo $! f old) > where > getSolo (Solo x) = x > > On Tue, Dec 20, 2022, 11:33 AM Tom Ellis < > tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote: > >> On Tue, Dec 20, 2022 at 05:25:35PM +0100, PICCA Frederic-Emmanuel wrote: >> > > Please clarify your question. Your code doesn't compile, and I can't >> tell >> > > what it's supposed to do. >> > >> > replace a (Maybe a) value in a data using lens only if the new (Maybe >> a) is a Just >> >> How about >> >> over a (mb <|>) >> >> ? >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to:http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Tue Dec 20 19:35:18 2022 From: david.feuer at gmail.com (David Feuer) Date: Tue, 20 Dec 2022 14:35:18 -0500 Subject: [Haskell-cafe] lens and Maybe value In-Reply-To: <9f3321cf-1f22-65d2-3137-d561f232a992@iki.fi> References: <1655890267.10090134.1671552793811.JavaMail.zimbra@synchrotron-soleil.fr> <1510879746.10093401.1671553535380.JavaMail.zimbra@synchrotron-soleil.fr> <9f3321cf-1f22-65d2-3137-d561f232a992@iki.fi> Message-ID: What's the principle for choosing between LensLike Solo and ATraversal? On Tue, Dec 20, 2022, 2:30 PM Oleg Grenrus wrote: > over can be only strict for traversals. Consider mapped [1], you cannot > turn ordinary `fmap` into strict one. > > [1]: > https://hackage.haskell.org/package/lens-5.2/docs/Control-Lens-Combinators.html#v:mapped > > Secondly, don't ask for ALens, if you don't need it. LensLike Solo is > enough (and works with traversals "for free"). > > - Oleg > On 20.12.2022 19.43, David Feuer wrote: > > That's nice and clean, but it leaves a thunk inside (since the field is > lazy). Is there a strict version of `over` that avoids this? We could write > one thus: > > over' :: ALens s t a b -> (a -> b) -> s -> t > over' l f = getSolo . cloneLens l (\old -> Solo $! f old) > where > getSolo (Solo x) = x > > On Tue, Dec 20, 2022, 11:33 AM Tom Ellis < > tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote: > >> On Tue, Dec 20, 2022 at 05:25:35PM +0100, PICCA Frederic-Emmanuel wrote: >> > > Please clarify your question. Your code doesn't compile, and I can't >> tell >> > > what it's supposed to do. >> > >> > replace a (Maybe a) value in a data using lens only if the new (Maybe >> a) is a Just >> >> How about >> >> over a (mb <|>) >> >> ? >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to:http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivanperezdominguez at gmail.com Fri Dec 23 16:30:17 2022 From: ivanperezdominguez at gmail.com (Ivan Perez) Date: Fri, 23 Dec 2022 08:30:17 -0800 Subject: [Haskell-cafe] Meetup in Bay area Message-ID: Hi, Is there a Haskell or FP meetup in the Bay area? Cheers, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From mihai.maruseac at gmail.com Fri Dec 23 17:12:21 2022 From: mihai.maruseac at gmail.com (Mihai Maruseac) Date: Fri, 23 Dec 2022 09:12:21 -0800 Subject: [Haskell-cafe] Meetup in Bay area In-Reply-To: References: Message-ID: Hello, There are least the following 2: https://www.meetup.com/bay-area-haskell-user-group/ and https://www.meetup.com/haskellhackers/ There was a group for East Bay too, but it got disbanded when pandemic came. On Fri, Dec 23, 2022 at 8:31 AM Ivan Perez wrote: > Hi, > > Is there a Haskell or FP meetup in the Bay area? > > Cheers, > > Ivan > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Mihai Maruseac (MM) "If you can't solve a problem, then there's an easier problem you can solve: find it." -- George Polya -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at well-typed.com Sat Dec 24 22:36:15 2022 From: ben at well-typed.com (Ben Gamari) Date: Sat, 24 Dec 2022 17:36:15 -0500 Subject: [Haskell-cafe] [ANNOUNCE] GHC 9.4.4 is now available Message-ID: <87k02gbfas.fsf@smart-cactus.org> The GHC developers are happy to announce the availability of GHC 9.4.4. Binary distributions, source distributions, and documentation are available at downloads.haskell.org [1]. This release is primarily a bugfix release. Bugs fixed include: * An issue where the wrong labels were used in the eventlog for events emitted when using info table profiling which was broken in 9.4.3 (#22452) * Fix a long standing bug where invalid eventlogs would be produced with long command-lines (#20221) * Fix a regression in eta-expansion which resulted in serious performance regressions in 9.4.3 (#22424) * Fix the `-fdefer-diagnostics` flag (#22391) * Fixes to several subtle compiler panics (#22491, #22416, #22549, #22475, #22039) * Add necessary write barriers to `IORef` operations, avoiding potential soundness issues on architectures with weakly-ordered memory models (#22468) Note that, as GHC 9.4 is the first release series where the release artifacts are all generated by our new Hadrian build system, it is possible that there will be packaging issues. If you enounter trouble while using a binary distribution, please open a [ticket]. Likewise, if you are a downstream packager, do consider migrating to [Hadrian] to run your build; the Hadrian build system can be built using `cabal-install`, `stack`, or the in-tree [bootstrap script]. See the accompanying [blog post] for details on migrating packaging to Hadrian. We would also like to emphasize that GHC 9.4 must be used in conjunction with Cabal-3.8 or later. This is particularly important for Windows users due to changes in GHC's Windows toolchain. We would like to thank Microsoft Azure, GitHub, IOG, the Zw3rk stake pool, Well-Typed, Tweag I/O, Serokell, Equinix, SimSpace, Haskell Foundation, and other anonymous contributors whose on-going financial and in-kind support has facilitated GHC maintenance and release management over the years. Finally, this release would not have been possible without the hundreds of open-source contributors whose work comprise this release. As always, do give this release a try and open a [ticket] if you see anything amiss. Happy Haskelling, - Ben [1]: https://downloads.haskell.org/ghc/9.4.4 [ticket]: https://gitlab.haskell.org/ghc/ghc/-/issues/new [bootstrap script]: https://gitlab.haskell.org/ghc/ghc/-/blob/e2520df3fffa0cf22fb19c5fb872832d11c07d35/hadrian/bootstrap/README.md [Hadrian]: https://gitlab.haskell.org/ghc/ghc/-/blob/e2520df3fffa0cf22fb19c5fb872832d11c07d35/hadrian [blog post]: https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 487 bytes Desc: not available URL: From david.feuer at gmail.com Sun Dec 25 00:00:02 2022 From: david.feuer at gmail.com (David Feuer) Date: Sat, 24 Dec 2022 19:00:02 -0500 Subject: [Haskell-cafe] [ANNOUNCE] GHC 9.4.4 is now available In-Reply-To: <87k02gbfas.fsf@smart-cactus.org> References: <87k02gbfas.fsf@smart-cactus.org> Message-ID: Does this release include the fix for #22549 (infinite loops for some undecidable instances)? On Sat, Dec 24, 2022, 5:36 PM Ben Gamari wrote: > The GHC developers are happy to announce the availability of GHC 9.4.4. > Binary > distributions, source distributions, and documentation are available at > downloads.haskell.org [1]. > > This release is primarily a bugfix release. Bugs fixed include: > > * An issue where the wrong labels were used in the eventlog for events > emitted > when using info table profiling which was broken in 9.4.3 (#22452) > > * Fix a long standing bug where invalid eventlogs would be produced with > long > command-lines (#20221) > > * Fix a regression in eta-expansion which resulted in serious performance > regressions in 9.4.3 (#22424) > > * Fix the `-fdefer-diagnostics` flag (#22391) > > * Fixes to several subtle compiler panics > (#22491, #22416, #22549, #22475, #22039) > > * Add necessary write barriers to `IORef` operations, avoiding potential > soundness issues on architectures with weakly-ordered memory models > (#22468) > > Note that, as GHC 9.4 is the first release series where the release > artifacts > are all generated by our new Hadrian build system, it is possible that > there > will be packaging issues. If you enounter trouble while using a binary > distribution, please open a [ticket]. Likewise, if you are a downstream > packager, do consider migrating to [Hadrian] to run your build; the Hadrian > build system can be built using `cabal-install`, `stack`, or the in-tree > [bootstrap script]. See the accompanying [blog post] for details on > migrating packaging to Hadrian. > > We would also like to emphasize that GHC 9.4 must be used in conjunction > with > Cabal-3.8 or later. This is particularly important for Windows users due to > changes in GHC's Windows toolchain. > > We would like to thank Microsoft Azure, GitHub, IOG, the Zw3rk stake pool, > Well-Typed, Tweag I/O, Serokell, Equinix, SimSpace, Haskell Foundation, and > other anonymous contributors whose on-going financial and in-kind support > has > facilitated GHC maintenance and release management over the years. Finally, > this release would not have been possible without the hundreds of > open-source > contributors whose work comprise this release. > > As always, do give this release a try and open a [ticket] if you see > anything amiss. > > Happy Haskelling, > > - Ben > > > [1]: https://downloads.haskell.org/ghc/9.4.4 > [ticket]: https://gitlab.haskell.org/ghc/ghc/-/issues/new > [bootstrap script]: > https://gitlab.haskell.org/ghc/ghc/-/blob/e2520df3fffa0cf22fb19c5fb872832d11c07d35/hadrian/bootstrap/README.md > [Hadrian]: > https://gitlab.haskell.org/ghc/ghc/-/blob/e2520df3fffa0cf22fb19c5fb872832d11c07d35/hadrian > [blog post]: > https://www.haskell.org/ghc/blog/20220805-make-to-hadrian.html > _______________________________________________ > Glasgow-haskell-users mailing list > Glasgow-haskell-users at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at well-typed.com Sun Dec 25 03:29:00 2022 From: ben at well-typed.com (Ben Gamari) Date: Sat, 24 Dec 2022 22:29:00 -0500 Subject: [Haskell-cafe] [ANNOUNCE] GHC 9.4.4 is now available In-Reply-To: References: <87k02gbfas.fsf@smart-cactus.org> Message-ID: <87h6xkb1qv.fsf@smart-cactus.org> David Feuer writes: > Does this release include the fix for #22549 (infinite loops for some > undecidable instances)? > Yes, it includes a backport of !9485. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 487 bytes Desc: not available URL: From david.feuer at gmail.com Sun Dec 25 03:35:36 2022 From: david.feuer at gmail.com (David Feuer) Date: Sat, 24 Dec 2022 22:35:36 -0500 Subject: [Haskell-cafe] [ANNOUNCE] GHC 9.4.4 is now available In-Reply-To: <87h6xkb1qv.fsf@smart-cactus.org> References: <87k02gbfas.fsf@smart-cactus.org> <87h6xkb1qv.fsf@smart-cactus.org> Message-ID: Excellent! On Sat, Dec 24, 2022, 10:29 PM Ben Gamari wrote: > David Feuer writes: > > > Does this release include the fix for #22549 (infinite loops for some > > undecidable instances)? > > > Yes, it includes a backport of !9485. > > Cheers, > > - Ben > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zubin at well-typed.com Mon Dec 26 15:10:41 2022 From: zubin at well-typed.com (Zubin Duggal) Date: Mon, 26 Dec 2022 20:40:41 +0530 Subject: [Haskell-cafe] [Haskell] [ANNOUNCE] Haskell Language Server 1.9.0.0 released Message-ID: <20221226150914.sgl6jyjkifkp7joh@zubin-pc> Binaries for this release are available at https://downloads.haskell.org/~hls/haskell-language-server-1.9.0.0/ The prebuilt binaries in this release support the following GHC versions: - 8.10.7 - 9.0.2 - 9.2.5 - 9.4.3 - 9.4.4 These binaries can be installed using [GHCup](https://www.haskell.org/ghcup/) or version [2.0.0 and above](https://github.com/haskell/vscode-haskell/releases) of the VSCode extension. ## Changelog - Binaries for GHC 9.4.3, GHC 9.4.4 and GHC 9.2.5. - Dropped support for GHC 8.8 and GHC 8.10. - New plugins including: - Expanding record wild cards using hls-explicit-record-fields-plugin (#3304). - Formatting cabal fields using cabal-fmt via hls-cabal-fmt-plugin (#2047). - Warnings and errors for cabal files using hls-cabal-plugin (#2954). - Folding ranges using hls-code-range-plugin (#3058). - Support for many plugins like the refactor, splice, retrie, gadt, hlint, fourmolu and class plugins. - Completion for record dot fields (#3080). - Performance and memory usage improvements. - And many more bug fixes and improvements! For the full release notes, see https://github.com/haskell/haskell-language-server/releases/tag/1.9.0.0 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: From zubin at well-typed.com Mon Dec 26 15:53:39 2022 From: zubin at well-typed.com (Zubin Duggal) Date: Mon, 26 Dec 2022 21:23:39 +0530 Subject: [Haskell-cafe] [Haskell] [ANNOUNCE] Haskell Language Server 1.9.0.0 released In-Reply-To: <20221226150914.sgl6jyjkifkp7joh@zubin-pc> References: <20221226150914.sgl6jyjkifkp7joh@zubin-pc> Message-ID: <20221226155339.q6te4k4ilorc7dvb@zubin-pc> The changelog entry reading >- Dropped support for GHC 8.8 and GHC 8.10. Should actually be >- Dropped support for GHC 8.6 and GHC 8.8. My apologies for the typo! -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Wed Dec 28 20:38:04 2022 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 28 Dec 2022 20:38:04 +0000 Subject: [Haskell-cafe] Best way to implement "scoped exceptions"? Message-ID: I'd like to implement "scoped exceptions"[1], that is, a combinator of type withScopedException :: ((forall a. e -> IO a) -> IO r) -> IO (Either e r) so I can use exceptions in a convenient way, without having to set up fragile "action at a distance" based on the type of the thing I'm throwing and catching, for example: scopedExceptionExample :: IO (Either String (Either Int Void)) scopedExceptionExample = do withScopedException $ \throw1 -> withScopedException $ \throw2 -> if (1 :: Int) < 0 then throw1 "Hello" else throw2 1234 -- ghci> scopedExceptionExample -- Right (Left 1234) Here's a hacky way of doing it, based on tagging each exception with a unique value, and then filtering when handling: data MyException where MyException :: e -> Data.Unique.Unique -> MyException instance Show MyException where show _ = "" instance Exception MyException withScopedException :: ((forall a. e -> IO a) -> IO r) -> IO (Either e r) wiathScopedException f = do fresh <- Data.Unique.newUnique flip tryJust (f (\e -> throwIO (MyException e fresh))) $ \case MyException e tag -> -- unsafeCoerce is very unpleasant if tag == fresh then Just (unsafeCoerce e) else Nothing This is the approach taken by the effectful library[2]. But is there a better way? Can I persuade GHC's RTS to work like this directly? Tom [1] I don't know if these already have a name [2] https://hackage.haskell.org/package/effectful-core-2.2.1.0/docs/src/Effectful.Error.Static.html#catchError From haskellcafe at dandart.co.uk Wed Dec 28 21:19:20 2022 From: haskellcafe at dandart.co.uk (Dan Dart) Date: Wed, 28 Dec 2022 21:19:20 +0000 Subject: [Haskell-cafe] Best way to implement "scoped exceptions"? In-Reply-To: References: Message-ID: Sounds to me a bit like CPS - so maybe something like callCC: https://hackage.haskell.org/package/transformers-0.6.0.4/docs/Control-Monad-Trans-Cont.html#v:callCC From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Thu Dec 29 13:02:06 2022 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Thu, 29 Dec 2022 13:02:06 +0000 Subject: [Haskell-cafe] Best way to implement "scoped exceptions"? In-Reply-To: References: Message-ID: On Wed, Dec 28, 2022 at 09:19:20PM +0000, Dan Dart wrote: > Sounds to me a bit like CPS - so maybe something like callCC: > https://hackage.haskell.org/package/transformers-0.6.0.4/docs/Control-Monad-Trans-Cont.html#v:callCC Thanks. There is some element of CPS to it, although in this case I'm specifically looking for an API that's plugged in to how GHC's RTS treats exceptions. From lysxia at gmail.com Thu Dec 29 13:31:47 2022 From: lysxia at gmail.com (Li-yao Xia) Date: Thu, 29 Dec 2022 13:31:47 +0000 Subject: [Haskell-cafe] Best way to implement "scoped exceptions"? In-Reply-To: References: Message-ID: The recently implemented Delimited Continuation Primops proposal[1] features tagged prompts. That seems like just what you are looking for. [1]: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0313-delimited-continuation-primops.rst On 2022-12-29 1:02 PM, Tom Ellis wrote: > On Wed, Dec 28, 2022 at 09:19:20PM +0000, Dan Dart wrote: >> Sounds to me a bit like CPS - so maybe something like callCC: >> https://hackage.haskell.org/package/transformers-0.6.0.4/docs/Control-Monad-Trans-Cont.html#v:callCC > Thanks. There is some element of CPS to it, although in this case I'm > specifically looking for an API that's plugged in to how GHC's RTS > treats exceptions. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Thu Dec 29 15:41:22 2022 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Thu, 29 Dec 2022 15:41:22 +0000 Subject: [Haskell-cafe] Best way to implement "scoped exceptions"? In-Reply-To: References: Message-ID: On Thu, Dec 29, 2022 at 01:31:47PM +0000, Li-yao Xia wrote: > The recently implemented Delimited Continuation Primops proposal[1] features > tagged prompts. That seems like just what you are looking for. > > [1]: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0313-delimited-continuation-primops.rst Very interesting, thanks! My initial attempt at implementing scoped exceptions using the delimited continuation primops was bad: withScopedExceptionBad :: ((e -> IO (Either e r)) -> IO r) -> IO (Either e r) withScopedExceptionBad body = do promptTag <- newPromptTag prompt promptTag $ do l <- control0 promptTag $ \myThrow -> do r <- body (myThrow . pure) pure (Right r) pure (Left l) It was very head-scratching trying to work out how it should be implemented. Then with the help of a gist by sebfisch[1] I managed it: withScopedException :: ((forall a. e -> IO a) -> IO r) -> IO (Either e r) withScopedException body = do promptTag <- newPromptTag prompt promptTag $ do r <- body (\e -> control0 promptTag (\_ -> pure (Left e))) pure (Right r) Surprisingly to me, for scoped exceptions, the handler passed to control0 should *ignore* its argument. That's because its argument allows it to escape from the call to control0, but we want to escape from the call to prompt. This is very powerful and mind-bending stuff and allows me to do exactly what I wanted. Thanks Li-yao! Tom [1] https://gist.github.com/sebfisch/2235780 From leah at vuxu.org Fri Dec 30 15:46:01 2022 From: leah at vuxu.org (Leah Neukirchen) Date: Fri, 30 Dec 2022 16:46:01 +0100 Subject: [Haskell-cafe] Special holiday Munich Haskell Meeting, 2023-01-04 @ 19:30 Message-ID: <87pmc0opxi.fsf@vuxu.org> Dear all, Next week, our special holiday Munich Haskell Meeting will take place on Wednesday, January 4 at Augustiner-Gaststätte Rumpler at 19h30. For details see here: http://muenchen.haskell.bayern/dates.html If you plan to join, please add yourself to this nuudel so we can reserve enough seats! It is OK to add yourself to the dudle anonymously or pseudonymously. https://nuudel.digitalcourage.de/cs8eLiDLkwZEd5hO Everybody is welcome! cu, -- Leah Neukirchen https://leahneukirchen.org/