From magnus at therning.org Sun Nov 1 09:43:19 2020 From: magnus at therning.org (Magnus Therning) Date: Sun, 01 Nov 2020 10:43:19 +0100 Subject: [Haskell-cafe] Hackage and searching for substrings Message-ID: <87361tquo8.fsf@therning.org> Just now I thought I'd check what kind of lib waargonaut is. Being lazy I typed "waarg" into the package search box and found nothing! Is there a way to make Hackage find waargonaut without having to type the full package name? /M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus at therning.org twitter: magthe http://magnus.therning.org/ It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. — Mark Twain -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 861 bytes Desc: not available URL: From taylor at fausak.me Sun Nov 1 13:12:44 2020 From: taylor at fausak.me (Taylor Fausak) Date: Sun, 01 Nov 2020 08:12:44 -0500 Subject: [Haskell-cafe] 2020 State of Haskell Survey Message-ID: <4b3bdfaa-125f-4a89-b60b-c12d44b99c06@www.fastmail.com> Hi friends! I am very excited to announce the fourth annual state of Haskell survey. It opens today (the 1st) and stays open for two weeks (the 15th). I would greatly appreciate it if you could take 10 minutes to fill it out. Thanks! https://haskellweekly.news/survey/2020.html From fa-ml at ariis.it Sun Nov 1 16:40:07 2020 From: fa-ml at ariis.it (Francesco Ariis) Date: Sun, 1 Nov 2020 17:40:07 +0100 Subject: [Haskell-cafe] Hackage and searching for substrings In-Reply-To: <87361tquo8.fsf@therning.org> References: <87361tquo8.fsf@therning.org> Message-ID: <20201101164007.GA14953@extensa> Il 01 novembre 2020 alle 10:43 Magnus Therning ha scritto: > Is there a way to make Hackage find waargonaut without having to type > the full package name? Not the same, but… https://html.duckduckgo.com/html?q=site%3Ahackage.haskell.org%20waarg From magnus at therning.org Sun Nov 1 17:09:26 2020 From: magnus at therning.org (Magnus Therning) Date: Sun, 01 Nov 2020 18:09:26 +0100 Subject: [Haskell-cafe] Hackage and searching for substrings In-Reply-To: <20201101164007.GA14953@extensa> References: <87361tquo8.fsf@therning.org> <20201101164007.GA14953@extensa> Message-ID: <87blghknqx.fsf@therning.org> Francesco Ariis writes: > Il 01 novembre 2020 alle 10:43 Magnus Therning ha scritto: >> Is there a way to make Hackage find waargonaut without having to type >> the full package name? > > Not the same, but… > https://html.duckduckgo.com/html?q=site%3Ahackage.haskell.org%20waarg Yes, that's certainly an option. Just that `!hackage waarg` would be a lot nicer to write than `site:hackage.haskell.org waarg` :) /M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus at therning.org twitter: magthe http://magnus.therning.org/ I am always doing that which I cannot do, in order that I may learn how to do it. — Pablo Picasso -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 861 bytes Desc: not available URL: From lemming at henning-thielemann.de Sun Nov 1 17:34:35 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sun, 1 Nov 2020 18:34:35 +0100 (CET) Subject: [Haskell-cafe] Hackage and searching for substrings In-Reply-To: <87blghknqx.fsf@therning.org> References: <87361tquo8.fsf@therning.org> <20201101164007.GA14953@extensa> <87blghknqx.fsf@therning.org> Message-ID: On Sun, 1 Nov 2020, Magnus Therning wrote: > Francesco Ariis writes: > >> Il 01 novembre 2020 alle 10:43 Magnus Therning ha scritto: >>> Is there a way to make Hackage find waargonaut without having to type >>> the full package name? >> >> Not the same, but… >> https://html.duckduckgo.com/html?q=site%3Ahackage.haskell.org%20waarg > > Yes, that's certainly an option. Just that `!hackage waarg` would be a > lot nicer to write than `site:hackage.haskell.org waarg` :) I guess you can configure your browser to expand the former to the latter. From charukiewicz at protonmail.com Sun Nov 1 18:37:51 2020 From: charukiewicz at protonmail.com (Christian Charukiewicz) Date: Sun, 01 Nov 2020 18:37:51 +0000 Subject: [Haskell-cafe] Hackage and searching for substrings In-Reply-To: References: <87361tquo8.fsf@therning.org> <20201101164007.GA14953@extensa> <87blghknqx.fsf@therning.org> Message-ID: You certainly can. Someone gave a great example on Twitter of doing this for a custom GitHub search: https://twitter.com/HamelHusain/status/1307353823216762880 ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Sunday, November 1st, 2020 at 11:34, Henning Thielemann lemming at henning-thielemann.de wrote: > On Sun, 1 Nov 2020, Magnus Therning wrote: > >> Francesco Ariis fa-ml at ariis.it writes: >> >>> Il 01 novembre 2020 alle 10:43 Magnus Therning ha scritto: >>> >>>> Is there a way to make Hackage find waargonaut without having to type >>>> >>>> the full package name? >>> >>> Not the same, but… >>> >>> https://html.duckduckgo.com/html?q=site%3Ahackage.haskell.org waarg >> >> Yes, that's certainly an option. Just that !hackage waarg would be a >> >> lot nicer to write than site:hackage.haskell.org waarg :) > > I guess you can configure your browser to expand the former to the latter._______________________________________________ > > 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 ietf-dane at dukhovni.org Sun Nov 1 20:56:18 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Sun, 1 Nov 2020 15:56:18 -0500 Subject: [Haskell-cafe] Hackage and searching for substrings In-Reply-To: <87361tquo8.fsf@therning.org> References: <87361tquo8.fsf@therning.org> Message-ID: <20201101205618.GN1464@straasha.imrryr.org> On Sun, Nov 01, 2020 at 10:43:19AM +0100, Magnus Therning wrote: > Just now I thought I'd check what kind of lib waargonaut is. Being lazy > I typed "waarg" into the package search box and found nothing! > > Is there a way to make Hackage find waargonaut without having to type > the full package name? Hoogle does the job quite nicely, and finds matches as you type: https://hoogle.haskell.org/ Just typing "waa" was sufficient to exclude false-positives. -- Viktor. From duke.j.david at gmail.com Sun Nov 1 22:05:23 2020 From: duke.j.david at gmail.com (David Duke) Date: Sun, 1 Nov 2020 22:05:23 +0000 Subject: [Haskell-cafe] GHC-8.6.3 question. In-Reply-To: <3cfda95bdc841d977c6300580628a82a@jackkelly.name> References: <3cfda95bdc841d977c6300580628a82a@jackkelly.name> Message-ID: Thanks Jack. I have used ghcup previously but had forgotten about it - one problem solved! regards David On Sat, Oct 31, 2020 at 8:38 PM wrote: > Hello David, > > November 1, 2020 4:35 AM, "David Duke" wrote: > > > I'm in the process of having to reinstall ghc-8.6.3 in order to use a > library (gtk) where the last > > successful build is 8.6.3. I was able to do that on linux. However I'm > now trying to repeat this > > under OSX. > > I don't use macOS so I can't answer your build question directly, but do > you use ghcup ( https://www.haskell.org/ghcup/ ) to manage your GHC > versions? It looks like ghcup has been told about 8.6.3 on darwin: > https://gitlab.haskell.org/haskell/ghcup/-/blob/8f4705a50eefafd92ceef32094eec7140885b3d5/.download-urls#L99 > > HTH, > > -- Jack > -- David Duke Emeritus Professor of Computer Science School of Computing University of Leeds UK E:duke.j.david at gmail.com W:https://engineering.leeds.ac.uk/staff/334/Professor_David_Duke -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Mon Nov 2 13:23:31 2020 From: magnus at therning.org (Magnus Therning) Date: Mon, 02 Nov 2020 14:23:31 +0100 Subject: [Haskell-cafe] Hackage and searching for substrings In-Reply-To: <87361tquo8.fsf@therning.org> References: <87361tquo8.fsf@therning.org> Message-ID: <87wnz36gfg.fsf@therning.org> Magnus Therning writes: > Just now I thought I'd check what kind of lib waargonaut is. Being lazy > I typed "waarg" into the package search box and found nothing! > > Is there a way to make Hackage find waargonaut without having to type > the full package name? Interpreting the responses so far I guess the correct answer to my question is "no!" /M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus at therning.org twitter: magthe http://magnus.therning.org/ Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness. — Pablo Picasso -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 861 bytes Desc: not available URL: From andrew.thaddeus at gmail.com Mon Nov 2 14:15:16 2020 From: andrew.thaddeus at gmail.com (Andrew Martin) Date: Mon, 2 Nov 2020 09:15:16 -0500 Subject: [Haskell-cafe] Intention to take over the pipes-text package In-Reply-To: <87v9esk5bb.fsf@devalot.com> References: <87v9esk5bb.fsf@devalot.com> Message-ID: For what it's worth, I took over some of Michael Thompson's other libraries (streaming and streaming-bytestring) about two years ago. He is no longer active on GitHub and was not responsive to email at the time. On Thu, Oct 29, 2020 at 7:00 PM Peter J. Jones via Haskell-Cafe < haskell-cafe at haskell.org> wrote: > (This is a re-post from October 6, 2020 since the original did not make > it into the archive.) > > The pipes-text [1] package on Hackage hasn't been updated in about 4 > years and doesn't currently build due to outdated `build-depends'. > > Patches have been supplied to the GitHub [2] repository but none have > been merged. The last commit was on Dec 2, 2016. > > I have attempted to reach out to the author (Michael Thompson) to offer > assistance and have not received any response. > > As per the instructions on the Haskell Wiki, I'm posting this message to > signal my intent to take over the pipes-text package as a maintainer. I > have a working fork here [3]. > > Michael, if you prefer to keep the package under your control I'm more > than happy to help you manage the GitHub project and get some patches > merged. Otherwise I'll reach out to the Hackage administrators after a > reasonable amount of time has passed. > > [1]: https://hackage.haskell.org/package/pipes-text > [2]: https://github.com/michaelt/text-pipes > [3]: https://github.com/pjones/pipes-text > _______________________________________________ > 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. -- -Andrew Thaddeus Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: From lysxia at gmail.com Mon Nov 2 14:35:17 2020 From: lysxia at gmail.com (Li-yao Xia) Date: Mon, 2 Nov 2020 09:35:17 -0500 Subject: [Haskell-cafe] Hackage and searching for substrings In-Reply-To: <87wnz36gfg.fsf@therning.org> References: <87361tquo8.fsf@therning.org> <87wnz36gfg.fsf@therning.org> Message-ID: Hi Magnus, One approximation of that idea is to use hoogle: https://hoogle.haskell.org/?hoogle=is%3Apackage%20waar (note the "is:package" key to avoid looking for identifiers inside packages) Li-yao On 11/2/2020 8:23 AM, Magnus Therning wrote: > > Magnus Therning writes: > >> Just now I thought I'd check what kind of lib waargonaut is. Being lazy >> I typed "waarg" into the package search box and found nothing! >> >> Is there a way to make Hackage find waargonaut without having to type >> the full package name? > > Interpreting the responses so far I guess the correct answer to my > question is "no!" > > /M > > -- > Magnus Therning OpenPGP: 0x927912051716CE39 > email: magnus at therning.org > twitter: magthe http://magnus.therning.org/ > > Ah, good taste! What a dreadful thing! Taste is the enemy of > creativeness. > — Pablo Picasso > > > _______________________________________________ > 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 Graham.Hutton at nottingham.ac.uk Tue Nov 3 09:52:19 2020 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Tue, 3 Nov 2020 09:52:19 +0000 Subject: [Haskell-cafe] Journal of Functional Programming - Call for PhD Abstracts Message-ID: <8C3FB908-F501-4AC7-88B1-FD032F9E86D8@nottingham.ac.uk> Dear all, If you or one of your students recently completed a PhD in the area of functional programming, please submit the dissertation abstract for publication in JFP: simple process, no refereeing, open access, 200 published to date, deadline 30th November 2020. Please share! Best wishes, Graham Hutton ============================================================ CALL FOR PHD ABSTRACTS Journal of Functional Programming Deadline: 30th November 2020 http://tinyurl.com/jfp-phd-abstracts ============================================================ PREAMBLE: Many students complete PhDs in functional programming each year. As a service to the community, twice per year the Journal of Functional Programming publishes the abstracts from PhD dissertations completed during the previous year. The abstracts are made freely available on the JFP website, i.e. not behind any paywall. They do not require any transfer of copyright, merely a license from the author. A dissertation is eligible for inclusion if parts of it have or could have appeared in JFP, that is, if it is in the general area of functional programming. The abstracts are not reviewed. Please submit dissertation abstracts according to the instructions below. We welcome submissions from both the PhD student and PhD advisor/supervisor although we encourage them to coordinate. ============================================================ SUBMISSION: Please submit the following information to Graham Hutton by 30th November 2020: o Dissertation title: (including any subtitle) o Student: (full name) o Awarding institution: (full name and country) o Date of PhD award: (month and year; depending on the institution, this may be the date of the viva, corrections being approved, graduation ceremony, or otherwise) o Advisor/supervisor: (full names) o Dissertation URL: (please provide a permanently accessible link to the dissertation if you have one, such as to an institutional repository or other public archive; links to personal web pages should be considered a last resort) o Dissertation abstract: (plain text, maximum 350 words; you may use \emph{...} for emphasis, but we prefer no other markup or formatting; if your original abstract exceeds the word limit, please submit an abridged version within the limit) Please do not submit a copy of the dissertation itself, as this is not required. JFP reserves the right to decline to publish abstracts that are not deemed appropriate. ============================================================ PHD ABSTRACT EDITOR: Graham Hutton School of Computer Science University of Nottingham Nottingham NG8 1BB United Kingdom ============================================================ This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From rae at richarde.dev Tue Nov 3 18:15:19 2020 From: rae at richarde.dev (Richard Eisenberg) Date: Tue, 3 Nov 2020 18:15:19 +0000 Subject: [Haskell-cafe] Tomorrow: Simon PJ announces Haskell Foundation Message-ID: <010f01758f520a5c-ffadd00c-9d88-417b-b99d-5c948136bc2b-000000@us-east-2.amazonses.com> Tomorrow (Wednesday Nov 4) at 12:00 UTC, Simon PJ will announce the formation of the Haskell Foundation, an independent, non-profit organization dedicated to broadening Haskell adoption. This will be a part of Haskell eXchange, but this announcement will be free to attend, via YouTube. Much of the presentation will be time for Q&A; questions can be posed both within the Haskell eXchange HopIn platform and via comments on YouTube. Attend at https://youtu.be/MEmRarBL9kw Just to forestall any disappointment: I won't be answering any questions here until at least after the announcement -- but do please come and ask questions there and afterwards. Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From mgajda at mimuw.edu.pl Wed Nov 4 09:49:11 2020 From: mgajda at mimuw.edu.pl (Michal J Gajda) Date: Wed, 4 Nov 2020 10:49:11 +0100 Subject: [Haskell-cafe] Looking for maintainers or comaintainers on my Haskell projects Message-ID: Hi Chris., > If you want to take xeno and make it into a publishable package, please do so. We have offered to take over xeno over a year ago, and this offer still stands backed by me personally. Since I have made a few contributions, you may know that I would deliver here. To add me as maintainer on Hackage: MichalGajda To add me on GitHub: mgajda -- Cheers Michał From rae at richarde.dev Wed Nov 4 14:00:39 2020 From: rae at richarde.dev (Richard Eisenberg) Date: Wed, 4 Nov 2020 14:00:39 +0000 Subject: [Haskell-cafe] Announcing the Haskell Foundation Message-ID: <010f0175938f3c13-4a2fb1a4-40bf-4d14-abbb-e7ec70fc7add-000000@us-east-2.amazonses.com> I'm very pleased to announce the creation of the Haskell Foundation (HF), an independent, non-profit organisation dedicated to broadening Haskell adoption. Website: https://haskell.foundation/ Twitter: @haskellfound Founding whitepaper: https://haskell.foundation/whitepaper/ Simon Peyton Jones's announcement, with lots of Q&A: https://www.youtube.com/watch?v=MEmRarBL9kw The "official" ask-me-anything on Reddit: https://www.reddit.com/r/haskell/comments/jnwg7i/haskell_foundation_ama/ Mailing list for future HF announcements: https://mail.haskell.org/cgi-bin/mailman/listinfo/hf-announce Mailing list for HF discussion / involvement: https://mail.haskell.org/cgi-bin/mailman/listinfo/hf-discuss Please join the conversation. We need your participation to realize the vision of the foundation as *our* foundation, not *their* foundation. Looking forward to seeing where this all leads! Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity at googlemail.com Thu Nov 5 02:56:11 2020 From: icfp.publicity at googlemail.com (Sam Tobin-Hochstadt) Date: Wed, 04 Nov 2020 21:56:11 -0500 Subject: [Haskell-cafe] Call for Workshop Proposals: ICFP 2021 Message-ID: <5fa369cbc923a_5b58f2941638@homer.mail> CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS ICFP 2021 26th ACM SIGPLAN International Conference on Functional Programming August 22 - 27, 2021 Daejon, Korea https://icfp21.sigplan.org/ The 26th ACM SIGPLAN International Conference on Functional Programming will be held in Daejon, Korea on August 22-27, 2021, with the possibility of a virtual conference. ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. Proposals are invited for workshops (and other co-located events, such as symposiums) to be affiliated with ICFP 2021 and sponsored by SIGPLAN. These events should be less formal and more focused than ICFP itself, include sessions that enable interaction among the attendees, and foster the exchange of new ideas. The preference is for one-day events, but other schedules can also be considered. The workshops are scheduled to occur on August 22rd (the day before ICFP) and 26-27th of August (the two days after ICFP). ---------------------------------------------------------------------- Submission details Deadline for submission: November 27, 2020 Notification of acceptance: December 15, 2020 Prospective organizers of workshops or other co-located events are invited to submit a completed workshop proposal form in plain text format to the ICFP 2021 workshop co-chairs (Leonidas Lampropoulos and Zoe Paraskevopoulou) via email to icfp-workshops-2021 at googlegroups.com by November 27, 2020. (For proposals of co-located events other than workshops, please fill in the workshop proposal form and just leave blank any sections that do not apply.) Please note that this is a firm deadline. Organizers will be notified if their event proposal is accepted by December 15, 2020, and if successful, depending on the event, they will be asked to produce a final report after the event has taken place that is suitable for publication in SIGPLAN Notices. The proposal form is available at: http://www.icfpconference.org/icfp2021-files/icfp21-workshops-form.txt Further information about SIGPLAN sponsorship is available at: http://www.sigplan.org/Resources/Proposals/Sponsored/ ---------------------------------------------------------------------- Selection committee The proposals will be evaluated by a committee comprising the following members of the ICFP 2021 organizing committee, together with the members of the SIGPLAN executive committee. Workshop Co-Chair: Zoe Paraskevopoulou (Northeastern University) Workshop Co-Chair: Leonidas Lampropoulos (University of Maryland) General Chair: Sukyoung Ryu (KAIST) Program Chair: Ronald Garcia (University of British Columbia) ---------------------------------------------------------------------- Further information Any queries should be addressed to the workshop co-chairs (Zoe Paraskevopoulou and Leonidas Lampropoulos), via email to icfp-workshops-2021 at googlegroups.com. From delphine.demange at irisa.fr Sun Nov 8 18:33:44 2020 From: delphine.demange at irisa.fr (Delphine Demange) Date: Sun, 8 Nov 2020 19:33:44 +0100 Subject: [Haskell-cafe] Extended Deadline - Compiler Construction (CC) 2021 Message-ID: <1AE9BBE6-EDF4-4B3B-992A-872C0B05D9D1@irisa.fr> ACM SIGPLAN 2021 International Conference on Compiler Construction (CC 2021) Co-located with CGO, HPCA and PPoPP Tue 2 - Wed 3 March 2021 https://conf.researchr.org/home/CC-2021 CALL FOR PAPERS The International Conference on Compiler Construction (CC) is interested in work on processing programs in the most general sense: analyzing, transforming or executing input that describes how a system operates, including traditional compiler construction as a special case. The abstract and full paper submission is now November 13, 2020. = IMPORTANT DATES = Abstract & Full Paper Submission: November 13, 2020 (EXTENDED) Author Response Period: December 7 - 9, 2020 Author Notification: December 22, 2020 Artifact Submission: January 5, 2021 AE Notification: January 20, 2021 Final Papers due: January 22, 2021 Conference: March 2 - 3, 2021 Original contributions are solicited on the topics of interest which include, but are not limited to: - Compilation and interpretation techniques, including program representation, analysis, and transformation; code generation, optimization, and synthesis; the verification thereof - Run-time techniques, including memory management, virtual machines, and dynamic and just-in-time compilation - Programming tools, including refactoring editors, checkers, verifiers, compilers, debuggers, and profilers - Techniques, ranging from programming languages to micro-architectural support, for specific domains such as secure, parallel, distributed, embedded or mobile environments - Design and implementation of novel language constructs, programming models, and domain-specific languages CC is an ACM SIGPLAN conference, and implements guidelines and procedures recommended by SIGPLAN (https://www.sigplan.org). Prospective authors should be aware of SIGPLAN’s Copyright policies. Proceedings will be made available online in the ACM digital library from one week before to one week after the conference. Full CfP: https://conf.researchr.org/track/CC-2021/cc-research-papers ARTIFACT EVALUATION Authors of accepted papers will be invited to submit their artifacts for the Artifact Evaluation (AE). The Artifact Evaluation process begins after the acceptance notification, and is run by a separate committee whose task is to assess how the artifacts support the work described in the papers. To ease the organization of the AE committee, we kindly ask authors to indicate at the time they submit the paper, whether they are interested in submitting an artifact. Papers that go through the Artifact Evaluation process successfully will receive a seal of approval printed on the papers themselves. Authors of accepted papers are encouraged, but not required, to make these materials publicly available upon publication of the proceedings, by including them as “source materials” in the ACM Digital Library. CC AE web page: https://conf.researchr.org/track/CC-2021/research-artifacts ORGANIZERS General Chair: Aaron Smith - Microsoft / University of Edinburgh Program Chairs: Delphine Demange - Univ Rennes, Inria, CNRS, IRISA Rajiv Gupta - UC Riverside Artifact Evaluation Chairs: Bruno Bodin - Yale-NUS College Michel Steuwer - University of Glasgow Web Chair: Martin Lücke - University of Edinburgh Steering Committee: Björn Franke (Chair) - University of Edinburgh Jose Nelson Amaral - University of Alberta Christophe Dubach - University of Edinburgh Sebastian Hack - Saarland University Manuel Hermenegildo - IMDEA Software Institute and T.U. of Madrid (UPM) Alexandra Jimborean - University of Murcia Milind Kulkarni - Purdue University Louis-Noël Pouchet - Colorado State University Peng Wu - Futurewei Technologies Jingling Xue - UNSW Sydney Ayal Zaks - Intel Corporation and Technion Program Committee: Guillaume Baudart - IBM Research Walter Binder - University of Lugano Simone Campanoni - Northwestern University Albert Cohen - Google Caroline Collange - Inria, Univ Rennes, CNRS, IRISA Huimin Cui - Institute of Computing Technology, CAS Christophe Dubach - McGill University Benoît Dupont de Dinechin - Kalray Bernhard Egger - Seoul National University Christine Flood - Red Hat Laure Gonnord - University of Lyon and LIP Myoungsoo Jung - KAIST Andrew Kennedy - Facebook Dongyoon Lee - Stony Brook University Christian Lengauer - University of Passau Xavier Leroy - Collège de France and Inria Yun Liang - Peking University Toby Murray - University of Melbourne and Data61 Biswabandan Panda - Indian Institute of Technology Kanpur Santosh Pande - Georgia Tech Louis-Noël Pouchet - Colorado State University Gabriel Rodríguez - Universidade da Coruña Jan Vitek - Northeastern University Jingling Xue - UNSW Sydney Zhijia Zhao - UC Riverside From stefan.wehr at gmail.com Tue Nov 10 08:54:44 2020 From: stefan.wehr at gmail.com (Stefan Wehr) Date: Tue, 10 Nov 2020 09:54:44 +0100 Subject: [Haskell-cafe] Last Call for Contributions: BOB 2021 [Feb 26, Deadline Nov 13] Message-ID: BOB Conference 2021 "What happens when we use what's best for a change?" http://bobkonf.de/2021/cfc.html Berlin, February 26 Call for Contributions Deadline: November 13, 2020 You are actively engaged in advanced software engineering methods, implement ambitious architectures and are open to cutting-edge innovation? Attend this conference, meet people that share your goals, and get to know the best software tools and technologies available today. We strive to offer a day full of new experiences and impressions that you can use to immediately improve your daily life as a software developer. If you share our vision and want to contribute, submit a proposal for a talk or tutorial! NOTE: The conference fee will be waived for presenters. Travel expenses will not be covered (for exceptions see "Speaker Grants"). Online or Onsite We do know yet whether BOB will happen onsite in Berlin or as an online event. Should BOB happen online, we will likely ask for pre-recorded talks to make room for questions and social interactions during the actual conference day. (Of course, we'll provide assistance making those recordings.) Tutorials will likely happen as a live-session. Speaker Grants -------------- BOB has Speaker Grants available to support speakers from groups under-represented in technology. We specifically seek women speakers, speakers of color, and speakers who are not be able to attend the conference for financial reasons. Shepherding ----------- The program committee offers shepherding to all speakers. Shepherding provides speakers assistance with preparing their sessions. Specifically: - advice on structure and presentation - review of talk slides - assistance with recording - review of recording, if applicable Topics ------ We are looking for talks about best-of-breed software technology, e.g.: - functional programming - persistent data structures and databases - event-based modelling and architecture - types - formal methods for correctness and robustness - abstractions for concurrency and parallelism - metaprogramming - probabilistic programming - math and programming - controlled side effects - beyond REST and SOAP - effective abstractions for data analytics - … everything really that isn’t mainstream, but you think should be. Presenters should provide the audience with information that is practically useful for software developers. We're especially interested in experience reports. Other topics are also relevant, e.g.: - introductory talks on technical background - overviews of a given field - demos and how-tos Requirements ------------ We accept proposals for presentations of 45 minutes (40 minutes talk + 5 minutes questions), as well as 90 minute tutorials for beginners. The language of presentation should be either English or German. Your proposal should include (in your presentation language of choice): - An abstract of max. 1500 characters. - A short bio/cv - Contact information (including at least email address) - A list of 3-5 concrete ideas of how your work can be applied in a developer's daily life - additional material (websites, blogs, slides, videos of past presentations, …) - Don't be confused: The system calls a submission event. Organisation ------------ - Direct questions to contact at bobkonf dot de - Proposal deadline: November 13, 2020 - Notification: November 27, 2020 - Program: December 6, 2020 Submit here: https://bobcfc.active-group.de/en/bob2021/cfp Program Committee ----------------- (more information here: https://bobkonf.de/2020/programmkomitee.html) - Matthias Fischmann, Wire - Matthias Neubauer, SICK AG - Nicole Rauch, Softwareentwicklung und Entwicklungscoaching - Michael Sperber, Active Group - Stefan Wehr, Hochschule Offenburg Scientific Advisory Board - Annette Bieniusa, TU Kaiserslautern - Torsten Grust, Uni Tübingen - Peter Thiemann, Uni Freiburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From ky3 at atamo.com Tue Nov 10 23:23:01 2020 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Wed, 11 Nov 2020 06:23:01 +0700 Subject: [Haskell-cafe] What to call Occult Effects Message-ID: By an occult effect I mean that under the type signature (M a -> M b -> M b) of a particular monad M, the two expressions (const id) and (liftM2 $ const id) are equivalent. Occult here refers to how the effect of the second parameter blocks the effect of the first one. In your opinion, is there a better word than occult to describe the property of such monads? -- -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From mgajda at mimuw.edu.pl Wed Nov 11 13:36:29 2020 From: mgajda at mimuw.edu.pl (Michal J Gajda) Date: Wed, 11 Nov 2020 14:36:29 +0100 Subject: [Haskell-cafe] Occult effects... In-Reply-To: References: Message-ID: It is easier to understand it if: 1. You give some examples of such monads 2. Describe how this property arises 3. Tell how whether the law is unique or part of a list of laws applicable Most of mathematics we do is not entirely disconnected from applications. If I tell you there is a class of monoids `m` over a set of objects `o` : class Monoid m => T m o where i :: o -> t c :: t -> o -> Bool Such that the following laws are satisfied: Forall x y z m n. c (i x) x =True c mempty x = False c m y = True => c (m <> n) y = True c n y = True => c (m <> n) y = True What does it tell you about the definitions? Can you tell if this set of laws is correctly stated or exhaustive? Whether it models what I intend to do? Without further examples could I claim that it may be universal model for some phenomena f and g? Or would you rather see some examples or descriptions of i and c operations? PS you may respond to haskell-cafe, sure. I did not think that my previous question deserved sharing, but this answer certainly does. -- Cheers Michał On Wed, Nov 11, 2020, 14:04 Kim-Ee Yeoh wrote: > Hi Michal, > > How is it hermetic? I think I fully described the property whose name I am > opening to discussion. > > What is lacking in the definition? > > Also, do you mind having this discussion at the cafe itself? You are > probably not the only one with this query. > > On Wed, Nov 11, 2020 at 7:37 PM Michał J Gajda wrote: > >> Hi, >> Your post to haskell-cafe is somewhat hermetic if you do not provide >> additional examples. >> What do you use these for? >> -- >> Cheers >> Michał >> > -- > -- Kim-Ee > -------------- next part -------------- An HTML attachment was scrubbed... URL: From Graham.Hutton at nottingham.ac.uk Wed Nov 11 15:49:42 2020 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Wed, 11 Nov 2020 15:49:42 +0000 Subject: [Haskell-cafe] Three new Teaching Assistant positions in Nottingham Message-ID: <6EE5E75F-ED15-4993-BB25-AAEAC551BFA0@nottingham.ac.uk> Dear all, As part of a strategic expansion, the School of Computer Science at the University of Nottingham is seeking to make three new permanent appointments at Teaching Assistant level: https://www.nottingham.ac.uk/jobs/currentvacancies/ref/SCI290020 Applicants with expertise in functional programming are strongly encouraged! The deadline for applications is 11th December 2020. Best wishes, Graham — Professor Graham Hutton School of Computer Science University of Nottingham, UK http://www.cs.nott.ac.uk/~pszgmh This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please contact the sender and delete the email and attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. Email communications with the University of Nottingham may be monitored where permitted by law. From olf at aatal-apotheke.de Wed Nov 11 22:35:18 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Wed, 11 Nov 2020 23:35:18 +0100 Subject: [Haskell-cafe] What to call Occult Effects (Kim-Ee Yeoh) Message-ID: <88b8803d8dc778bf008e051876beb3dba582d1e1.camel@aatal-apotheke.de> > By an occult effect I mean that under the type signature (M a -> M b > -> M > b) of a particular monad M, the two expressions (const id) and > (liftM2 $ > const id) are equivalent. > > Occult here refers to how the effect of the second parameter blocks > the > effect of the first one. > > In your opinion, is there a better word than occult to describe the > property of such monads? Dear Kim-Ee, TL;DR: Why not the simpler do {y <- b; a} = a My name for your property would be "distribution-like" or "lazy" because of an old post of mine [1]. In that thread we discussed models of probability and I emphasized the property fmap.const = const.return :: a -> M b -> M a (Functor-const) which we will see is equivalent to your occultness. Categorically it can be re-phrased as: "M as a functor maps constant functions to constant functions." First, instead of `const id` I will use `const`, that is, we shall prove const = liftM2 const :: M a -> M b -> M a (occultness) which I believe should be equivalent to your property. For the proof it will be convenient to use the following. Lemma: liftM2 f a b = a >>= (\x -> fmap (f x) b) Proof: We de-sugar the do-notation in the source code for liftM2. liftM2 f a b = a >>= (\x -> b >>= (\y -> return (f x y))) Now use the equation fmap h b = b >>= (\y -> return (h y)) with h instantiated to `f x` to obtain the desired identity. q.e.d. Armed with the Lemma we instantiate f = const. liftM2 const a b = a >>= (\x -> fmap (const x) b) If we now assume my property (Functor-const) then we may re-write to liftM2 const a b = a >>= (\x -> const (return x) b) = a >>= (\x -> return x) = a We have shown (Functor-const) implies (occultness). For the reverse implication, we shall prove (Functor-const) holds with the arguments swapped, that is, we prove the equation \b -> \x -> fmap (const x) b = \b -> \x -> return x Starting with the left-hand side, we eta-expand using the law (k :: a -> M b) x = return x >>= k and obtain \b -> \x -> (return x >>= (\x -> fmap (const x) b)) Using the Lemma we identify the expression in the outermost parentheses as liftM2 const (return x) b which by assumption equals return x, whence we re-write the entire term to \b -> \x -> return x q.e.d. Next consider a law with the same type as (occultness): (=<<).const = const :: M a -> M b -> M a (Kleisli-const) do {y <- b; a} = a (same in do-notation) Any MonadPlus fails this due to the law k =<< mzero = mzero. Categorically it can be re-phrased as "The functor from the Kleisli category of M to Hask preserves constant arrows." I will prove that if M is commutative then (Kleisli-const) implies (occultness). liftM2 const a b = do {x <- a; y <- b; return (const x y)} = do {y <- b; x <- a; return (const x y)} (by commutative) = do {y <- b; x <- a; return x} = do {y <- b; a} = a (by Kleisli-const) Probability distributions have property (Functor-const) because it essentially says that if you map any distribution through a constant function, you will end up with all mass in one place. It is related to lazyness because a priori const a :: M b -> M a is lazy in its argument whereas \b -> a >>= (\x -> fmap (const x) b) is not lazy a priori, i.e. may examine its argument b and execute side- effects. Such lazyness was desired in [1] because inspecting an argument in that context meant computationally expensive sampling of a random distribution. Are there concrete Haskell monads with this property? NonEmpty lists have this property up to multiplicity and order, that is, non-empty finite sets are an example of an occult M. The Reader monad is easily seen to have this property. And that seems to be all. Observe that my two example monads above are indeed commutative and have the property (Kleisli-const). I'm curious whether (Kleisli-const) makes sense in your application. Olaf [1] https://mail.haskell.org/pipermail/haskell-cafe/2019-October/131605.html From ky3 at atamo.com Thu Nov 12 01:33:34 2020 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Thu, 12 Nov 2020 08:33:34 +0700 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: Message-ID: (I'll respond with the original subject heading and with the full thread of Michal's reply copied below so that the convo stays in one place.) Hi Michal, I'm afraid you caricaturize my original email out of proportion here: > class Monoid m => T m o where > i :: o -> t > c :: t -> o -> Bool Not only is your T type class more complicated than what I wrote, it's also riddled with suggestive but possibly misleading one-letter variable names. You even ask your reader to stay wary of the laws (snipped) that might not even be correctly stated. I do no such thing in my original email. In fact, the modicum of Haskell background that suffices for grasping the original query is only the next level up from recognizing that a universally polymorphic function of type (a -> a -> a) is inhabited by exactly two functions, modulo bottom. >From there it's one more step to how (forall m. Monad m => m a -> m b -> m b) is inhabited by a mere handful of functions, again barring bottom. My query makes reference to how two of the those functions, namely (const id) and (liftM2 $ const id) are equivalent with some monads but not others. I even gave further clarification in plain English about "how the effect of the second parameter blocks the effect of the first." At the top of your email you wrote: > It is easier to understand it if: > 1. You give some examples of such monads > 2. Describe how this property arises > 3. Tell how whether the law is unique or part of a list of laws applicable Are you alluding to the X-Y problem? http://xyproblem.info/ I assure you I labor under no such tunnel-vision. Were I to request a cromulent adjective for the seventh powers of the natural numbers, what progress do you make by making counter-demands for examples? Behind which string of digits does the pellucid word hide itself? -- Kim-Ee On Wed, Nov 11, 2020 at 8:36 PM Michal J Gajda wrote: > It is easier to understand it if: > 1. You give some examples of such monads > 2. Describe how this property arises > 3. Tell how whether the law is unique or part of a list of laws applicable > > Most of mathematics we do is not entirely disconnected from applications. > > If I tell you there is a class of monoids `m` over a set of objects `o` : > > class Monoid m => T m o where > i :: o -> t > c :: t -> o -> Bool > > Such that the following laws are satisfied: > > Forall x y z m n. > c (i x) x =True > c mempty x = False > c m y = True => c (m <> n) y = True > c n y = True => c (m <> n) y = True > > What does it tell you about the definitions? > Can you tell if this set of laws is correctly stated or exhaustive? > Whether it models what I intend to do? > Without further examples could I claim that it may be universal model for > some phenomena f and g? > > Or would you rather see some examples or descriptions of i and c > operations? > > > PS you may respond to haskell-cafe, sure. I did not think that my previous > question deserved sharing, but this answer certainly does. > -- > Cheers > Michał > > On Wed, Nov 11, 2020, 14:04 Kim-Ee Yeoh wrote: > >> Hi Michal, >> >> How is it hermetic? I think I fully described the property whose name I >> am opening to discussion. >> >> What is lacking in the definition? >> >> Also, do you mind having this discussion at the cafe itself? You are >> probably not the only one with this query. >> >> On Wed, Nov 11, 2020 at 7:37 PM Michał J Gajda wrote: >> >>> Hi, >>> Your post to haskell-cafe is somewhat hermetic if you do not provide >>> additional examples. >>> What do you use these for? >>> -- >>> Cheers >>> Michał >>> >> -- >> -- Kim-Ee >> > -- -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From msm at gwmail.gwu.edu Thu Nov 12 01:38:17 2020 From: msm at gwmail.gwu.edu (Michael Matsko) Date: Thu, 12 Nov 2020 01:38:17 +0000 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: , Message-ID: Also, I think you want to say occlude, which means block from view, as opposed to occult which refers to magic and such. Which may, or may not be what you want. Mike Michael Matsko ________________________________ From: Haskell-Cafe on behalf of Kim-Ee Yeoh Sent: Wednesday, November 11, 2020 8:33:34 PM To: Haskell Cafe ; mgajda at mimuw.edu.pl Subject: Re: [Haskell-cafe] What to call Occult Effects (I'll respond with the original subject heading and with the full thread of Michal's reply copied below so that the convo stays in one place.) Hi Michal, I'm afraid you caricaturize my original email out of proportion here: > class Monoid m => T m o where > i :: o -> t > c :: t -> o -> Bool Not only is your T type class more complicated than what I wrote, it's also riddled with suggestive but possibly misleading one-letter variable names. You even ask your reader to stay wary of the laws (snipped) that might not even be correctly stated. I do no such thing in my original email. In fact, the modicum of Haskell background that suffices for grasping the original query is only the next level up from recognizing that a universally polymorphic function of type (a -> a -> a) is inhabited by exactly two functions, modulo bottom. >From there it's one more step to how (forall m. Monad m => m a -> m b -> m b) is inhabited by a mere handful of functions, again barring bottom. My query makes reference to how two of the those functions, namely (const id) and (liftM2 $ const id) are equivalent with some monads but not others. I even gave further clarification in plain English about "how the effect of the second parameter blocks the effect of the first." At the top of your email you wrote: > It is easier to understand it if: > 1. You give some examples of such monads > 2. Describe how this property arises > 3. Tell how whether the law is unique or part of a list of laws applicable Are you alluding to the X-Y problem? http://xyproblem.info/ I assure you I labor under no such tunnel-vision. Were I to request a cromulent adjective for the seventh powers of the natural numbers, what progress do you make by making counter-demands for examples? Behind which string of digits does the pellucid word hide itself? -- Kim-Ee On Wed, Nov 11, 2020 at 8:36 PM Michal J Gajda > wrote: It is easier to understand it if: 1. You give some examples of such monads 2. Describe how this property arises 3. Tell how whether the law is unique or part of a list of laws applicable Most of mathematics we do is not entirely disconnected from applications. If I tell you there is a class of monoids `m` over a set of objects `o` : class Monoid m => T m o where i :: o -> t c :: t -> o -> Bool Such that the following laws are satisfied: Forall x y z m n. c (i x) x =True c mempty x = False c m y = True => c (m <> n) y = True c n y = True => c (m <> n) y = True What does it tell you about the definitions? Can you tell if this set of laws is correctly stated or exhaustive? Whether it models what I intend to do? Without further examples could I claim that it may be universal model for some phenomena f and g? Or would you rather see some examples or descriptions of i and c operations? PS you may respond to haskell-cafe, sure. I did not think that my previous question deserved sharing, but this answer certainly does. -- Cheers Michał On Wed, Nov 11, 2020, 14:04 Kim-Ee Yeoh > wrote: Hi Michal, How is it hermetic? I think I fully described the property whose name I am opening to discussion. What is lacking in the definition? Also, do you mind having this discussion at the cafe itself? You are probably not the only one with this query. On Wed, Nov 11, 2020 at 7:37 PM Michał J Gajda > wrote: Hi, Your post to haskell-cafe is somewhat hermetic if you do not provide additional examples. What do you use these for? -- Cheers Michał -- -- Kim-Ee -- -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From ky3 at atamo.com Thu Nov 12 01:42:26 2020 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Thu, 12 Nov 2020 08:42:26 +0700 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: Message-ID: On Thu, Nov 12, 2020 at 12:17 AM Justin Bailey wrote: > Looking up the definition "occult" on duckduckgo > (https://duckduckgo.com/?t=ffab&q=occult+definition&ia=definition) > gives this response: > > adj. Of, relating to, or dealing with supernatural or magical > influences, agencies, or occurrences. > adj. Available only to the initiate; secret or mysterious: synonym: > mysterious. > adj. Beyond the realm of human comprehension; inscrutable. > > Doesn't seem to really apply to your type signature. If you mean in > the sense of "occlusion" or "occludes", I'd be specific ("occluded > effects"). Hi Justin, Thank you for heads up, it's just the nudge I need that "occult" probably isn't the right word although I had the astronomical usage in mind. My go-to solution is now "occlusive effects" unless something even better comes along. > > On Tue, Nov 10, 2020 at 3:24 PM Kim-Ee Yeoh wrote: > > > > By an occult effect I mean that under the type signature (M a -> M b -> > M b) of a particular monad M, the two expressions (const id) and (liftM2 $ > const id) are equivalent. > > > > Occult here refers to how the effect of the second parameter blocks the > effect of the first one. > > > > In your opinion, is there a better word than occult to describe the > property of such monads? > > -- > > -- Kim-Ee > > _______________________________________________ > > 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. > -- -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Thu Nov 12 02:47:43 2020 From: david.feuer at gmail.com (David Feuer) Date: Wed, 11 Nov 2020 21:47:43 -0500 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: Message-ID: Interesting. There seem to be quite a few of these. const id (Identity x) (Identity y) = Identity y = liftA2 (const id) (Identity x) (Identity y) If m is occlusive, so is ReaderT e m: liftA2 (const id) (ReaderT f) (ReaderT g) = ReaderT $ \r -> liftA2 (const id) (f r) (g r) = ReaderT $ \r -> g r = ReaderT g I believe this works for StateT as well. The first counterexample is Writer w for a non-trivial monoid w. On Tue, Nov 10, 2020, 6:23 PM Kim-Ee Yeoh wrote: > By an occult effect I mean that under the type signature (M a -> M b -> M > b) of a particular monad M, the two expressions (const id) and (liftM2 $ > const id) are equivalent. > > Occult here refers to how the effect of the second parameter blocks the > effect of the first one. > > In your opinion, is there a better word than occult to describe the > property of such monads? > -- > -- Kim-Ee > _______________________________________________ > 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 ietf-dane at dukhovni.org Thu Nov 12 04:57:15 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Wed, 11 Nov 2020 23:57:15 -0500 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: Message-ID: <20201112045715.GK1464@straasha.imrryr.org> On Wed, Nov 11, 2020 at 09:47:43PM -0500, David Feuer wrote: > If m is occlusive, so is ReaderT e m: > > [...] > > I believe this works for StateT as well. I am puzzled what you mean by that, given that State s a = StateT s Identity a and while "Identity" is "occlusive", State is not. λ> import Control.Monad λ> import Control.Monad.Trans.State.Strict λ> runState (liftM2 (const id) (put True :: State Bool ()) get) False (True,True) λ> runState ((const id) (put True :: State Bool ()) get) False (False,False) -- Viktor. From david.feuer at gmail.com Thu Nov 12 04:59:12 2020 From: david.feuer at gmail.com (David Feuer) Date: Wed, 11 Nov 2020 23:59:12 -0500 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: <20201112045715.GK1464@straasha.imrryr.org> References: <20201112045715.GK1464@straasha.imrryr.org> Message-ID: Ah, you're right. I wrote that while recovering from a migraine, and it was bogus! On Wed, Nov 11, 2020, 11:57 PM Viktor Dukhovni wrote: > On Wed, Nov 11, 2020 at 09:47:43PM -0500, David Feuer wrote: > > > If m is occlusive, so is ReaderT e m: > > > > [...] > > > > I believe this works for StateT as well. > > I am puzzled what you mean by that, given that > > State s a = StateT s Identity a > > and while "Identity" is "occlusive", State is not. > > λ> import Control.Monad > λ> import Control.Monad.Trans.State.Strict > λ> runState (liftM2 (const id) (put True :: State Bool ()) get) False > (True,True) > λ> runState ((const id) (put True :: State Bool ()) get) False > (False,False) > > -- > Viktor. > _______________________________________________ > 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 mgajda at mimuw.edu.pl Thu Nov 12 13:30:15 2020 From: mgajda at mimuw.edu.pl (Michal J Gajda) Date: Thu, 12 Nov 2020 14:30:15 +0100 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: Message-ID: Dear Kim, This was not intended as caricature at all. But it seems an excellent example of x-y problem indeed. When asking for a real life examples, I provided a case when I can provide example that is familiar to most readers: T = Types i = infer :: object -> type c = check :: type -> object -> Bool Laws just make sure that type checking is preserved over unification or anti-unification (<>), except for commutativity - which is omitted on purpose (further description here: https://arxiv.org/abs/2011.03076.) Naturally this example just enumerates the laws that are true for both unification and anti-unification problems. Your question would be however fitting for ICFP 2021 trivia, since without examples provided by other haskell-cafe readers I would not have guessed that you want to mean "occlusion", instead of magic of "occult" here. On Thu, Nov 12, 2020 at 2:33 AM Kim-Ee Yeoh wrote: > > (I'll respond with the original subject heading and with the full thread of Michal's reply copied below so that the convo stays in one place.) > > Hi Michal, I'm afraid you caricaturize my original email out of proportion here: > > > class Monoid m => T m o where > > i :: o -> t > > c :: t -> o -> Bool > (...) > On Wed, Nov 11, 2020 at 8:36 PM Michal J Gajda wrote: (...) >> Such that the following laws are satisfied: >> >> Forall x y z m n. >> c (i x) x =True >> c mempty x = False >> c m y = True => c (m <> n) y = True >> c n y = True => c (m <> n) y = True >> >> What does it tell you about the definitions? >> Can you tell if this set of laws is correctly stated or exhaustive? >> Whether it models what I intend to do? >> Without further examples could I claim that it may be universal model for some phenomena f and g? -- Cheers Michał From olf at aatal-apotheke.de Thu Nov 12 20:58:51 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Thu, 12 Nov 2020 21:58:51 +0100 Subject: [Haskell-cafe] What to call Occult Effects Message-ID: <8089bc77dacb56f80d05e10a1ce43f37d074b613.camel@aatal-apotheke.de> > First, instead of `const id` I will use `const`, that is, we shall > prove > > const = liftM2 const :: M a -> M b -> M a > > which I believe should be equivalent to your property. My belief was wrong, which is evident when using do-notation. Kim-Ee stated do {_ <- b; x <- a; return x} = a while I examined do {x <- a; _ <- b; return x} = a Since do {x <- a; return x} = a holds for any monad, Kim-Ee's property can be reduced to do {_ <- b; a} = a or more concisely b >> a = a which I called Kleisli-const in my previous post. As we seemed to have settled for "occlusive" I suggest calling b >> a = a "right-occlusive" or "occlusive from the right" because the right action occludes the side-effects of the left action, and do {x <- a; _ <- b; return x} = a should be called "left-occlusive" or "occlusive from the left" because the left action hides the effect of the right action. Under commutativity, both are the same but in general these might be different properties. I do not have a distinguishing counterexample, though, because all monads I come up with are commutative. David Feuer hinted at the possibility to define occlusiveness more generally for Applicative functors. Commutativity might be stated for Applicatives as liftA2 f a b = liftA2 (flip f) b a So far I can only see two classes of occlusive monads: The reader-like (Identity ~ Reader ()) and the set-like monads. Olaf From david.feuer at gmail.com Thu Nov 12 21:25:53 2020 From: david.feuer at gmail.com (David Feuer) Date: Thu, 12 Nov 2020 16:25:53 -0500 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: <8089bc77dacb56f80d05e10a1ce43f37d074b613.camel@aatal-apotheke.de> References: <8089bc77dacb56f80d05e10a1ce43f37d074b613.camel@aatal-apotheke.de> Message-ID: First, for clarity, note that const id = flip const Consider a (right-)occlusive functor. We immediately see that liftA2 (flip const) m (pure x) = pure x Using the Applicative laws, we can restate this: x <$ m = pure x We get the same sort of result for a left-occlusive effect. So an occlusive effect can't have any *observable* side effects. It must be "read only". On Thu, Nov 12, 2020, 3:59 PM Olaf Klinke wrote: > > First, instead of `const id` I will use `const`, that is, we shall > > prove > > > > const = liftM2 const :: M a -> M b -> M a > > > > which I believe should be equivalent to your property. > > My belief was wrong, which is evident when using do-notation. > Kim-Ee stated > > do {_ <- b; x <- a; return x} = a > > while I examined > > do {x <- a; _ <- b; return x} = a > > Since do {x <- a; return x} = a holds for any monad, Kim-Ee's property > can be reduced to > > do {_ <- b; a} = a > or more concisely > b >> a = a > > which I called Kleisli-const in my previous post. As we seemed to have > settled for "occlusive" I suggest calling > b >> a = a > "right-occlusive" or "occlusive from the right" because the right > action occludes the side-effects of the left action, and > do {x <- a; _ <- b; return x} = a > should be called "left-occlusive" or "occlusive from the left" because > the left action hides the effect of the right action. Under > commutativity, both are the same but in general these might be > different properties. I do not have a distinguishing counterexample, > though, because all monads I come up with are commutative. > > David Feuer hinted at the possibility to define occlusiveness more > generally for Applicative functors. Commutativity might be stated for > Applicatives as > > liftA2 f a b = liftA2 (flip f) b a > > So far I can only see two classes of occlusive monads: The reader-like > (Identity ~ Reader ()) and the set-like monads. > > Olaf > > _______________________________________________ > 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 olf at aatal-apotheke.de Thu Nov 12 22:26:45 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Thu, 12 Nov 2020 23:26:45 +0100 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: <8089bc77dacb56f80d05e10a1ce43f37d074b613.camel@aatal-apotheke.de> Message-ID: <0c6beaa8894a8dee6948e63e2df4802929038c18.camel@aatal-apotheke.de> On Thu, 2020-11-12 at 16:25 -0500, David Feuer wrote: > First, for clarity, note that > > const id = flip const > > Consider a (right-)occlusive functor. We immediately see that > > liftA2 (flip const) m (pure x) = pure x > > Using the Applicative laws, we can restate this: > > x <$ m = pure x > > We get the same sort of result for a left-occlusive effect. > > So an occlusive effect can't have any *observable* side effects. It > must be > "read only". > I'd rather interpret this as a form of lazyness or call-by-need: If the action's return value is not used, then the side-effects are also not executed. Computationally, constant-ness of a function is an undecidable property. Therefore it is questionable whether any implementation can exhibit this sort of lazyness with side-effectful actions. Olaf From ben.franksen at online.de Fri Nov 13 10:43:02 2020 From: ben.franksen at online.de (Ben Franksen) Date: Fri, 13 Nov 2020 11:43:02 +0100 Subject: [Haskell-cafe] caching ~/.cabal with github actions on windows Message-ID: I can't get this to work. It works perfectly fine on Linux and MacOS but on Windows cabal always re-builds all the dependencies. The cache post-action on Windows tells me that the cache hasn't changed, which means cabal actually re-created the ~/.cabal directory exactly as it was in the cache! Is this a known bug in cabal on Windows? Does anyone have a work-around? Cheers Ben From oleg.grenrus at iki.fi Fri Nov 13 10:54:52 2020 From: oleg.grenrus at iki.fi (Oleg Grenrus) Date: Fri, 13 Nov 2020 12:54:52 +0200 Subject: [Haskell-cafe] caching ~/.cabal with github actions on windows In-Reply-To: References: Message-ID: cabal-install doesn't use ~/.cabal on Windows. See https://hackage.haskell.org/package/directory-1.3.6.1/docs/System-Directory.html#v:getAppUserDataDirectory - Oleg On 13.11.2020 12.43, Ben Franksen wrote: > I can't get this to work. It works perfectly fine on Linux and MacOS but > on Windows cabal always re-builds all the dependencies. The cache > post-action on Windows tells me that the cache hasn't changed, which > means cabal actually re-created the ~/.cabal directory exactly as it was > in the cache! > > Is this a known bug in cabal on Windows? > > Does anyone have a work-around? > > Cheers > Ben > > _______________________________________________ > 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 melkon.or at gmail.com Fri Nov 13 11:13:09 2020 From: melkon.or at gmail.com (Orestis Melkonian) Date: Fri, 13 Nov 2020 13:13:09 +0200 Subject: [Haskell-cafe] caching ~/.cabal with github actions on windows In-Reply-To: References: Message-ID: Note that if you use the setup-haskell action (https://github.com/actions/setup-haskell), you can get the directory from its outputs, i.e. `${{ steps.setup-haskell-cabal.outputs.cabal-store }}`. Cheers, --OM On 11/13/20 12:54 PM, Oleg Grenrus wrote: > cabal-install doesn't use ~/.cabal on Windows. > > See > https://hackage.haskell.org/package/directory-1.3.6.1/docs/System-Directory.html#v:getAppUserDataDirectory > > - Oleg > > On 13.11.2020 12.43, Ben Franksen wrote: >> I can't get this to work. It works perfectly fine on Linux and MacOS but >> on Windows cabal always re-builds all the dependencies. The cache >> post-action on Windows tells me that the cache hasn't changed, which >> means cabal actually re-created the ~/.cabal directory exactly as it was >> in the cache! >> >> Is this a known bug in cabal on Windows? >> >> Does anyone have a work-around? >> >> Cheers >> Ben >> >> _______________________________________________ >> 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 ben.franksen at online.de Fri Nov 13 11:32:56 2020 From: ben.franksen at online.de (Ben Franksen) Date: Fri, 13 Nov 2020 12:32:56 +0100 Subject: [Haskell-cafe] caching ~/.cabal with github actions on windows In-Reply-To: References: Message-ID: Am 13.11.20 um 11:54 schrieb Oleg Grenrus: > cabal-install doesn't use ~/.cabal on Windows. > > See > https://hackage.haskell.org/package/directory-1.3.6.1/docs/System-Directory.html#v:getAppUserDataDirectory Thanks. I already suspected that was causing the problem, so I tried to set CABAL_DIR to a fixed location (and cache that instead): env: CABAL_DIR: ${{ github.workspace }}/dot-cabal Again, this works fine on Linux and MacOS but not on Windows. Cheers Ben From ben.franksen at online.de Fri Nov 13 11:35:49 2020 From: ben.franksen at online.de (Ben Franksen) Date: Fri, 13 Nov 2020 12:35:49 +0100 Subject: [Haskell-cafe] caching ~/.cabal with github actions on windows In-Reply-To: References: Message-ID: Am 13.11.20 um 12:13 schrieb Orestis Melkonian: > Note that if you use the setup-haskell action > (https://github.com/actions/setup-haskell), you can get the directory > from its outputs, i.e. `${{ > steps.setup-haskell-cabal.outputs.cabal-store }}`. Thanks, I'll try that. Cheers Ben From ben.franksen at online.de Fri Nov 13 12:12:14 2020 From: ben.franksen at online.de (Ben Franksen) Date: Fri, 13 Nov 2020 13:12:14 +0100 Subject: [Haskell-cafe] caching ~/.cabal with github actions on windows In-Reply-To: References: Message-ID: Am 13.11.20 um 12:35 schrieb Ben Franksen: > Am 13.11.20 um 12:13 schrieb Orestis Melkonian: >> Note that if you use the setup-haskell action >> (https://github.com/actions/setup-haskell), you can get the directory >> from its outputs, i.e. `${{ >> steps.setup-haskell-cabal.outputs.cabal-store }}`. > > Thanks, I'll try that. It hasn't completed but looks pretty good. In fact the cabal store path gets shown as path: C:\sr I would never have guessed that path, nor did I see it in the cabal docs. (BTW, the "setup-haskell-cabal" in your reply is the id: that you have given your setup-haskell step; it took me a while to figure that out since I am pretty new to github actions). Thanks again Ben From ben.franksen at online.de Fri Nov 13 12:23:35 2020 From: ben.franksen at online.de (Ben Franksen) Date: Fri, 13 Nov 2020 13:23:35 +0100 Subject: [Haskell-cafe] caching ~/.cabal with github actions on windows In-Reply-To: References: Message-ID: Caching works now and re-running the job gets it down to 2 minutes (from 15 for the first run). Awful! Thanks! Cheers Ben Am 13.11.20 um 13:12 schrieb Ben Franksen: > Am 13.11.20 um 12:35 schrieb Ben Franksen: >> Am 13.11.20 um 12:13 schrieb Orestis Melkonian: >>> Note that if you use the setup-haskell action >>> (https://github.com/actions/setup-haskell), you can get the directory >>> from its outputs, i.e. `${{ >>> steps.setup-haskell-cabal.outputs.cabal-store }}`. >> >> Thanks, I'll try that. > > It hasn't completed but looks pretty good. In fact the cabal store path > gets shown as > > path: C:\sr > > I would never have guessed that path, nor did I see it in the cabal docs. > > (BTW, the "setup-haskell-cabal" in your reply is the id: that you have > given your setup-haskell step; it took me a while to figure that out > since I am pretty new to github actions). > > Thanks again > Ben > > _______________________________________________ > 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 sergey.goncharov at fau.de Fri Nov 13 14:22:20 2020 From: sergey.goncharov at fau.de (Sergey Goncharov) Date: Fri, 13 Nov 2020 15:22:20 +0100 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: <8089bc77dacb56f80d05e10a1ce43f37d074b613.camel@aatal-apotheke.de> Message-ID: <15162dad-3b29-680e-696c-c05a21ea8dc2@fau.de> Dear Olaf and everyone, the law do {_ <- b; a} = a is equivalent to do {_ <- b; return ()} = return (), for, assuming the latter, do {_ <- b; a} = do {_ <- do {_ <- b; return ()}; a} = do {_ <- return (); a} = a and it does actually have some history. It was dubbed 'discardability' by Thielecke [1] and explored by Führmann in [2] together with some other important properties of effects, such as 'centrality' and 'commutativity'. Combinations of these properties and examples are explored in the conventional Haskell-like style in [3] (where 'discardability' is called 'side-effect freeness' though). Cheers, Sergey [1] H. Thielecke, Categorical structure of continuation passing style, Ph.D. Thesis, University of Edinburgh, 1997. [2] C. Führmann, Varieties of effects, in: M. Nielsen, U. Engberg (Eds.), Foundations of Software Science and Computation Structures, FOSSACS 2002, in: Lect. Notes Comput. Sci., vol. 2303, Springer, 2002, pp. 144–158. [3] L. Schröder, T. Mossakowski, Monad-independent dynamic logic in HasCasl, J. Logic Comput. 14 (2004) 571–619 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5384 bytes Desc: S/MIME Cryptographic Signature URL: From ida.bzowska at gmail.com Fri Nov 13 16:24:03 2020 From: ida.bzowska at gmail.com (Ida Bzowska) Date: Fri, 13 Nov 2020 17:24:03 +0100 Subject: [Haskell-cafe] Advent of Haskell is still waiting for ideas Message-ID: Hi there, Advent of Haskell is an advent calendar filled with Haskell content, obviously :) The first confirmations to "Advent of Haskell" participants' have been sent this week, but there are still a lot of open spots to go, so do not hesitate to submit your idea. All the details are available here: https://adventofhaskell.com Happy haskelling everyone! λCheers, Ida -------------- next part -------------- An HTML attachment was scrubbed... URL: From olf at aatal-apotheke.de Fri Nov 13 21:07:07 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Fri, 13 Nov 2020 22:07:07 +0100 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: References: <8089bc77dacb56f80d05e10a1ce43f37d074b613.camel@aatal-apotheke.de> Message-ID: <02ebee63290ca8176791eb2f7bbb721537ff94c3.camel@aatal-apotheke.de> Here is a shorter proof that right-occlusive implies left-occlusive. b >>= const a = join (fmap (const a) b) monad law (=<<) = (join.).fmap = join (const (return a) b) assumption: left-occlusive = join (return a) = a monad law join.return = id I still don't know whether right-occlusive implies left-occlusive. But I found a non-commutative monad which is not a reader monad and which is left-occlusive: the Set monad from the infinite-search package [1]. This monad is non-trivial and quite obviously satisfies fmap.const = const.return when you look at the source of the Functor instance. I verified by timing search over a vast and a tiny Set. In accordance with your arguments, I am beginning to think that b >> a = a could be taken as a _definition_ of a side-effect-free monad. Cheers, Olaf [1] http://hackage.haskell.org/package/infinite-search On Thu, 2020-11-12 at 16:25 -0500, David Feuer wrote: > First, for clarity, note that > > const id = flip const > > Consider a (right-)occlusive functor. We immediately see that > > liftA2 (flip const) m (pure x) = pure x > > Using the Applicative laws, we can restate this: > > x <$ m = pure x > > We get the same sort of result for a left-occlusive effect. > > So an occlusive effect can't have any *observable* side effects. It > must be > "read only". > > On Thu, Nov 12, 2020, 3:59 PM Olaf Klinke > wrote: > > > > First, instead of `const id` I will use `const`, that is, we > > > shall > > > prove > > > > > > const = liftM2 const :: M a -> M b -> M a > > > > > > which I believe should be equivalent to your property. > > > > My belief was wrong, which is evident when using do-notation. > > Kim-Ee stated > > > > do {_ <- b; x <- a; return x} = a > > > > while I examined > > > > do {x <- a; _ <- b; return x} = a > > > > Since do {x <- a; return x} = a holds for any monad, Kim-Ee's > > property > > can be reduced to > > > > do {_ <- b; a} = a > > or more concisely > > b >> a = a > > > > which I called Kleisli-const in my previous post. As we seemed to > > have > > settled for "occlusive" I suggest calling > > b >> a = a > > "right-occlusive" or "occlusive from the right" because the right > > action occludes the side-effects of the left action, and > > do {x <- a; _ <- b; return x} = a > > should be called "left-occlusive" or "occlusive from the left" > > because > > the left action hides the effect of the right action. Under > > commutativity, both are the same but in general these might be > > different properties. I do not have a distinguishing > > counterexample, > > though, because all monads I come up with are commutative. > > > > David Feuer hinted at the possibility to define occlusiveness more > > generally for Applicative functors. Commutativity might be stated > > for > > Applicatives as > > > > liftA2 f a b = liftA2 (flip f) b a > > > > So far I can only see two classes of occlusive monads: The reader- > > like > > (Identity ~ Reader ()) and the set-like monads. > > > > Olaf > > > > _______________________________________________ > > 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 nadine.and.henry at pobox.com Sat Nov 14 04:08:46 2020 From: nadine.and.henry at pobox.com (Henry Laxen) Date: Fri, 13 Nov 2020 20:08:46 -0800 Subject: [Haskell-cafe] Generic Sorting Message-ID: <24495.22606.60949.58172@gargle.gargle.HOWL> Good evening Haskellers. I've done some searching but so far haven't found anything, which make me think this probably isn't possible. I am wondering if it is possible to do a "Generic Sort" on multilevel data structures. Suppose you have something like: data A = A Int [Int] data B = B Int [A] a1 = A 2 [2,1] a2 = A 1 [4,3] b = B 1 [a1,a2] genericSort b = B 1 [A 1 [3,4], A 2 [1,2]] note that not only are the A's sorted, but the list inside each A is sorted. It "sorted all the way down". Has Edward written such a thing yet? ;-) His "discrimination" library doesn't do this, in case you're wondering. Any ideas? Best wishes, Henry Laxen From rae at richarde.dev Sat Nov 14 04:11:21 2020 From: rae at richarde.dev (Richard Eisenberg) Date: Sat, 14 Nov 2020 04:11:21 +0000 Subject: [Haskell-cafe] support for ergonomic dependent types Message-ID: <010f0175c4f350f8-a09af29c-61d1-48ef-93e6-1d2f2fc06b1f-000000@us-east-2.amazonses.com> Hi all, The GHC Steering Committee has been struggling recently to decide on several related proposals. The struggle is all around whether we should favor making a design that is future-compatible with dependent types, or favor a design that is more cohesive with e.g. Haskell98. (Sometimes, we can have both. Those are good times.) This isn't about backward compatibility -- the design for dependent Haskell is fully backward compatible with Haskell98. It's more about how well the new features fit with the old ones. To clarify our thinking on it all, I've made a new proposal to discuss whether or not we want to favor keeping an avenue open to ergonomic dependent types in the future. If you have an opinion, please express it on the proposal. In particular, if you care about the possibility of ergonomic dependent types in Haskell, now is the time to show that support by thumbs-upping the proposal. The proposal is at https://github.com/ghc-proposals/ghc-proposals/pull/378. Thanks! Richard From jack at jackkelly.name Sat Nov 14 04:36:57 2020 From: jack at jackkelly.name (jack at jackkelly.name) Date: Sat, 14 Nov 2020 04:36:57 +0000 Subject: [Haskell-cafe] Generic Sorting In-Reply-To: <24495.22606.60949.58172@gargle.gargle.HOWL> References: <24495.22606.60949.58172@gargle.gargle.HOWL> Message-ID: November 14, 2020 2:08 PM, "Henry Laxen" wrote: > I've done some searching but so far haven't found anything, which make > me think this probably isn't possible. I am wondering if it is > possible to do a "Generic Sort" on multilevel data structures. > Suppose you have something like: This is not quite what you asked for, but might get you started. It's based on a trick that Alex Mason once showed me: {-# LANGUAGE AllowAmbiguousTypes #-} {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} import Control.Lens import Data.Data import Data.Data.Lens import Data.List data A = A Int [Int] deriving (Data, Show) data B = B Int [A] deriving (Data, Show) a1 = A 2 [2,1] a2 = A 1 [4,3] b = B 1 [a1,a2] -- | oh no -- >>> genericSort @Int b -- B 1 [A 1 [1,2],A 2 [3,4]] genericSort :: forall a d . (Data d, Typeable a, Ord a) => d -> d genericSort = partsOf template %~ (sort :: [a] -> [a]) Note that it's sorted every Int anywhere in the structure, not just the ones inside an A. HTH, -- Jack From lemming at henning-thielemann.de Sat Nov 14 08:11:46 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat, 14 Nov 2020 09:11:46 +0100 (CET) Subject: [Haskell-cafe] Generic Sorting In-Reply-To: <24495.22606.60949.58172@gargle.gargle.HOWL> References: <24495.22606.60949.58172@gargle.gargle.HOWL> Message-ID: On Fri, 13 Nov 2020, Henry Laxen wrote: > Good evening Haskellers. > > I've done some searching but so far haven't found anything, which make > me think this probably isn't possible. I am wondering if it is > possible to do a "Generic Sort" on multilevel data structures. > Suppose you have something like: > > data A = A Int [Int] > data B = B Int [A] > > a1 = A 2 [2,1] > a2 = A 1 [4,3] > b = B 1 [a1,a2] > > genericSort b = B 1 [A 1 [3,4], A 2 [1,2]] > > note that not only are the A's sorted, but the list inside each A is > sorted. It "sorted all the way down". Has Edward written such a > thing yet? ;-) His "discrimination" library doesn't do this, in case > you're wondering. Any ideas? You could first sort the structures and then fill it with a sorted flattened list. From mlang at blind.guru Sat Nov 14 15:32:22 2020 From: mlang at blind.guru (Mario Lang) Date: Sat, 14 Nov 2020 16:32:22 +0100 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? Message-ID: <87a6vk6jjt.fsf@blind.guru> Hi. I have been using Lynx to read stuff on hacakge for a long time. I recently noticed that it is no longer possible to read the source of a module, because extra type information (which is likely hidden in a modern browser) is inline with the actual sources. This makes the go to source feature effectively useless. An example (from the ISBN package): deriving (Int -> ISBN -> ShowS [ISBN] -> ShowS ISBN -> String (Int -> ISBN -> ShowS) -> (ISBN -> String) -> ([ISBN] -> ShowS) -> Show ISBN forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [ISBN] -> ShowS $cshowList :: [ISBN] -> ShowS show :: ISBN -> String $cshow :: ISBN -> String showsPrec :: Int -> ISBN -> ShowS $cshowsPrec :: Int -> ISBN -> ShowS Show, ISBN -> ISBN -> Bool (ISBN -> ISBN -> Bool) -> (ISBN -> ISBN -> Bool) -> Eq ISBN forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: ISBN -> ISBN -> Bool $c/= :: ISBN -> ISBN -> Bool == :: ISBN -> ISBN -> Bool $c== :: ISBN -> ISBN -> Bool Eq) I know Haskell has a ton of extensions, but I am pretty sure nobody writes code like this :-) This is, frankly, pretty horrible. Can something be done to fix this? (I am aware that certain modernisations are unstoppable. However, this one looks like a bug.) -- CYa, ⡍⠁⠗⠊⠕ From nadine.and.henry at pobox.com Sat Nov 14 17:30:52 2020 From: nadine.and.henry at pobox.com (Henry Laxen) Date: Sat, 14 Nov 2020 09:30:52 -0800 Subject: [Haskell-cafe] Generic Sorting In-Reply-To: References: <24495.22606.60949.58172@gargle.gargle.HOWL> Message-ID: <24496.5196.109558.32813@gargle.gargle.HOWL> >>>>> "jack" == jack writes: Henry> November 14, 2020 2:08 PM, "Henry Laxen" wrote: Henry> I've done some searching but so far haven't found anything, which make Henry> me think this probably isn't possible. I am wondering if it is Henry> possible to do a "Generic Sort" on multilevel data structures. Henry> Suppose you have something like: jack> This is not quite what you asked for, but might get you started. It's based on a trick that Alex Mason once showed me: jack> {-# LANGUAGE AllowAmbiguousTypes #-} jack> {-# LANGUAGE DeriveDataTypeable #-} jack> {-# LANGUAGE ScopedTypeVariables #-} jack> import Control.Lens jack> import Data.Data jack> import Data.Data.Lens jack> import Data.List jack> data A = A Int [Int] deriving (Data, Show) jack> data B = B Int [A] deriving (Data, Show) jack> a1 = A 2 [2,1] jack> a2 = A 1 [4,3] jack> b = B 1 [a1,a2] jack> -- | oh no jack> -- >>> genericSort @Int b jack> -- B 1 [A 1 [1,2],A 2 [3,4]] jack> genericSort :: forall a d . (Data d, Typeable a, Ord a) => d -> d jack> genericSort = partsOf template %~ (sort :: [a] -> [a]) Henry> Note that it's sorted every Int anywhere in the structure, not just the ones inside an A. Wow Jack, that looks like magic. I'm going to read about partsOf and template, which I've never used before. One thing, to actuall run it you need to add {-# LANGUAGE TypeApplications #-} so you can say "genericSort @Int b". Thanks so much for your quick and brilliant response. Best wishes, Henry Laxen From johannes.waldmann at htwk-leipzig.de Sat Nov 14 18:01:47 2020 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Sat, 14 Nov 2020 19:01:47 +0100 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? Message-ID: <216b0636-c259-400d-ef8e-7226da3e08f9@htwk-leipzig.de> > I recently noticed that it is no longer possible > to read the source of a module, because extra type information > (which is likely hidden in a modern browser) > is inline with the actual sources. I confirmed your example, reading with lynx and w3m. It seems the extra text is the methods of the type classes (mentioned after "deriving") and it gets shown on on mouse-over in a graphical browser. (Re: "nobody writes code like this" - the compiler does? Some methods here seem auto-generated.) Looks like a bug in haddock, then? (Or in lynx' handling of CSS?) The actual HTML source looks legit, at least partially (see example below) This seems related: https://github.com/haskell/haddock/pull/1197 I will open an issue on accessibility. - J.W. deriving (Int -> ISBN -> ShowS [ISBN] -> ShowS ISBN -> String (Int -> ISBN -> ShowS) -> (ISBN -> String) -> ([ISBN] -> ShowS) -> Show ISBN forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [ISBN] -> ShowS $cshowList :: [ISBN] -> ShowS show :: ISBN -> String $cshow :: ISBN -> String showsPrec :: Int -> ISBN -> ShowS $cshowsPrec :: Int -> ISBN -> ShowS Show From lysxia at gmail.com Sat Nov 14 18:12:10 2020 From: lysxia at gmail.com (Li-yao Xia) Date: Sat, 14 Nov 2020 13:12:10 -0500 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? In-Reply-To: <87a6vk6jjt.fsf@blind.guru> References: <87a6vk6jjt.fsf@blind.guru> Message-ID: <5539a15f-4fb2-8d4f-d7da-d325d16727a9@gmail.com> Note that the raw sources are available in another location: https://hackage.haskell.org/package/isbn-1.1.0.2/src/lib/Data/ISBN/Types.hs (starting from the Hackage page for the package, under Downloads, click "browse") On 11/14/2020 10:32 AM, Mario Lang wrote: > Hi. > > I have been using Lynx to read stuff on hacakge for a long time. > > I recently noticed that it is no longer possible to read the source of a > module, because extra type information (which is likely hidden in a > modern browser) is inline with the actual sources. This makes the go to > source feature effectively useless. An example (from the ISBN package): > > deriving (Int -> ISBN -> ShowS > [ISBN] -> ShowS > ISBN -> String > (Int -> ISBN -> ShowS) > -> (ISBN -> String) -> ([ISBN] -> ShowS) -> Show ISBN > forall a. > (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a > showList :: [ISBN] -> ShowS > $cshowList :: [ISBN] -> ShowS > show :: ISBN -> String > $cshow :: ISBN -> String > showsPrec :: Int -> ISBN -> ShowS > $cshowsPrec :: Int -> ISBN -> ShowS > Show, ISBN -> ISBN -> Bool > (ISBN -> ISBN -> Bool) -> (ISBN -> ISBN -> Bool) -> Eq ISBN > forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a > /= :: ISBN -> ISBN -> Bool > $c/= :: ISBN -> ISBN -> Bool > == :: ISBN -> ISBN -> Bool > $c== :: ISBN -> ISBN -> Bool > Eq) > > I know Haskell has a ton of extensions, but I am pretty sure nobody > writes code like this :-) > > This is, frankly, pretty horrible. Can something be done to fix this? > > (I am aware that certain modernisations are unstoppable. However, this > one looks like a bug.) > From alec.theriault at gmail.com Sat Nov 14 18:16:24 2020 From: alec.theriault at gmail.com (Alec Theriault) Date: Sat, 14 Nov 2020 13:16:24 -0500 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? In-Reply-To: <216b0636-c259-400d-ef8e-7226da3e08f9@htwk-leipzig.de> References: <216b0636-c259-400d-ef8e-7226da3e08f9@htwk-leipzig.de> Message-ID: <5184D544-1752-4F60-8B09-2CD019EA552B@gmail.com> Hello, This is indeed by design - it is a relatively new Haddock feature (here’s the original issue ) where types of identifiers and identifiers bound are shown on mouse-over. Here is what this looks like in a graphical browser: As for the the weird declarations like $cshowList and company, this seems to be a bug - Haddock should not display those identifiers. Although I’m sympathetic to the accessibility, in this case wouldn’t just directly opening the sources (in a text editor) be simpler? Is there a (simple) way to preserve the experience when browsing using Lynx without also holding back features aimed at a regular browsing experience? Alec > On Nov 14, 2020, at 1:01 PM, Johannes Waldmann wrote: > >> I recently noticed that it is no longer possible >> to read the source of a module, because extra type information >> (which is likely hidden in a modern browser) >> is inline with the actual sources. > > I confirmed your example, reading with lynx and w3m. > > It seems the extra text > is the methods of the type classes (mentioned after "deriving") > and it gets shown on on mouse-over in a graphical browser. > > (Re: "nobody writes code like this" - the compiler does? > Some methods here seem auto-generated.) > > Looks like a bug in haddock, then? (Or in lynx' handling of CSS?) > The actual HTML source looks legit, at least partially > (see example below) > > This seems related: > https://github.com/haskell/haddock/pull/1197 > > I will open an issue on accessibility. > > - J.W. > > deriving class="hs-special">( id="local-6989586621679046281"> id="local-6989586621679046283"> class="annottext">Int -> ISBN -> ShowS > [ISBN] -> ShowS > ISBN -> String > (Int -> ISBN -> ShowS) > -> (ISBN -> String) -> ([ISBN] -> ShowS) -> Show ISBN > forall a. > (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) > -> Show a > showList :: [ISBN] -> ShowS > $cshowList :: [ISBN] -> ShowS > show :: ISBN -> String > $cshow :: ISBN -> String > showsPrec :: Int -> ISBN -> ShowS > $cshowsPrec :: Int -> ISBN -> ShowS > Show > > _______________________________________________ > 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: Screen Shot 2020-11-14 at 1.04.17 PM.png Type: image/png Size: 198462 bytes Desc: not available URL: From johannes.waldmann at htwk-leipzig.de Sat Nov 14 18:24:55 2020 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Sat, 14 Nov 2020 19:24:55 +0100 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? In-Reply-To: <5184D544-1752-4F60-8B09-2CD019EA552B@gmail.com> References: <216b0636-c259-400d-ef8e-7226da3e08f9@htwk-leipzig.de> <5184D544-1752-4F60-8B09-2CD019EA552B@gmail.com> Message-ID: <105add9a-5f7d-0fe1-e532-74633994f3a9@htwk-leipzig.de> > ... a (simple) way to preserve the experience when browsing using Lynx yes, that is the question. What *is* the recommended way of providing a tooltip-like experience for text browsers? - J. From mlang at blind.guru Sun Nov 15 00:18:51 2020 From: mlang at blind.guru (Mario Lang) Date: Sun, 15 Nov 2020 01:18:51 +0100 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? In-Reply-To: <5184D544-1752-4F60-8B09-2CD019EA552B@gmail.com> (Alec Theriault's message of "Sat, 14 Nov 2020 13:16:24 -0500") References: <216b0636-c259-400d-ef8e-7226da3e08f9@htwk-leipzig.de> <5184D544-1752-4F60-8B09-2CD019EA552B@gmail.com> Message-ID: <875z6779qs.fsf@blind.guru> Alec Theriault writes: > Although I’m sympathetic to the accessibility, in this case wouldn’t just > directly opening the sources (in a text editor) be simpler? Following a link to a definition is convenient because there is an anchor. Of course I can just open the original sources in a text editor. But then I am no longer reading documentation, I am reading sources! > Is there a (simple) way to preserve the experience when browsing using > Lynx without also holding back features aimed at a regular browsing > experience? I was expecting this sort of killer argument. I have to admit I am too exhausted with this topic to try and give a meaningful answer. There used to be a time when compatibility to existing technology was a goal by itself. This is going away even in circles which usually have tried to achieve some sort of technical excellence. I am sad. But I can not do anything against the tides except for sometimes pointing at ships while they are sinking, hoping to get someone to see reason and rescue at least some of them. Practically speaking, the problem is the visibility style attribute. As far as I know, none of the text browsers (lynx, w3m, elinks, eww) have CSS support. Barring any other HTML construct which would allow to hide things by default for text browsers, all I can think of a plain version in addition to a hip version. That should be easy to autogenerate, but it has all the problems attached to a alternative version. -- CYa, ⡍⠁⠗⠊⠕ From evincarofautumn at gmail.com Sun Nov 15 04:25:44 2020 From: evincarofautumn at gmail.com (Jon Purdy) Date: Sat, 14 Nov 2020 20:25:44 -0800 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? In-Reply-To: <875z6779qs.fsf@blind.guru> References: <216b0636-c259-400d-ef8e-7226da3e08f9@htwk-leipzig.de> <5184D544-1752-4F60-8B09-2CD019EA552B@gmail.com> <875z6779qs.fsf@blind.guru> Message-ID: (Neglected to CC haskell-cafe, sorry Mario for the duplicate.) The only plain-HTML solutions I’m aware of are the ‘title’ attribute and the HTML5 ‘
’ element. The latter may contain a ‘’ element for the content displayed by default, plus other content that the user can expand or collapse. Unfortunately, as far as I know Lynx doesn’t support either of these; not sure about other text browsers. In Lynx you could maybe get some nice UX for this with the ‘’ footnote element from HTML 3.0, but that’s deprecated and probably not supported in other browsers. It doesn’t help with Lynx support, but I guess the right thing to do here for screenreader support in other browsers is to add the ‘tooltip’ role to the tooltip element, toggle its ‘hidden’ attribute with JavaScript to show and hide it, and use ‘aria-describedby’ / ‘aria-expanded’ on the anchor element to handle relating the two and announcing the tooltip correctly when it’s shown. On Sat, Nov 14, 2020 at 4:20 PM Mario Lang wrote: > Alec Theriault writes: > > > Although I’m sympathetic to the accessibility, in this case wouldn’t just > > directly opening the sources (in a text editor) be simpler? > > Following a link to a definition is convenient because there is an > anchor. > Of course I can just open the original sources in a text editor. > But then I am no longer reading documentation, I am reading sources! > > > Is there a (simple) way to preserve the experience when browsing using > > Lynx without also holding back features aimed at a regular browsing > > experience? > > I was expecting this sort of killer argument. I have to admit I am too > exhausted with this topic to try and give a meaningful answer. There > used to be a time when compatibility to existing technology was a goal > by itself. This is going away even in circles which usually have tried > to achieve some sort of technical excellence. I am sad. But I can not > do anything against the tides except for sometimes pointing at ships > while they are sinking, hoping to get someone to see reason and rescue > at least some of them. > > Practically speaking, the problem is the visibility style attribute. As > far as I know, none of the text browsers (lynx, w3m, elinks, eww) have > CSS support. Barring any other HTML construct which would allow to hide > things by default for text browsers, all I can think of a plain > version in addition to a hip version. That should be easy to > autogenerate, but it has all the problems attached to a alternative > version. > > -- > 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. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tikhon at jelv.is Sun Nov 15 05:42:28 2020 From: tikhon at jelv.is (Tikhon Jelvis) Date: Sat, 14 Nov 2020 21:42:28 -0800 Subject: [Haskell-cafe] Redirecting hackage.haskell.org to HTTPS Message-ID: Pages on hackage.haskell.org are currently served over both HTTP and HTTPS. Package security on Hackage does not depend on HTTPS, so we keep HTTP endpoints for backwards compatibility with automated systems that depend on Hackage and do not support HTTPS. However, this means that it's possible for users to inadvertently browse Hackage pages on HTTP which is not a great user experience. To address this issue without breaking existing scripts, we are planning to redirect requests to HTTPS based on User-Agent headers: requests with "Mozilla/5.0" in their User-Agent string will be redirected to HTTPS and other requests will remain unchanged. Please contact us at committee at haskell.org if this change will cause problems with how you use Hackage. Otherwise, the new behavior will go into effect on 2020-11-23. Thanks! -Tikhon Jelvis, on behalf of the Haskell.org Committee -------------- next part -------------- An HTML attachment was scrubbed... URL: From branimir.maksimovic at gmail.com Sun Nov 15 05:55:52 2020 From: branimir.maksimovic at gmail.com (Branimir Maksimovic) Date: Sun, 15 Nov 2020 06:55:52 +0100 Subject: [Haskell-cafe] Redirecting hackage.haskell.org to HTTPS In-Reply-To: References: Message-ID: So I change user agent signature ;) Greets, Branimir. On 11/15/20 6:42 AM, Tikhon Jelvis wrote: > Pages on hackage.haskell.org are > currently served over both HTTP and HTTPS. Package security on Hackage > does not depend on HTTPS, so we keep HTTP endpoints for backwards > compatibility with automated systems that depend on Hackage and do not > support HTTPS. > > However, this means that it's possible for users to inadvertently > browse Hackage pages on HTTP which is not a great user experience. To > address this issue without breaking existing scripts, we are planning > to redirect requests to HTTPS based on User-Agent headers: requests > with "Mozilla/5.0" in their User-Agent string will be redirected to > HTTPS and other requests will remain unchanged. > > Please contact us at > committee at haskell.org if this change > will cause problems with how you use Hackage. Otherwise, the new > behavior will go into effect on 2020-11-23. > > Thanks! > -Tikhon Jelvis, on behalf of the Haskell.org Committee > > _______________________________________________ > 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 m.douglas.mcilroy at dartmouth.edu Sun Nov 15 15:19:51 2020 From: m.douglas.mcilroy at dartmouth.edu (M Douglas McIlroy) Date: Sun, 15 Nov 2020 10:19:51 -0500 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? Message-ID: > I am pretty sure nobody writes code like this > I confirmed your example, reading with lynx and w3m. > wouldn’t just directly opening the sources (in a text editor) be simpler? Is there a (simple) way to preserve the experience when browsing using Lynx without also holding back features aimed at a regular browsing experience? I second that. I have always been annoyed by the ransom-note appearance of colorized listings. But that's just my taste. I suspect, though, that lots of people have been frustrated when they discover they can't use the code they see because it's festooned with markup. Golang.org offers similar listings, but also provides a button for selecting the underlying plain text. I would like hackage a lot better if it did so, too. Doug From bob at redivi.com Sun Nov 15 16:18:24 2020 From: bob at redivi.com (Bob Ippolito) Date: Sun, 15 Nov 2020 08:18:24 -0800 Subject: [Haskell-cafe] Redirecting hackage.haskell.org to HTTPS In-Reply-To: References: Message-ID: In addition to the redirect, and for the same reasons, enabling HSTS [1] and submitting it to the HSTS preload list for browsers [2] may also make sense. I don't think it should have any effect on agents that are visiting the HTTP version of the site unless the agent somehow simultaneously supports HSTS, has the preload list or has previously visited the site on HTTPS, and can't cope a client-side URL rewrite from HTTP to HTTPS. [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security [2] https://hstspreload.org/ -bob On Sat, Nov 14, 2020 at 9:43 PM Tikhon Jelvis wrote: > Pages on hackage.haskell.org are currently served over both HTTP and > HTTPS. Package security on Hackage does not depend on HTTPS, so we keep > HTTP endpoints for backwards compatibility with automated systems that > depend on Hackage and do not support HTTPS. > > However, this means that it's possible for users to inadvertently browse > Hackage pages on HTTP which is not a great user experience. To address this > issue without breaking existing scripts, we are planning to redirect > requests to HTTPS based on User-Agent headers: requests with "Mozilla/5.0" > in their User-Agent string will be redirected to HTTPS and other requests > will remain unchanged. > > Please contact us at committee at haskell.org if this change will cause > problems with how you use Hackage. Otherwise, the new behavior will go into > effect on 2020-11-23. > > Thanks! > -Tikhon Jelvis, on behalf of the Haskell.org Committee > _______________________________________________ > 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 emilypi at cohomolo.gy Sun Nov 15 18:45:41 2020 From: emilypi at cohomolo.gy (Emily Pillmore) Date: Sun, 15 Nov 2020 18:45:41 +0000 Subject: [Haskell-cafe] [ANN] base64-bytestring-1.2.0.1 + future plans Message-ID: Hi Everyone, I'm pleased to announce that we've released a new version of `base64-bytestring` that now supports `bytestring-0.11` in a backwards-compatible manner. I'd also like to make an RFC: we are thinking that we will drop support for GHC versions <7.10 in future releases of the project. The earliest release  in which this can be expected will be around 6 months from now. The dev burden for supporting back to 7.0 is high, and unless someone screams in protest, the value does not seem to be there. I'd like to get your thoughts on this. Cheers, Emily -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg.grenrus at iki.fi Sun Nov 15 18:48:18 2020 From: oleg.grenrus at iki.fi (Oleg Grenrus) Date: Sun, 15 Nov 2020 20:48:18 +0200 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? In-Reply-To: References: Message-ID: About hiding some parts of the DOM tree with aria-hidden attribute. https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute I'm :+1: to making accessibility-first designs / markup. We forgot that completely when accepting new color scheme for haddock. The accessible and pretty-looking are not in conflict, but not easy. - Oleg On 15.11.2020 17.19, M Douglas McIlroy wrote: >> I am pretty sure nobody writes code like this >> I confirmed your example, reading with lynx and w3m. >> wouldn’t just directly opening the sources (in a text editor) be simpler? Is there a (simple) way to preserve the experience when browsing using Lynx without also holding back features aimed at a regular browsing experience? > I second that. I have always been annoyed by the ransom-note > appearance of colorized listings. But that's just my taste. I > suspect, though, that lots of people have been frustrated when they > discover they can't use the code they see because it's festooned with > markup. Golang.org offers similar listings, but also provides a button > for selecting the underlying plain text. I would like hackage a lot > better if it did so, too. > > Doug > _______________________________________________ > 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 sjcjoosten+haskell at gmail.com Mon Nov 16 00:12:38 2020 From: sjcjoosten+haskell at gmail.com (Sebastiaan Joosten) Date: Sun, 15 Nov 2020 19:12:38 -0500 Subject: [Haskell-cafe] Reading Haddock sources on hackage no longer possible with simple browsers? In-Reply-To: References: Message-ID: I'm all for accessibility-first, but Oleg's solution won't help. Here's a test page for some features that are frequently discussed in this context: https://sjcjoosten.nl/tmp/test.html Opening this in a browser shows the following content: This content is perceivable by all browsers but should not be copiable by most. The standard says this content should not be perceivable by screen readers. This content is rendered via JavaScript and is not perceivable for those without JavaScript Here's what Lynx users see (line-wraps are due to the width of my terminal): This content is perceivable by all browsers but should not be copiable by most. The standard says this content should not be perceivable by screen readers. The standard says this content is not perceivable, following the HTML hidden tag. The standard says this content is not perceivable, using CSS. There are separate issues that passed this thread: - on Lynx, some things that are tooltips are displayed inline, they should not be displayed at all - using select+copy, some things are selected and copied (when I tried this in Chrome, this only happens if I copy while my mouse is over the Show/Eq element) There is actually a third use-case to consider, namely brower+screenreader combinations. Using apple's screen reader with Safari simply reads the 'should not be perceivable' line to me as well. Johannes created an issue for this here: https://github.com/haskell/haddock/issues/1250 I'll put my suggestions on how to fix this there. Best, Sebastiaan On Sun, Nov 15, 2020 at 1:49 PM Oleg Grenrus wrote: > About hiding some parts of the DOM tree with aria-hidden attribute. > > https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-hidden_attribute > > I'm :+1: to making accessibility-first designs / markup. We forgot that > completely when accepting new color scheme for haddock. The accessible > and pretty-looking are not in conflict, but not easy. > > - Oleg > > On 15.11.2020 17.19, M Douglas McIlroy wrote: > >> I am pretty sure nobody writes code like this > >> I confirmed your example, reading with lynx and w3m. > >> wouldn’t just directly opening the sources (in a text editor) be > simpler? Is there a (simple) way to preserve the experience when browsing > using Lynx without also holding back features aimed at a regular browsing > experience? > > I second that. I have always been annoyed by the ransom-note > > appearance of colorized listings. But that's just my taste. I > > suspect, though, that lots of people have been frustrated when they > > discover they can't use the code they see because it's festooned with > > markup. Golang.org offers similar listings, but also provides a button > > for selecting the underlying plain text. I would like hackage a lot > > better if it did so, too. > > > > Doug > > _______________________________________________ > > 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 carter.schonwald at gmail.com Mon Nov 16 18:02:52 2020 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 16 Nov 2020 12:02:52 -0600 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci Message-ID: Hey everyone: it looks like, from my perspective and experiences, that Travis ci should perhaps now be viewed as not open source friendly. Or even converging on hostile? 1) crazy long queue times/ latency for oss ci actions to run 2) very low concurrency on oss builds. 3) very low build build minute caps for oss that require high touch customer support contact to adjust. I’ve started moving my own projects slowly to gh actions for now, though there’s also gitlab ci , src hut and other options that may suit different folks. There’s definitely some ways to keep on having the clever cabal caching we know and love that folks like the Haskell-ci folks and others have hacked out for Travis be available on other platforms, though I don’t think there’s consolidated docs for those yet ? Def seen it discussed though. https://github.com/haskell-CI/haskell-ci/issues/411 Heres a url to my dupe ticket where I share an example naive use of the setup Haskell gh actions Config, definitely not perfect. But kinda amazing to have Mac and Linux and windows ci all in one ! :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulidtko at gmail.com Mon Nov 16 18:15:46 2020 From: ulidtko at gmail.com (ulidtko at gmail.com) Date: Mon, 16 Nov 2020 20:15:46 +0200 Subject: [Haskell-cafe] =?utf-8?q?Psa_=3A_perhaps_time_for_maintainers_to_?= =?utf-8?q?start_migrating_off_Travis_ci?= In-Reply-To: References: Message-ID: Speaking of CI systems and OpenSource, I'd like to mention CircleCI as well: https://circleci.com/open-source/ (No affiliation, just a happy user.) Did have slightly negative experience with TravisCI recently, can confirm the sentiment. On Mon, Nov 16 2020 at 12:02:52 PM -0600, Carter Schonwald wrote: > Hey everyone: it looks like, from my perspective and experiences, > that Travis ci should perhaps now be viewed as not open source > friendly. Or even converging on hostile? > > 1) crazy long queue times/ latency for oss ci actions to run > > 2) very low concurrency on oss builds. > > 3) very low build build minute caps for oss that require high touch > customer support contact to adjust. > > I’ve started moving my own projects slowly to gh actions for now, > though there’s also gitlab ci , src hut and other options that may > suit different folks. > > There’s definitely some ways to keep on having the clever cabal > caching we know and love that folks like the Haskell-ci folks and > others have hacked out for Travis be available on other platforms, > though I don’t think there’s consolidated docs for those yet ? > Def seen it discussed though. > > https://github.com/haskell-CI/haskell-ci/issues/411 > > Heres a url to my dupe ticket where I share an example naive use of > the setup Haskell gh actions Config, definitely not perfect. But > kinda amazing to have Mac and Linux and windows ci all in one ! :) > From mihai.maruseac at gmail.com Mon Nov 16 23:38:46 2020 From: mihai.maruseac at gmail.com (Mihai Maruseac) Date: Mon, 16 Nov 2020 15:38:46 -0800 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: References: Message-ID: As a user of all of the following, GitHub Actions > Circle CI > Travis. You get much more control on Github Actions, you can cache stuff, you can control when it runs. On Mon, Nov 16, 2020 at 10:17 AM wrote: > > Speaking of CI systems and OpenSource, I'd like to mention CircleCI as > well: https://circleci.com/open-source/ > (No affiliation, just a happy user.) > > Did have slightly negative experience with TravisCI recently, can > confirm the sentiment. > > On Mon, Nov 16 2020 at 12:02:52 PM -0600, Carter Schonwald > wrote: > > Hey everyone: it looks like, from my perspective and experiences, > > that Travis ci should perhaps now be viewed as not open source > > friendly. Or even converging on hostile? > > > > 1) crazy long queue times/ latency for oss ci actions to run > > > > 2) very low concurrency on oss builds. > > > > 3) very low build build minute caps for oss that require high touch > > customer support contact to adjust. > > > > I’ve started moving my own projects slowly to gh actions for now, > > though there’s also gitlab ci , src hut and other options that may > > suit different folks. > > > > There’s definitely some ways to keep on having the clever cabal > > caching we know and love that folks like the Haskell-ci folks and > > others have hacked out for Travis be available on other platforms, > > though I don’t think there’s consolidated docs for those yet ? > > Def seen it discussed though. > > > > https://github.com/haskell-CI/haskell-ci/issues/411 > > > > Heres a url to my dupe ticket where I share an example naive use of > > the setup Haskell gh actions Config, definitely not perfect. But > > kinda amazing to have Mac and Linux and windows ci all in one ! :) > > > > > _______________________________________________ > 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 From carter.schonwald at gmail.com Tue Nov 17 00:16:43 2020 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 16 Nov 2020 18:16:43 -0600 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: References: Message-ID: this mirrors my current understanding of all the choices myself, and it certainly helps that GH *explicitly* puts the OSS/free tier on equal or footing with paid customers. which absolutely makes sense given their various corporate structures (GH actions is a path to folks perhaps wanting to use azure services more organically? ) On Mon, Nov 16, 2020 at 5:39 PM Mihai Maruseac wrote: > As a user of all of the following, GitHub Actions > Circle CI > Travis. > > You get much more control on Github Actions, you can cache stuff, you > can control when it runs. > > On Mon, Nov 16, 2020 at 10:17 AM wrote: > > > > Speaking of CI systems and OpenSource, I'd like to mention CircleCI as > > well: https://circleci.com/open-source/ > > (No affiliation, just a happy user.) > > > > Did have slightly negative experience with TravisCI recently, can > > confirm the sentiment. > > > > On Mon, Nov 16 2020 at 12:02:52 PM -0600, Carter Schonwald > > wrote: > > > Hey everyone: it looks like, from my perspective and experiences, > > > that Travis ci should perhaps now be viewed as not open source > > > friendly. Or even converging on hostile? > > > > > > 1) crazy long queue times/ latency for oss ci actions to run > > > > > > 2) very low concurrency on oss builds. > > > > > > 3) very low build build minute caps for oss that require high touch > > > customer support contact to adjust. > > > > > > I’ve started moving my own projects slowly to gh actions for now, > > > though there’s also gitlab ci , src hut and other options that may > > > suit different folks. > > > > > > There’s definitely some ways to keep on having the clever cabal > > > caching we know and love that folks like the Haskell-ci folks and > > > others have hacked out for Travis be available on other platforms, > > > though I don’t think there’s consolidated docs for those yet ? > > > Def seen it discussed though. > > > > > > https://github.com/haskell-CI/haskell-ci/issues/411 > > > > > > Heres a url to my dupe ticket where I share an example naive use of > > > the setup Haskell gh actions Config, definitely not perfect. But > > > kinda amazing to have Mac and Linux and windows ci all in one ! :) > > > > > > > > > _______________________________________________ > > 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 jo at durchholz.org Tue Nov 17 06:18:59 2020 From: jo at durchholz.org (Joachim Durchholz) Date: Tue, 17 Nov 2020 07:18:59 +0100 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: References: Message-ID: <77986ff2-c8d4-25d3-3451-e23db4e4ea4b@durchholz.org> Careful about Github. It's currently OSS-friendly, but MS sometimes changes strategies abruptly, so they might move away from OSS, and much faster than Travis. Plus the more of Github's features you use, the harder it will be to migrate away from them when that happens (harder than with Travis). Maybe Gitlab is a viable alternative. At least the licensing is easier - the server code is MIT. They do dual licensing (Community and Enterprise Edition), so they could become "too commercial" over time, but if/when that happens, there's always the MIT-licensed Community Edition that can be taken over by volunteers for development. (Which in turn makes going full commercial less attractive for them, so it's a bit of a self-inhibiting prophecy.) (Disclaimer: I have no stake in the issue either way.) Am 17.11.20 um 01:16 schrieb Carter Schonwald: > this mirrors my current understanding of all the choices myself, and it > certainly helps that GH *explicitly* puts the OSS/free tier on equal or > footing with paid customers. > which  absolutely makes sense given their various corporate structures > (GH actions is a path to folks perhaps wanting to use azure services > more organically? ) > > On Mon, Nov 16, 2020 at 5:39 PM Mihai Maruseac > wrote: > > As a user of all of the following, GitHub Actions > Circle CI > Travis. > > You get much more control on Github Actions, you can cache stuff, you > can control when it runs. > > On Mon, Nov 16, 2020 at 10:17 AM > wrote: > > > > Speaking of CI systems and OpenSource, I'd like to mention > CircleCI as > > well: https://circleci.com/open-source/ > > (No affiliation, just a happy user.) > > > > Did have slightly negative experience with TravisCI recently, can > > confirm the sentiment. > > > > On Mon, Nov 16 2020 at 12:02:52 PM -0600, Carter Schonwald > > > > wrote: > > > Hey everyone: it looks like, from my perspective and experiences, > > > that Travis ci should perhaps now be viewed as not open source > > > friendly. Or even converging on hostile? > > > > > > 1) crazy long queue times/ latency for oss ci actions to run > > > > > > 2) very low concurrency on oss builds. > > > > > > 3) very low build build  minute caps for oss that require high > touch > > > customer support contact to adjust. > > > > > > I’ve started moving my own projects slowly to gh actions for now, > > > though there’s also gitlab ci , src hut and other options that may > > > suit different folks. > > > > > > There’s definitely some ways to keep on having the clever cabal > > > caching we know and love that folks like the Haskell-ci folks and > > > others have hacked out for Travis be available on other platforms, > > > though I don’t think there’s consolidated docs for those yet ? > > > Def seen it discussed though. > > > > > > https://github.com/haskell-CI/haskell-ci/issues/411 > > > > > > Heres a url to my dupe ticket where I share an example naive use of > > > the setup Haskell gh actions Config, definitely not perfect. But > > > kinda amazing to have Mac and Linux and windows ci all in one ! :) > > > > > > > > > _______________________________________________ > > 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 > > > _______________________________________________ > 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 b at chreekat.net Tue Nov 17 06:54:34 2020 From: b at chreekat.net (Bryan Richter) Date: Tue, 17 Nov 2020 08:54:34 +0200 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: <77986ff2-c8d4-25d3-3451-e23db4e4ea4b@durchholz.org> References: <77986ff2-c8d4-25d3-3451-e23db4e4ea4b@durchholz.org> Message-ID: I have to agree with Joachim. Everybody is good to OSS until it comes time to tighten the belt. That time has just come earlier to TravisCI than it has to Microsoft. None of these organizations are beholden to the people who use their services for free. Inversely, all of them ARE lawfully beholden to their owners and their paying customers. The viable long term strategies are (1) do it yourself [the blessing and curse of OSS], or (2) become a paying customer! On Tue, Nov 17, 2020 at 8:19 AM Joachim Durchholz wrote: > > Careful about Github. > It's currently OSS-friendly, but MS sometimes changes strategies > abruptly, so they might move away from OSS, and much faster than Travis. > Plus the more of Github's features you use, the harder it will be to > migrate away from them when that happens (harder than with Travis). > > Maybe Gitlab is a viable alternative. At least the licensing is easier - > the server code is MIT. > They do dual licensing (Community and Enterprise Edition), so they could > become "too commercial" over time, but if/when that happens, there's > always the MIT-licensed Community Edition that can be taken over by > volunteers for development. (Which in turn makes going full commercial > less attractive for them, so it's a bit of a self-inhibiting prophecy.) > > (Disclaimer: I have no stake in the issue either way.) > > Am 17.11.20 um 01:16 schrieb Carter Schonwald: > > this mirrors my current understanding of all the choices myself, and it > > certainly helps that GH *explicitly* puts the OSS/free tier on equal or > > footing with paid customers. > > which absolutely makes sense given their various corporate structures > > (GH actions is a path to folks perhaps wanting to use azure services > > more organically? ) > > > > On Mon, Nov 16, 2020 at 5:39 PM Mihai Maruseac > > wrote: > > > > As a user of all of the following, GitHub Actions > Circle CI > Travis. > > > > You get much more control on Github Actions, you can cache stuff, you > > can control when it runs. > > > > On Mon, Nov 16, 2020 at 10:17 AM > > wrote: > > > > > > Speaking of CI systems and OpenSource, I'd like to mention > > CircleCI as > > > well: https://circleci.com/open-source/ > > > (No affiliation, just a happy user.) > > > > > > Did have slightly negative experience with TravisCI recently, can > > > confirm the sentiment. > > > > > > On Mon, Nov 16 2020 at 12:02:52 PM -0600, Carter Schonwald > > > > > > wrote: > > > > Hey everyone: it looks like, from my perspective and experiences, > > > > that Travis ci should perhaps now be viewed as not open source > > > > friendly. Or even converging on hostile? > > > > > > > > 1) crazy long queue times/ latency for oss ci actions to run > > > > > > > > 2) very low concurrency on oss builds. > > > > > > > > 3) very low build build minute caps for oss that require high > > touch > > > > customer support contact to adjust. > > > > > > > > I’ve started moving my own projects slowly to gh actions for now, > > > > though there’s also gitlab ci , src hut and other options that may > > > > suit different folks. > > > > > > > > There’s definitely some ways to keep on having the clever cabal > > > > caching we know and love that folks like the Haskell-ci folks and > > > > others have hacked out for Travis be available on other platforms, > > > > though I don’t think there’s consolidated docs for those yet ? > > > > Def seen it discussed though. > > > > > > > > https://github.com/haskell-CI/haskell-ci/issues/411 > > > > > > > > Heres a url to my dupe ticket where I share an example naive use of > > > > the setup Haskell gh actions Config, definitely not perfect. But > > > > kinda amazing to have Mac and Linux and windows ci all in one ! :) > > > > > > > > > > > > > _______________________________________________ > > > 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 > > > > > > _______________________________________________ > > 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. From cma at bitemyapp.com Tue Nov 17 11:26:33 2020 From: cma at bitemyapp.com (Christopher Allen) Date: Tue, 17 Nov 2020 05:26:33 -0600 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: References: Message-ID: <69ED1EB5-EC88-47B0-9F37-653FB3314585@bitemyapp.com> GitLab CI has been really nice in my work and personal projects. Easy to add your own worker to the free site too. Sent from my iPhone > On Nov 17, 2020, at 00:56, Bryan Richter wrote: > > I have to agree with Joachim. Everybody is good to OSS until it comes > time to tighten the belt. That time has just come earlier to TravisCI > than it has to Microsoft. > > None of these organizations are beholden to the people who use their > services for free. Inversely, all of them ARE lawfully beholden to > their owners and their paying customers. > > The viable long term strategies are (1) do it yourself [the blessing > and curse of OSS], or (2) become a paying customer! > >> On Tue, Nov 17, 2020 at 8:19 AM Joachim Durchholz wrote: >> >> Careful about Github. >> It's currently OSS-friendly, but MS sometimes changes strategies >> abruptly, so they might move away from OSS, and much faster than Travis. >> Plus the more of Github's features you use, the harder it will be to >> migrate away from them when that happens (harder than with Travis). >> >> Maybe Gitlab is a viable alternative. At least the licensing is easier - >> the server code is MIT. >> They do dual licensing (Community and Enterprise Edition), so they could >> become "too commercial" over time, but if/when that happens, there's >> always the MIT-licensed Community Edition that can be taken over by >> volunteers for development. (Which in turn makes going full commercial >> less attractive for them, so it's a bit of a self-inhibiting prophecy.) >> >> (Disclaimer: I have no stake in the issue either way.) >> >>> Am 17.11.20 um 01:16 schrieb Carter Schonwald: >>> this mirrors my current understanding of all the choices myself, and it >>> certainly helps that GH *explicitly* puts the OSS/free tier on equal or >>> footing with paid customers. >>> which absolutely makes sense given their various corporate structures >>> (GH actions is a path to folks perhaps wanting to use azure services >>> more organically? ) >>> >>> On Mon, Nov 16, 2020 at 5:39 PM Mihai Maruseac >> > wrote: >>> >>> As a user of all of the following, GitHub Actions > Circle CI > Travis. >>> >>> You get much more control on Github Actions, you can cache stuff, you >>> can control when it runs. >>> >>> On Mon, Nov 16, 2020 at 10:17 AM >> > wrote: >>>> >>>> Speaking of CI systems and OpenSource, I'd like to mention >>> CircleCI as >>>> well: https://circleci.com/open-source/ >>>> (No affiliation, just a happy user.) >>>> >>>> Did have slightly negative experience with TravisCI recently, can >>>> confirm the sentiment. >>>> >>>> On Mon, Nov 16 2020 at 12:02:52 PM -0600, Carter Schonwald >>>> > >>> wrote: >>>>> Hey everyone: it looks like, from my perspective and experiences, >>>>> that Travis ci should perhaps now be viewed as not open source >>>>> friendly. Or even converging on hostile? >>>>> >>>>> 1) crazy long queue times/ latency for oss ci actions to run >>>>> >>>>> 2) very low concurrency on oss builds. >>>>> >>>>> 3) very low build build minute caps for oss that require high >>> touch >>>>> customer support contact to adjust. >>>>> >>>>> I’ve started moving my own projects slowly to gh actions for now, >>>>> though there’s also gitlab ci , src hut and other options that may >>>>> suit different folks. >>>>> >>>>> There’s definitely some ways to keep on having the clever cabal >>>>> caching we know and love that folks like the Haskell-ci folks and >>>>> others have hacked out for Travis be available on other platforms, >>>>> though I don’t think there’s consolidated docs for those yet ? >>>>> Def seen it discussed though. >>>>> >>>>> https://github.com/haskell-CI/haskell-ci/issues/411 >>>>> >>>>> Heres a url to my dupe ticket where I share an example naive use of >>>>> the setup Haskell gh actions Config, definitely not perfect. But >>>>> kinda amazing to have Mac and Linux and windows ci all in one ! :) >>>>> >>>> >>>> >>>> _______________________________________________ >>>> 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 >>> >>> >>> _______________________________________________ >>> 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. From sumitraja at gmail.com Tue Nov 17 12:20:10 2020 From: sumitraja at gmail.com (Sumit Raja) Date: Tue, 17 Nov 2020 23:20:10 +1100 Subject: [Haskell-cafe] GHC linker error 8.8.4 Windows Message-ID: Hi, Suddenly started getting the following linker error after I moved code around in my project. It only seems to occur when I am building one specific cabal test target. When building a dependent build it build successfully but cabal repl test-xxx fails. I have no consistent way to repro but I will keep trying and file a defect.. GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help GHC runtime linker: fatal error: I found a duplicate definition for symbol __gmpn_sec_sqr_itch whilst processing object file C:\Users\sumit\Apps\ghc-8.8.4\mingw\lib\libgmp.dll.a The symbol was previously defined in C:\Users\sumit\Apps\ghc-8.8.4\lib\integer-gmp-1.0.2.0\HSinteger-gmp-1.0.2.0.o This could be caused by: * Loading two different object files which export the same symbol * Specifying the same object file twice on the GHCi command line * An incorrect `package.conf' entry, causing some object to be loaded twice. ghc.exe: panic! (the 'impossible' happened) (GHC version 8.8.4 for x86_64-unknown-mingw32): loadArchive "C:\\Users\\sumit\\Apps\\ghc-8.8.4\\mingw\\lib\\libgmp.dll.a": failed Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug CallStack (from HasCallStack): die', called at .\\Distribution\\Client\\ProjectOrchestration.hs:1041:55 in main:Distribution.Client.ProjectOrchestration cabal.exe: repl failed for mkr-txn-0.1.0.0-inplace-test-mkr-txn. Regards Sumit -------------- next part -------------- An HTML attachment was scrubbed... URL: From sylvain at haskus.fr Tue Nov 17 13:41:34 2020 From: sylvain at haskus.fr (Sylvain Henry) Date: Tue, 17 Nov 2020 14:41:34 +0100 Subject: [Haskell-cafe] GHC linker error 8.8.4 Windows In-Reply-To: References: Message-ID: Hi, On Windows, GHC embeds GMP (the C library) directly into the integer-gmp package. So you mustn't try to link against another libgmp library to avoid duplicated symbol errors (as the one you've got). It may be that you have a dependency of this specific test (or the test itself) that has the following stanza in its Cabal file: "extra-libraries: gmp" Regards, Sylvain On 17/11/2020 13:20, Sumit Raja wrote: > Hi, > > Suddenly started getting the following linker error after I moved code > around in my project. It only seems to occur when I am building one > specific cabal test target. When building a dependent build it build > successfully but cabal repl test-xxx fails. I have no consistent way > to repro but I will keep trying and file a defect.. > > GHCi, version 8.8.4: https://www.haskell.org/ghc/  :? for help > GHC runtime linker: fatal error: I found a duplicate definition for symbol >    __gmpn_sec_sqr_itch > whilst processing object file >    C:\Users\sumit\Apps\ghc-8.8.4\mingw\lib\libgmp.dll.a > The symbol was previously defined in >  C:\Users\sumit\Apps\ghc-8.8.4\lib\integer-gmp-1.0.2.0\HSinteger-gmp-1.0.2.0.o > This could be caused by: >    * Loading two different object files which export the same symbol >    * Specifying the same object file twice on the GHCi command line >    * An incorrect `package.conf' entry, causing some object to be >      loaded twice. > ghc.exe: panic! (the 'impossible' happened) >   (GHC version 8.8.4 for x86_64-unknown-mingw32): >         loadArchive > "C:\\Users\\sumit\\Apps\\ghc-8.8.4\\mingw\\lib\\libgmp.dll.a": failed > > Please report this as a GHC bug: https://www.haskell.org/ghc/reportabug > > CallStack (from HasCallStack): >   die', called at > .\\Distribution\\Client\\ProjectOrchestration.hs:1041:55 in > main:Distribution.Client.ProjectOrchestration > cabal.exe: repl failed for mkr-txn-0.1.0.0-inplace-test-mkr-txn. > > Regards > Sumit > > > _______________________________________________ > 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 amindfv at mailbox.org Tue Nov 17 23:54:58 2020 From: amindfv at mailbox.org (amindfv at mailbox.org) Date: Tue, 17 Nov 2020 18:54:58 -0500 Subject: [Haskell-cafe] Why is my 'text' missing an instance? Message-ID: <20201117235458.GA9101@painter.painter> tl;dr: I seem to have two versions of 'text' on my system, both of which should have an instance for (Binary Text). However, one version seems to claim not to have that instance. $ cat test.hs import qualified Data.Text as T import qualified Data.Binary as B main = print $ B.encode $ T.pack "hello" $ /usr/local/bin/ghci --version The Glorious Glasgow Haskell Compilation System, version 8.10.2 $ /usr/local/bin/ghci test.hs GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( test.hs, interpreted ) test.hs:4:16: error: • No instance for (B.Binary T.Text) arising from a use of ‘B.encode’ • In the second argument of ‘($)’, namely ‘B.encode $ T.pack "hello"’ In the expression: print $ B.encode $ T.pack "hello" In an equation for ‘main’: main = print $ B.encode $ T.pack "hello" | 4 | main = print $ B.encode $ T.pack "hello" | ^^^^^^^^^^^^^^^^^^^^^^^^^ Failed, no modules loaded. $ /usr/local/bin/ghc-pkg list text /usr/local/lib/ghc-8.10.2/package.conf.d text-1.2.3.2 /home/name/.ghc/x86_64-linux-8.10.2/package.conf.d text-1.2.4.1 $ ghc-pkg-8.10.2 list text [same result] $ /usr/local/bin/ghci -package text-1.2.3.2 test.hs GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( test.hs, interpreted ) Ok, one module loaded. $ /usr/local/bin/ghci -package text-1.2.4.1 test.hs GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help [1 of 1] Compiling Main ( test.hs, interpreted ) test.hs:4:16: error: • No instance for (B.Binary T.Text) arising from a use of ‘B.encode’ • In the second argument of ‘($)’, namely ‘B.encode $ T.pack "hello"’ In the expression: print $ B.encode $ T.pack "hello" In an equation for ‘main’: main = print $ B.encode $ T.pack "hello" | 4 | main = print $ B.encode $ T.pack "hello" | ^^^^^^^^^^^^^^^^^^^^^^^^^ Failed, no modules loaded. Both text-1.2.3.2 and text-1.2.4.1 have a Binary instance for Text. What's going on? (After writing this out I rebuilt an unmodified clone of text-1.2.4.1 but I see the same results.) Thanks, Tom From tikhon at jelv.is Wed Nov 18 00:14:13 2020 From: tikhon at jelv.is (Tikhon Jelvis) Date: Tue, 17 Nov 2020 16:14:13 -0800 Subject: [Haskell-cafe] Why is my 'text' missing an instance? In-Reply-To: <20201117235458.GA9101@painter.painter> References: <20201117235458.GA9101@painter.painter> Message-ID: Wild guess—could there be an inconsistency between the version of the binary package the text library was built against and the version you got the class from in your failing example? I don't see how that would happen given your setup, but it's also the only way I can imagine seeing that particular error. On Tue, Nov 17, 2020, 15:57 amindfv--- via Haskell-Cafe < haskell-cafe at haskell.org> wrote: > tl;dr: I seem to have two versions of 'text' on my system, both of which > should have an instance for (Binary Text). However, one version seems to > claim not to have that instance. > > $ cat test.hs > import qualified Data.Text as T > import qualified Data.Binary as B > > main = print $ B.encode $ T.pack "hello" > > $ /usr/local/bin/ghci --version > The Glorious Glasgow Haskell Compilation System, version 8.10.2 > > $ /usr/local/bin/ghci test.hs > GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:4:16: error: > • No instance for (B.Binary T.Text) > arising from a use of ‘B.encode’ > • In the second argument of ‘($)’, namely > ‘B.encode $ T.pack "hello"’ > In the expression: print $ B.encode $ T.pack "hello" > In an equation for ‘main’: main = print $ B.encode $ T.pack > "hello" > | > 4 | main = print $ B.encode $ T.pack "hello" > | ^^^^^^^^^^^^^^^^^^^^^^^^^ > Failed, no modules loaded. > > $ /usr/local/bin/ghc-pkg list text > /usr/local/lib/ghc-8.10.2/package.conf.d > text-1.2.3.2 > /home/name/.ghc/x86_64-linux-8.10.2/package.conf.d > text-1.2.4.1 > > $ ghc-pkg-8.10.2 list text > [same result] > > $ /usr/local/bin/ghci -package text-1.2.3.2 test.hs > GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help > [1 of 1] Compiling Main ( test.hs, interpreted ) > Ok, one module loaded. > > $ /usr/local/bin/ghci -package text-1.2.4.1 test.hs > GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:4:16: error: > • No instance for (B.Binary T.Text) > arising from a use of ‘B.encode’ > • In the second argument of ‘($)’, namely > ‘B.encode $ T.pack "hello"’ > In the expression: print $ B.encode $ T.pack "hello" > In an equation for ‘main’: main = print $ B.encode $ T.pack > "hello" > | > 4 | main = print $ B.encode $ T.pack "hello" > | ^^^^^^^^^^^^^^^^^^^^^^^^^ > Failed, no modules loaded. > > Both text-1.2.3.2 and text-1.2.4.1 have a Binary instance for Text. What's > going on? > > (After writing this out I rebuilt an unmodified clone of text-1.2.4.1 but > I see the same results.) > > Thanks, > Tom > > _______________________________________________ > 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 ietf-dane at dukhovni.org Wed Nov 18 00:19:05 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Tue, 17 Nov 2020 19:19:05 -0500 Subject: [Haskell-cafe] Why is my 'text' missing an instance? In-Reply-To: <20201117235458.GA9101@painter.painter> References: <20201117235458.GA9101@painter.painter> Message-ID: <20201118001905.GS1464@straasha.imrryr.org> On Tue, Nov 17, 2020 at 06:54:58PM -0500, amindfv--- via Haskell-Cafe wrote: > tl;dr: I seem to have two versions of 'text' on my system, both of > which should have an instance for (Binary Text). However, one version > seems to claim not to have that instance. > > $ /usr/local/bin/ghci -package text-1.2.4.1 test.hs > GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help > [1 of 1] Compiling Main ( test.hs, interpreted ) > > test.hs:4:16: error: > • No instance for (B.Binary T.Text) > arising from a use of ‘B.encode’ Hard to say what's different on your system, but on a Fedora 31 system with GHC 8.10.2 and text-1.2.4.1, I'm unable to reproduce the symptoms you report. $ ghci -package text-1.2.4.1 GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help Prelude> import qualified Data.Text as T Prelude T> import qualified Data.Binary as B Prelude T B> main = print $ B.encode $ T.pack "hello" Prelude T B> main "\NUL\NUL\NUL\NUL\NUL\NUL\NUL\ENQhello" The interface file for Text 1.2.4.1 has the expected instances: $ ghc-pkg list ~/.local/ghc-8.10/lib/ghc-8.10.2/lib/package.conf.d ... text-1.2.4.1 ... ~/.ghc/x86_64-linux-8.10.2/package.conf.d (no packages) $ ghc --show-iface ~/.local/ghc-8.10/lib/ghc-8.10.2/lib/x86_64-linux-ghc-8.10.2/text-1.2.4.1/Data/Text.hi | grep '^instance' instance [orphan] Data.Binary.Class.Binary [Data.Text.Internal.Text] instance [orphan] Data.Data.Data [Data.Text.Internal.Text] instance [orphan] GHC.Classes.Eq [Data.Text.Internal.Text] instance [orphan] GHC.Exts.IsList [Data.Text.Internal.Text] instance [orphan] Data.String.IsString [Data.Text.Internal.Text] instance [orphan] Language.Haskell.TH.Syntax.Lift [GHC.Types.LiftedRep, instance [orphan] GHC.Base.Monoid [Data.Text.Internal.Text] instance [orphan] Control.DeepSeq.NFData [Data.Text.Internal.Text] instance [orphan] GHC.Classes.Ord [Data.Text.Internal.Text] instance [orphan] Text.Printf.PrintfArg [Data.Text.Internal.Text] instance [orphan] GHC.Read.Read [Data.Text.Internal.Text] instance [orphan] GHC.Base.Semigroup [Data.Text.Internal.Text] -- Viktor. From allbery.b at gmail.com Wed Nov 18 01:01:38 2020 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 17 Nov 2020 20:01:38 -0500 Subject: [Haskell-cafe] Why is my 'text' missing an instance? In-Reply-To: References: <20201117235458.GA9101@painter.painter> Message-ID: Actually that can happen if there are two versions of text built against different versions of binary, but ghc (or cabal in old mode, which let ghc do it) picked the wrong version of binary for the version of text it chose. On Tue, Nov 17, 2020, 19:15 Tikhon Jelvis wrote: > Wild guess—could there be an inconsistency between the version of the > binary package the text library was built against and the version you got > the class from in your failing example? > > I don't see how that would happen given your setup, but it's also the only > way I can imagine seeing that particular error. > > On Tue, Nov 17, 2020, 15:57 amindfv--- via Haskell-Cafe < > haskell-cafe at haskell.org> wrote: > >> tl;dr: I seem to have two versions of 'text' on my system, both of which >> should have an instance for (Binary Text). However, one version seems to >> claim not to have that instance. >> >> $ cat test.hs >> import qualified Data.Text as T >> import qualified Data.Binary as B >> >> main = print $ B.encode $ T.pack "hello" >> >> $ /usr/local/bin/ghci --version >> The Glorious Glasgow Haskell Compilation System, version 8.10.2 >> >> $ /usr/local/bin/ghci test.hs >> GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help >> [1 of 1] Compiling Main ( test.hs, interpreted ) >> >> test.hs:4:16: error: >> • No instance for (B.Binary T.Text) >> arising from a use of ‘B.encode’ >> • In the second argument of ‘($)’, namely >> ‘B.encode $ T.pack "hello"’ >> In the expression: print $ B.encode $ T.pack "hello" >> In an equation for ‘main’: main = print $ B.encode $ T.pack >> "hello" >> | >> 4 | main = print $ B.encode $ T.pack "hello" >> | ^^^^^^^^^^^^^^^^^^^^^^^^^ >> Failed, no modules loaded. >> >> $ /usr/local/bin/ghc-pkg list text >> /usr/local/lib/ghc-8.10.2/package.conf.d >> text-1.2.3.2 >> /home/name/.ghc/x86_64-linux-8.10.2/package.conf.d >> text-1.2.4.1 >> >> $ ghc-pkg-8.10.2 list text >> [same result] >> >> $ /usr/local/bin/ghci -package text-1.2.3.2 test.hs >> GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help >> [1 of 1] Compiling Main ( test.hs, interpreted ) >> Ok, one module loaded. >> >> $ /usr/local/bin/ghci -package text-1.2.4.1 test.hs >> GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help >> [1 of 1] Compiling Main ( test.hs, interpreted ) >> >> test.hs:4:16: error: >> • No instance for (B.Binary T.Text) >> arising from a use of ‘B.encode’ >> • In the second argument of ‘($)’, namely >> ‘B.encode $ T.pack "hello"’ >> In the expression: print $ B.encode $ T.pack "hello" >> In an equation for ‘main’: main = print $ B.encode $ T.pack >> "hello" >> | >> 4 | main = print $ B.encode $ T.pack "hello" >> | ^^^^^^^^^^^^^^^^^^^^^^^^^ >> Failed, no modules loaded. >> >> Both text-1.2.3.2 and text-1.2.4.1 have a Binary instance for Text. >> What's going on? >> >> (After writing this out I rebuilt an unmodified clone of text-1.2.4.1 but >> I see the same results.) >> >> Thanks, >> Tom >> >> _______________________________________________ >> 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 amindfv at mailbox.org Wed Nov 18 03:45:45 2020 From: amindfv at mailbox.org (amindfv at mailbox.org) Date: Tue, 17 Nov 2020 22:45:45 -0500 Subject: [Haskell-cafe] Why is my 'text' missing an instance? In-Reply-To: References: <20201117235458.GA9101@painter.painter> Message-ID: <20201118034545.GA5231@painter.painter> Aha - this was it, mystery solved! I was thrown off the scent by "instance Binary Text" not showing up in the instance list when doing this in ghci: > :m + Data.Text > :m + Data.Binary > :i Text Thank you! Tom On Tue, Nov 17, 2020 at 04:14:13PM -0800, Tikhon Jelvis wrote: > Wild guess—could there be an inconsistency between the version of the > binary package the text library was built against and the version you got > the class from in your failing example? > > I don't see how that would happen given your setup, but it's also the only > way I can imagine seeing that particular error. > > On Tue, Nov 17, 2020, 15:57 amindfv--- via Haskell-Cafe < > haskell-cafe at haskell.org> wrote: > > > tl;dr: I seem to have two versions of 'text' on my system, both of which > > should have an instance for (Binary Text). However, one version seems to > > claim not to have that instance. > > > > $ cat test.hs > > import qualified Data.Text as T > > import qualified Data.Binary as B > > > > main = print $ B.encode $ T.pack "hello" > > > > $ /usr/local/bin/ghci --version > > The Glorious Glasgow Haskell Compilation System, version 8.10.2 > > > > $ /usr/local/bin/ghci test.hs > > GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help > > [1 of 1] Compiling Main ( test.hs, interpreted ) > > > > test.hs:4:16: error: > > • No instance for (B.Binary T.Text) > > arising from a use of ‘B.encode’ > > • In the second argument of ‘($)’, namely > > ‘B.encode $ T.pack "hello"’ > > In the expression: print $ B.encode $ T.pack "hello" > > In an equation for ‘main’: main = print $ B.encode $ T.pack > > "hello" > > | > > 4 | main = print $ B.encode $ T.pack "hello" > > | ^^^^^^^^^^^^^^^^^^^^^^^^^ > > Failed, no modules loaded. > > > > $ /usr/local/bin/ghc-pkg list text > > /usr/local/lib/ghc-8.10.2/package.conf.d > > text-1.2.3.2 > > /home/name/.ghc/x86_64-linux-8.10.2/package.conf.d > > text-1.2.4.1 > > > > $ ghc-pkg-8.10.2 list text > > [same result] > > > > $ /usr/local/bin/ghci -package text-1.2.3.2 test.hs > > GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help > > [1 of 1] Compiling Main ( test.hs, interpreted ) > > Ok, one module loaded. > > > > $ /usr/local/bin/ghci -package text-1.2.4.1 test.hs > > GHCi, version 8.10.2: https://www.haskell.org/ghc/ :? for help > > [1 of 1] Compiling Main ( test.hs, interpreted ) > > > > test.hs:4:16: error: > > • No instance for (B.Binary T.Text) > > arising from a use of ‘B.encode’ > > • In the second argument of ‘($)’, namely > > ‘B.encode $ T.pack "hello"’ > > In the expression: print $ B.encode $ T.pack "hello" > > In an equation for ‘main’: main = print $ B.encode $ T.pack > > "hello" > > | > > 4 | main = print $ B.encode $ T.pack "hello" > > | ^^^^^^^^^^^^^^^^^^^^^^^^^ > > Failed, no modules loaded. > > > > Both text-1.2.3.2 and text-1.2.4.1 have a Binary instance for Text. What's > > going on? > > > > (After writing this out I rebuilt an unmodified clone of text-1.2.4.1 but > > I see the same results.) > > > > Thanks, > > Tom > > > > _______________________________________________ > > 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 immanuel.litzroth at gmail.com Wed Nov 18 12:19:28 2020 From: immanuel.litzroth at gmail.com (Immanuel Litzroth) Date: Wed, 18 Nov 2020 13:19:28 +0100 Subject: [Haskell-cafe] ghci module re exporting qualified as Message-ID: I'm trying to make a test module to run tests. I want to import the test functionality + imported functionality in the scope of the test module under ghci. I also want to have short names in the Test module for reexported modules. I am using Data.Map and Data.Set ... so lot's of conflicting exports. Is this possible? #+BEGIN_SRC haskell :tangle T1.hs module T1 ( module Data.Map) where import qualified Data.Map #+END_SRC works but no browsing info shows up #+BEGIN_EXAMPLE λ⊢ :show modules T1 .... λ⊢ :show imports import T1 -- added automatically import Prelude -- implicit λ⊢ fromList [] :114:1-8: error: Variable not in scope: fromList ∷ [a0] → t λ⊢ Data.Map.fromList [] fromList [] λ⊢ :browse! T1 λ⊢ #+END_EXAMPLE #+BEGIN_SRC haskell :tangle T2.hs module T2 ( module Map) where import qualified Data.Map as Map #+END_SRC #+BEGIN_EXAMPLE λ⊢ :show modules T2 :show imports import T2 -- added automatically import Prelude -- implicit λ⊢ fromList [] :119:1-8: error: Variable not in scope: fromList ∷ [a0] → t λ⊢ Map.fromList [] :120:1-12: error: Not in scope: ‘Map.fromList’ No module named ‘Map’ is imported. λ⊢ Data.Map.fromList [] fromList [] λ⊢ :browse! T2 λ⊢ #+END_EXAMPLE -- -- Researching the dual problem of finding the function that has a given point as fixpoint. From lemming at henning-thielemann.de Wed Nov 18 15:14:53 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Wed, 18 Nov 2020 16:14:53 +0100 (CET) Subject: [Haskell-cafe] ghci module re exporting qualified as In-Reply-To: References: Message-ID: On Wed, 18 Nov 2020, Immanuel Litzroth wrote: > I'm trying to make a test module to run tests. > I want to import the test functionality + imported functionality in > the scope of the test module under ghci. > I also want to have short names in the Test module for reexported > modules. I am using Data.Map and Data.Set ... so lot's of conflicting > exports. > Is this possible? > > > #+BEGIN_SRC haskell :tangle T1.hs > module T1 ( > module Data.Map) where > import qualified Data.Map > #+END_SRC Maybe omit the export list? From immanuel.litzroth at gmail.com Wed Nov 18 16:27:58 2020 From: immanuel.litzroth at gmail.com (Immanuel Litzroth) Date: Wed, 18 Nov 2020 17:27:58 +0100 Subject: [Haskell-cafe] ghci module re exporting qualified as In-Reply-To: References: Message-ID: You mean this? #+BEGIN_SRC haskell :tangle T1.hs module T1 where import Data.Map as Map #+END_SRC that doesn't seem to do it: #+BEGIN_EXAMPLE λ⊢ :show modules T1 λ⊢ :show imports import T1 -- added automatically import Prelude -- implicit λ⊢ fromList :143:1-8: error: Variable not in scope: fromList λ⊢ Map.fromList :144:1-12: error: Not in scope: ‘Map.fromList’ No module named ‘Map’ is imported. λ⊢ Data.Map.FromList :145:1-17: error: Not in scope: data constructor ‘Data.Map.FromList’ No module named ‘Data.Map’ is imported. λ⊢ #+END_EXAMPLE On Wed, Nov 18, 2020 at 4:14 PM Henning Thielemann wrote: > > > On Wed, 18 Nov 2020, Immanuel Litzroth wrote: > > > I'm trying to make a test module to run tests. > > I want to import the test functionality + imported functionality in > > the scope of the test module under ghci. > > I also want to have short names in the Test module for reexported > > modules. I am using Data.Map and Data.Set ... so lot's of conflicting > > exports. > > Is this possible? > > > > > > #+BEGIN_SRC haskell :tangle T1.hs > > module T1 ( > > module Data.Map) where > > import qualified Data.Map > > #+END_SRC > > Maybe omit the export list? -- -- Researching the dual problem of finding the function that has a given point as fixpoint. From lemming at henning-thielemann.de Wed Nov 18 16:30:51 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Wed, 18 Nov 2020 17:30:51 +0100 (CET) Subject: [Haskell-cafe] ghci module re exporting qualified as In-Reply-To: References: Message-ID: On Wed, 18 Nov 2020, Immanuel Litzroth wrote: > You mean this? > #+BEGIN_SRC haskell :tangle T1.hs > module T1 where > import Data.Map as Map > #+END_SRC > > that doesn't seem to do it: > #+BEGIN_EXAMPLE > λ⊢ :show modules > T1 > λ⊢ :show imports > import T1 -- added automatically > import Prelude -- implicit > λ⊢ fromList > > :143:1-8: error: Variable not in scope: fromList > λ⊢ Map.fromList > > :144:1-12: error: > Not in scope: ‘Map.fromList’ > No module named ‘Map’ is imported. > λ⊢ Data.Map.FromList Hm. Was the module compiled? You can only benefit from imports, if the module is interpreted. From allbery.b at gmail.com Wed Nov 18 16:42:40 2020 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 18 Nov 2020 11:42:40 -0500 Subject: [Haskell-cafe] ghci module re exporting qualified as In-Reply-To: References: Message-ID: I'm under the impression that they want to export names qualified, but qualification only happens on import. If you export names from an imported module, they will appear to be from the imported module, not the original. On Wed, Nov 18, 2020, 11:32 Henning Thielemann < lemming at henning-thielemann.de> wrote: > > On Wed, 18 Nov 2020, Immanuel Litzroth wrote: > > > You mean this? > > #+BEGIN_SRC haskell :tangle T1.hs > > module T1 where > > import Data.Map as Map > > #+END_SRC > > > > that doesn't seem to do it: > > #+BEGIN_EXAMPLE > > λ⊢ :show modules > > T1 > > λ⊢ :show imports > > import T1 -- added automatically > > import Prelude -- implicit > > λ⊢ fromList > > > > :143:1-8: error: Variable not in scope: fromList > > λ⊢ Map.fromList > > > > :144:1-12: error: > > Not in scope: ‘Map.fromList’ > > No module named ‘Map’ is imported. > > λ⊢ Data.Map.FromList > > > Hm. Was the module compiled? You can only benefit from imports, if the > module is interpreted._______________________________________________ > 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 lemming at henning-thielemann.de Wed Nov 18 16:44:56 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Wed, 18 Nov 2020 17:44:56 +0100 (CET) Subject: [Haskell-cafe] ghci module re exporting qualified as In-Reply-To: References: Message-ID: On Wed, 18 Nov 2020, Brandon Allbery wrote: > I'm under the impression that they want to export names qualified, but > qualification only happens on import. If you export names from an > imported module, they will appear to be from the imported module, not > the original. That's true for compiled Haskell. But I know I have already re-used the qualifications within interpreted modules in GHCi. From aeroboy94 at gmail.com Wed Nov 18 18:23:21 2020 From: aeroboy94 at gmail.com (Arian van Putten) Date: Wed, 18 Nov 2020 19:23:21 +0100 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: References: Message-ID: Thanks for the example Carter. I've been struggling with Servant's CI since the recent Travis changes as CI now somtimes takes up to multiple hours to complete. It would be awesome if somebody would volunteer adding a Github or Gitlab backend to haskell-ci; such that I do not have to re-invent the entire CI systems that is in place currently from scratch though. Killer feature for us is the parsing of `Tested-With` in cabal files to adjust the build matrix; as e.g. not all our packages for on GHCJS for example. However your example doesn't look that complicated. I'm going to play around with it. On Mon, Nov 16, 2020 at 7:04 PM Carter Schonwald wrote: > Hey everyone: it looks like, from my perspective and experiences, that > Travis ci should perhaps now be viewed as not open source friendly. Or even > converging on hostile? > > 1) crazy long queue times/ latency for oss ci actions to run > > 2) very low concurrency on oss builds. > > 3) very low build build minute caps for oss that require high touch > customer support contact to adjust. > > I’ve started moving my own projects slowly to gh actions for now, though > there’s also gitlab ci , src hut and other options that may suit different > folks. > > There’s definitely some ways to keep on having the clever cabal caching we > know and love that folks like the Haskell-ci folks and others have hacked > out for Travis be available on other platforms, though I don’t think > there’s consolidated docs for those yet ? Def seen it discussed though. > > https://github.com/haskell-CI/haskell-ci/issues/411 > > Heres a url to my dupe ticket where I share an example naive use of the > setup Haskell gh actions Config, definitely not perfect. But kinda amazing > to have Mac and Linux and windows ci all in one ! :) > > _______________________________________________ > 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. -- Groetjes, Arian -------------- next part -------------- An HTML attachment was scrubbed... URL: From sumitraja at gmail.com Thu Nov 19 00:48:32 2020 From: sumitraja at gmail.com (Sumit Raja) Date: Thu, 19 Nov 2020 11:48:32 +1100 Subject: [Haskell-cafe] Haskell-Cafe Digest, Vol 207, Issue 16 In-Reply-To: References: Message-ID: > It may be that you have a dependency of this specific test (or the test > itself) that has the following stanza in its Cabal file: > "extra-libraries: gmp" > > Thanks, makes sense. Any shortcuts to try and find which package has gmp enabled? Interestingly this problem doesn't happen with ghc-8.6.5. Does build order decide on if this issue is triggered or not? -Sumit -------------- next part -------------- An HTML attachment was scrubbed... URL: From jo at durchholz.org Thu Nov 19 07:12:13 2020 From: jo at durchholz.org (Joachim Durchholz) Date: Thu, 19 Nov 2020 08:12:13 +0100 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: References: Message-ID: <79ff1bb4-063e-deff-2b46-f94871a86d93@durchholz.org> Am 18.11.20 um 19:23 schrieb Arian van Putten: > It would be awesome if somebody would volunteer adding a Github or > Gitlab backend to haskell-ci; What would be needed? > such that I do not have to re-invent the entire CI systems that is > in place currently from scratch though Killer feature for us is the > parsing of `Tested-With` in cabal files to adjust the build matrix; > as e.g. not all our packages for on GHCJS for example. I.e. volunteers would need to know (or learn) what's there currently. Other question: What kind of hardware would be needed? I.e. how much CPU/RAM to get the queues emptied quickly enough. Regards, Jo (Disclaimer: I cannot volunteer due to lack of time, just trying to contribute whatever tooling ops knowledge I happen to have.) From sylvain at haskus.fr Thu Nov 19 10:38:36 2020 From: sylvain at haskus.fr (Sylvain Henry) Date: Thu, 19 Nov 2020 11:38:36 +0100 Subject: [Haskell-cafe] Haskell-Cafe Digest, Vol 207, Issue 16 In-Reply-To: References: Message-ID: On 19/11/2020 01:48, Sumit Raja wrote: > > It may be that you have a dependency of this specific test (or the > test > itself) that has the following stanza in its Cabal file: > "extra-libraries: gmp" > > > Thanks, makes sense. Any shortcuts to try and find which package has > gmp enabled? > You may grep for "gmp" in your "package.conf.d". A usual suspect is "bitvec" which has a "libmp" flag that you can disable. > Interestingly this problem doesn't happen with ghc-8.6.5. Does build > order decide on if this issue is triggered or not? > I don't think so. My guess would be that using 8.6.5 changes the build plan (e.g. earlier versions of "bitvec" didn't explicitly link with gmp). Cheers, Sylvain -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Thu Nov 19 20:40:39 2020 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 19 Nov 2020 14:40:39 -0600 Subject: [Haskell-cafe] Psa : perhaps time for maintainers to start migrating off Travis ci In-Reply-To: References: Message-ID: I've gotten things to be even nice and working on windows finally! (including having the steps shared on on platforms in a single buildway :) ! ) plus figuring out how to sidestep a fun / terrible issue on windows , but now fixed for me :) https://github.com/cartazio/ralist/actions/runs/373071421/workflow is the current one i have and attached is a copy that should be easy to adapt enjoy! On Wed, Nov 18, 2020 at 12:23 PM Arian van Putten wrote: > Thanks for the example Carter. > > I've been struggling with Servant's CI since the recent Travis changes as > CI now somtimes takes up to multiple hours to complete. > > It would be awesome if somebody would volunteer adding a Github or Gitlab > backend to haskell-ci; such that I do not have to re-invent the entire CI > systems that is in place currently from scratch though. Killer feature for > us is the parsing of `Tested-With` in cabal files to adjust the build > matrix; as e.g. not all our packages for on GHCJS for example. > > However your example doesn't look that complicated. I'm going to play > around with it. > > On Mon, Nov 16, 2020 at 7:04 PM Carter Schonwald < > carter.schonwald at gmail.com> wrote: > >> Hey everyone: it looks like, from my perspective and experiences, that >> Travis ci should perhaps now be viewed as not open source friendly. Or even >> converging on hostile? >> >> 1) crazy long queue times/ latency for oss ci actions to run >> >> 2) very low concurrency on oss builds. >> >> 3) very low build build minute caps for oss that require high touch >> customer support contact to adjust. >> >> I’ve started moving my own projects slowly to gh actions for now, though >> there’s also gitlab ci , src hut and other options that may suit different >> folks. >> >> There’s definitely some ways to keep on having the clever cabal caching >> we know and love that folks like the Haskell-ci folks and others have >> hacked out for Travis be available on other platforms, though I don’t think >> there’s consolidated docs for those yet ? Def seen it discussed though. >> >> https://github.com/haskell-CI/haskell-ci/issues/411 >> >> Heres a url to my dupe ticket where I share an example naive use of the >> setup Haskell gh actions Config, definitely not perfect. But kinda amazing >> to have Mac and Linux and windows ci all in one ! :) >> >> _______________________________________________ >> 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. > > > > -- > Groetjes, > > Arian > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: hs-matrix.yml Type: application/x-yaml Size: 2862 bytes Desc: not available URL: From karel.gardas at centrum.cz Fri Nov 20 18:23:16 2020 From: karel.gardas at centrum.cz (Karel Gardas) Date: Fri, 20 Nov 2020 19:23:16 +0100 Subject: [Haskell-cafe] xmonad: eyes based navigation between monitors. Message-ID: <742633a6-bdee-1a32-de7f-bb2ebc5f1f14@centrum.cz> Hello, I'm using xmonad in a setup with 3 monitors and I'm curious if anybody here got kind of eyes-based navigation working between monitors/workspaces. Explanation: I need to type into windows on different monitors but in not specific order. Sometime I got too deep into thinking that I forget to switch workspace and then I type to different window in different workspace than is intended (and which I see with eyes). Basically I'd like some mode where xmonad will switch workspaces based on my eye/head position so only workspace I follow with eyes will be active. I see that such software (following head/eyes) already exist in AI domain (E.g. NV's xavier NX developer kit demo: from 16:00: https://www.youtube.com/watch?v=aUz1bNGm04w) but I'm more interested in amd64/linux setup as this is for my workstation... Any idea highly appreciated! Thanks! Karel From johnz at pleasantnightmare.com Fri Nov 20 19:09:14 2020 From: johnz at pleasantnightmare.com (John Z.) Date: Fri, 20 Nov 2020 14:09:14 -0500 Subject: [Haskell-cafe] xmonad: eyes based navigation between monitors. In-Reply-To: <742633a6-bdee-1a32-de7f-bb2ebc5f1f14@centrum.cz> References: <742633a6-bdee-1a32-de7f-bb2ebc5f1f14@centrum.cz> Message-ID: Don't have a ready solution, but this is such an interesting idea since I have same setup. I might try a toy weekend project using a random kinect I have lying around. > Hello, > > I'm using xmonad in a setup with 3 monitors and I'm curious if anybody > here got kind of eyes-based navigation working between monitors/workspaces. > > Explanation: I need to type into windows on different monitors but in > not specific order. Sometime I got too deep into thinking that I forget > to switch workspace and then I type to different window in different > workspace than is intended (and which I see with eyes). Basically I'd > like some mode where xmonad will switch workspaces based on my eye/head > position so only workspace I follow with eyes will be active. > > I see that such software (following head/eyes) already exist in AI > domain (E.g. NV's xavier NX developer kit demo: from 16:00: > https://www.youtube.com/watch?v=aUz1bNGm04w) but I'm more interested in > amd64/linux setup as this is for my workstation... > > Any idea highly appreciated! > > Thanks! > Karel > _______________________________________________ > 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. -- John Z. "Its too bad she won't live... but then again, who does?" From ivanperezdominguez at gmail.com Fri Nov 20 20:20:55 2020 From: ivanperezdominguez at gmail.com (Ivan Perez) Date: Fri, 20 Nov 2020 15:20:55 -0500 Subject: [Haskell-cafe] xmonad: eyes based navigation between monitors. In-Reply-To: References: <742633a6-bdee-1a32-de7f-bb2ebc5f1f14@centrum.cz> Message-ID: Hi all In case it's useful, the following two projects I built a few years ago might help: Kinect control for the game Haskanoid: https://github.com/ivanperez-keera/haskanoid/blob/develop/src/Input.hs#L237-L280 Webcam-based face position/distance detection module for a posture monitor: https://github.com/keera-studios/keera-posture/blob/develop/src/AI/CV/PostureProcessors.hs#L40 Either method could achieve something like what you want. I'd recommend playing with having the kinect/webcam in different positions (not just between the monitors, and potentially even slightly to the right of the rightmost monitor, or to the left of the leftmost one). I never managed to make eye detection work on Kinect. I heard the very latest version of the kinect (under development in 2017) was able to detect eye movement well, but never tried it myself. It would have been a cool accessibility feature for haskanoid. All the best, Ivan On Fri, 20 Nov 2020 at 14:10, John Z. wrote: > Don't have a ready solution, but this is such an interesting idea since I > have same setup. I might try a toy weekend project using a random kinect > I have lying around. > > > > Hello, > > > > I'm using xmonad in a setup with 3 monitors and I'm curious if anybody > > here got kind of eyes-based navigation working between > monitors/workspaces. > > > > Explanation: I need to type into windows on different monitors but in > > not specific order. Sometime I got too deep into thinking that I forget > > to switch workspace and then I type to different window in different > > workspace than is intended (and which I see with eyes). Basically I'd > > like some mode where xmonad will switch workspaces based on my eye/head > > position so only workspace I follow with eyes will be active. > > > > I see that such software (following head/eyes) already exist in AI > > domain (E.g. NV's xavier NX developer kit demo: from 16:00: > > https://www.youtube.com/watch?v=aUz1bNGm04w) but I'm more interested in > > amd64/linux setup as this is for my workstation... > > > > Any idea highly appreciated! > > > > Thanks! > > Karel > > _______________________________________________ > > 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. > > -- > John Z. > "Its too bad she won't live... but then again, who does?" > _______________________________________________ > 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 tikhon at jelv.is Fri Nov 20 20:40:51 2020 From: tikhon at jelv.is (Tikhon Jelvis) Date: Fri, 20 Nov 2020 12:40:51 -0800 Subject: [Haskell-cafe] xmonad: eyes based navigation between monitors. In-Reply-To: References: <742633a6-bdee-1a32-de7f-bb2ebc5f1f14@centrum.cz> Message-ID: I've thought about this myself, although not seriously. At one point, I even considered buying a monitor with eye-tracking built in :). There's a commercial eye-tracking product from Tobii aimed at gamers, and my instinct is that starting from a purpose-built eye-tracker would work much better than using a webcam or Kinect. However, it seems the Tobii product is fundamentally limited to one monitor at a time and only has unofficial Linux support. If you do make something work, I'd love to hear about it. On Fri, Nov 20, 2020, 12:24 Ivan Perez wrote: > Hi all > > In case it's useful, the following two projects I built a few years ago > might help: > > Kinect control for the game Haskanoid: > > > https://github.com/ivanperez-keera/haskanoid/blob/develop/src/Input.hs#L237-L280 > > Webcam-based face position/distance detection module for a posture monitor: > > > https://github.com/keera-studios/keera-posture/blob/develop/src/AI/CV/PostureProcessors.hs#L40 > > Either method could achieve something like what you want. I'd recommend > playing with having the kinect/webcam in different positions (not just > between the monitors, and potentially even slightly to the right of the > rightmost monitor, or to the left of the leftmost one). > > I never managed to make eye detection work on Kinect. I heard the very > latest version of the kinect (under development in 2017) was able to detect > eye movement well, but never tried it myself. It would have been a cool > accessibility feature for haskanoid. > > All the best, > > Ivan > > On Fri, 20 Nov 2020 at 14:10, John Z. wrote: > >> Don't have a ready solution, but this is such an interesting idea since I >> have same setup. I might try a toy weekend project using a random kinect >> I have lying around. >> >> >> > Hello, >> > >> > I'm using xmonad in a setup with 3 monitors and I'm curious if anybody >> > here got kind of eyes-based navigation working between >> monitors/workspaces. >> > >> > Explanation: I need to type into windows on different monitors but in >> > not specific order. Sometime I got too deep into thinking that I forget >> > to switch workspace and then I type to different window in different >> > workspace than is intended (and which I see with eyes). Basically I'd >> > like some mode where xmonad will switch workspaces based on my eye/head >> > position so only workspace I follow with eyes will be active. >> > >> > I see that such software (following head/eyes) already exist in AI >> > domain (E.g. NV's xavier NX developer kit demo: from 16:00: >> > https://www.youtube.com/watch?v=aUz1bNGm04w) but I'm more interested in >> > amd64/linux setup as this is for my workstation... >> > >> > Any idea highly appreciated! >> > >> > Thanks! >> > Karel >> > _______________________________________________ >> > 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. >> >> -- >> John Z. >> "Its too bad she won't live... but then again, who does?" >> _______________________________________________ >> 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 leah at vuxu.org Mon Nov 23 10:59:01 2020 From: leah at vuxu.org (Leah Neukirchen) Date: Mon, 23 Nov 2020 11:59:01 +0100 Subject: [Haskell-cafe] Virtual Munich Haskell Meeting, 2020-11-25 @ 19:30 Message-ID: <875z5wqqyy.fsf@vuxu.org> Dear all, This week, our monthly Munich Haskell Meeting will take place again on Wednesday, November 25 at 19:30. **Due to meetup limitations in Bavaria, this meeting will take place online!** For details see here: https://muenchen.haskell.bayern/dates.html Everybody is welcome, especially the Haskellers from Bavaria that do not usually come to our Munich meetings due to travel distance! cu, -- Leah Neukirchen https://leahneukirchen.org/ From johannes.waldmann at htwk-leipzig.de Mon Nov 23 13:53:05 2020 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Mon, 23 Nov 2020 14:53:05 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) Message-ID: Dear Cafe - you might find this entertaining: an error in my code that cost me some hours (most Pictures are equal?) until I finally realized instance Eq a => Eq (Picture a) where p == q = dim p == dim q - && all (\ i -> contents p i == contents q i) (bounds p) + && all (\ i -> contents p i == contents q i) (A.range $ bounds p) Henning already called this "Matlab league" behaviour, https://mail.haskell.org/pipermail/libraries/2016-February/026678.html Well it's just a fun observation now, I am not implying anything. Enjoy! - J. Link to full source: https://gitlab.imn.htwk-leipzig.de/autotool/all0/-/issues/660#note_24567 From svenpanne at gmail.com Mon Nov 23 14:23:29 2020 From: svenpanne at gmail.com (Sven Panne) Date: Mon, 23 Nov 2020 15:23:29 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: Message-ID: Am Mo., 23. Nov. 2020 um 14:54 Uhr schrieb Johannes Waldmann < johannes.waldmann at htwk-leipzig.de>: > [...] Henning already called this "Matlab league" behaviour, > https://mail.haskell.org/pipermail/libraries/2016-February/026678.html > > Well it's just a fun observation now, I am not implying anything. Enjoy! > There was a mega-thread in March/April 2017 about adding even more of this nonsense... :-D https://mail.haskell.org/pipermail/libraries/2017-March/027824.html Luckily enough, there was no consensus. -------------- next part -------------- An HTML attachment was scrubbed... URL: From manuel.schnecki at gmail.com Mon Nov 23 15:00:42 2020 From: manuel.schnecki at gmail.com (Manuel Schneckenreither) Date: Mon, 23 Nov 2020 16:00:42 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: (Sven Panne's message of "Mon, 23 Nov 2020 15:23:29 +0100") References: Message-ID: <874klg6rtx.fsf@uibk.ac.at> >>>>> "SP" == Sven Panne writes: SP> Am Mo., 23. Nov. 2020 um 14:54 Uhr schrieb Johannes Waldmann SP> : [...] Henning already SP> called this "Matlab league" behaviour, SP> https://mail.haskell.org/pipermail/libraries/2016-February/026678.html What is the intiutive way of implementing the tuple instance like this [1] instance Foldable ((,) a) where .. length _ = 1 .. I cannot come up with a real argument, except to say there is something. For instance for Either, Left returns 0, and Right 1. But that there is something isn't that already implied by the tuple? And even if that would be the argument, the ⊥-case is not considered as the argument is not evaluated. [1] https://hackage.haskell.org/package/base-4.14.0.0/docs/src/Data.Foldable.html#line-363 From lemming at henning-thielemann.de Mon Nov 23 15:09:40 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon, 23 Nov 2020 16:09:40 +0100 (CET) Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <874klg6rtx.fsf@uibk.ac.at> References: <874klg6rtx.fsf@uibk.ac.at> Message-ID: On Mon, 23 Nov 2020, Manuel Schneckenreither wrote: > >>>>> "SP" == Sven Panne writes: > > SP> Am Mo., 23. Nov. 2020 um 14:54 Uhr schrieb Johannes Waldmann > SP> : [...] Henning already > SP> called this "Matlab league" behaviour, > SP> https://mail.haskell.org/pipermail/libraries/2016-February/026678.html > > What is the intiutive way of implementing the tuple instance like this [1] > > instance Foldable ((,) a) where > .. > length _ = 1 > .. > > I cannot come up with a real argument, except to say there is something. "length (a,b) == 1" is only a consequence of defining instance Foldable for pairs. It was not the argument to implement that instance, at all. From manuel.schnecki at gmail.com Mon Nov 23 15:21:13 2020 From: manuel.schnecki at gmail.com (Manuel Schneckenreither) Date: Mon, 23 Nov 2020 16:21:13 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: (Henning Thielemann's message of "Mon, 23 Nov 2020 16:09:40 +0100 (CET)") References: <874klg6rtx.fsf@uibk.ac.at> Message-ID: <87wnyc5cba.fsf@gmail.com> >>>>> "HT" == Henning Thielemann writes: HT> "length (a,b) == 1" is only a consequence of defining instance HT> Foldable for pairs. It was not the argument to implement that HT> instance, at all. What was the argument to use 1, not 2 for instance? From david.feuer at gmail.com Mon Nov 23 15:24:10 2020 From: david.feuer at gmail.com (David Feuer) Date: Mon, 23 Nov 2020 10:24:10 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <87wnyc5cba.fsf@gmail.com> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: The expectation that length = getSum . foldMap (Sum . const 1) On Mon, Nov 23, 2020, 10:21 AM Manuel Schneckenreither < manuel.schnecki at gmail.com> wrote: > >>>>> "HT" == Henning Thielemann > writes: > > HT> "length (a,b) == 1" is only a consequence of defining instance > HT> Foldable for pairs. It was not the argument to implement that > HT> instance, at all. > > What was the argument to use 1, not 2 for instance? > _______________________________________________ > 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 sjcjoosten+haskell at gmail.com Mon Nov 23 15:30:51 2020 From: sjcjoosten+haskell at gmail.com (Sebastiaan Joosten) Date: Mon, 23 Nov 2020 10:30:51 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <87wnyc5cba.fsf@gmail.com> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: length is part of the Foldable class: length = foldl' (\c _ -> c + 1) 0 It is probably defined this way s.t. it satisfies: length = length . toList Not the actual definition, but you can read toList as: toList = foldr (:) [] So as soon as one defines foldr for pairs: foldr f z (_, y ) = f y z We get: toList (a,b) = [b] Using the 'natural' property: length = length . toList We obtain: length (a,b) = length [b] = 1 On Mon, Nov 23, 2020 at 10:22 AM Manuel Schneckenreither < manuel.schnecki at gmail.com> wrote: > >>>>> "HT" == Henning Thielemann > writes: > > HT> "length (a,b) == 1" is only a consequence of defining instance > HT> Foldable for pairs. It was not the argument to implement that > HT> instance, at all. > > What was the argument to use 1, not 2 for instance? > _______________________________________________ > 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 svenpanne at gmail.com Mon Nov 23 20:18:03 2020 From: svenpanne at gmail.com (Sven Panne) Date: Mon, 23 Nov 2020 21:18:03 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: Am Mo., 23. Nov. 2020 um 16:32 Uhr schrieb Sebastiaan Joosten < sjcjoosten+haskell at gmail.com>: > [...] We obtain: length (a,b) = length [b] = 1 > Quoting my former self ( https://mail.haskell.org/pipermail/libraries/2017-April/027905.html), you get even more "fun" stuff with lots of potential for late-night debugging hours: maximum (3,2) => 2 minimum (4,5) => 5 sum (6,7) => 7 product (8,9) => 9 Yes, you can think of (X, Y) as "Y with context X" or "a one-element container with Y in it", but is this really what comes to your mind first? I still highly doubt that. The Foldable-Traversable-in-Prelude change was largely a good thing, but very surprising (and not really needed) changes coming stealthily with it were only communicated when it was already too late... :-/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From zemyla at gmail.com Mon Nov 23 20:40:55 2020 From: zemyla at gmail.com (Zemyla) Date: Mon, 23 Nov 2020 14:40:55 -0600 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: So what should maximum (2, "potato") be? On Mon, Nov 23, 2020, 14:19 Sven Panne wrote: > Am Mo., 23. Nov. 2020 um 16:32 Uhr schrieb Sebastiaan Joosten < > sjcjoosten+haskell at gmail.com>: > >> [...] We obtain: length (a,b) = length [b] = 1 >> > > Quoting my former self ( > https://mail.haskell.org/pipermail/libraries/2017-April/027905.html), you > get even more "fun" stuff with lots of potential for late-night debugging > hours: > > maximum (3,2) => 2 > minimum (4,5) => 5 > sum (6,7) => 7 > product (8,9) => 9 > > Yes, you can think of (X, Y) as "Y with context X" or "a one-element container with Y in it", but is this really what comes to your mind first? I still highly doubt that. The Foldable-Traversable-in-Prelude change was largely a good thing, but very surprising (and not really needed) changes coming stealthily with it were only communicated when it was already too late... :-/ > > _______________________________________________ > 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 fa-ml at ariis.it Mon Nov 23 20:45:55 2020 From: fa-ml at ariis.it (Francesco Ariis) Date: Mon, 23 Nov 2020 21:45:55 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: <20201123204555.GA1928@extensa> Il 23 novembre 2020 alle 21:18 Sven Panne ha scritto: > Yes, you can think of (X, Y) as "Y with context X" or "a one-element > container with Y in it", but is this really what comes to your mind > first? I still highly doubt that. The Foldable-Traversable-in-Prelude > change was largely a good thing, but very surprising (and not really > needed) changes coming stealthily with it were only communicated when > it was already too late... :-/ I recall a long thread, with everyone top posting. This feature could have helped OP: https://gitlab.haskell.org/ghc/ghc/-/issues/11796 but unfortunately is still in design stage —F From fa-ml at ariis.it Mon Nov 23 20:54:26 2020 From: fa-ml at ariis.it (Francesco Ariis) Date: Mon, 23 Nov 2020 21:54:26 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: <20201123205426.GB1928@extensa> Il 23 novembre 2020 alle 14:40 Zemyla ha scritto: > So what should maximum (2, "potato") be? For people who did not agree with `instance Foldable (,) a`, a type error! From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Mon Nov 23 21:22:32 2020 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Mon, 23 Nov 2020 21:22:32 +0000 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <20201123205426.GB1928@extensa> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123205426.GB1928@extensa> Message-ID: <20201123212232.GU25421@cloudinit-builder> On Mon, Nov 23, 2020 at 09:54:26PM +0100, Francesco Ariis wrote: > Il 23 novembre 2020 alle 14:40 Zemyla ha scritto: > > So what should maximum (2, "potato") be? > > For people who did not agree with `instance Foldable (,) a`, a > type error! Which of the following would they give up? A. Foldable as superclass of Traversable B. (a,) as Traversable Personally I think in retrospect I think I'd give up both and use explicit Traversals (i.e. optics instead). That way one would have to write allOf each (\ i -> contents p i == contents q i) ... By contrast allOf _2 (\ i -> contents p i == contents q i) ... obviously looks wrong. Tom From lemming at henning-thielemann.de Mon Nov 23 23:23:17 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 24 Nov 2020 00:23:17 +0100 (CET) Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <20201123212232.GU25421@cloudinit-builder> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123205426.GB1928@extensa> <20201123212232.GU25421@cloudinit-builder> Message-ID: On Mon, 23 Nov 2020, Tom Ellis wrote: > On Mon, Nov 23, 2020 at 09:54:26PM +0100, Francesco Ariis wrote: >> Il 23 novembre 2020 alle 14:40 Zemyla ha scritto: >> > So what should maximum (2, "potato") be? >> >> For people who did not agree with `instance Foldable (,) a`, a >> type error! > > Which of the following would they give up? > > A. Foldable as superclass of Traversable > > B. (a,) as Traversable > > Personally I think in retrospect I think I'd give up both You cannot really give up A, because Foldable methods can be implemented in terms of traverse. From amindfv at mailbox.org Tue Nov 24 07:13:56 2020 From: amindfv at mailbox.org (amindfv at mailbox.org) Date: Tue, 24 Nov 2020 02:13:56 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <20201123204555.GA1928@extensa> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123204555.GA1928@extensa> Message-ID: <20201124071356.GA13199@painter.painter> On Mon, Nov 23, 2020 at 09:45:55PM +0100, Francesco Ariis wrote: > Il 23 novembre 2020 alle 21:18 Sven Panne ha scritto: > > Yes, you can think of (X, Y) as "Y with context X" or "a one-element > > container with Y in it", but is this really what comes to your mind > > first? I still highly doubt that. The Foldable-Traversable-in-Prelude > > change was largely a good thing, but very surprising (and not really > > needed) changes coming stealthily with it were only communicated when > > it was already too late... :-/ > > I recall a long thread, with everyone top posting. > This feature could have helped OP: > > https://gitlab.haskell.org/ghc/ghc/-/issues/11796 > > but unfortunately is still in design stage Fwiw there is at least some strong user interest in this feature if anyone is thinking of working on it. I find myself checking on its progress pretty often, and would use it in our production codebase in a heartbeat. The strongest motivation is bugs that I've caught during a refactor, where a type somewhere changes from e.g. [x] to (y, [x]), and deep in some function a call to length/maximum/whatever just starts returning useless values without a type error. Consider, for example: do x <- getValuesForId "foo" when (length x > 1) $ fail "Unlikely condition: more than one value returned" ... It may be a long time before you discover the 'when' clause will never fire because the type of x has changed to a 2-tuple. In the meantime, you've been doing something wrong with your conflicting data. Tom From ietf-dane at dukhovni.org Tue Nov 24 09:06:22 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Tue, 24 Nov 2020 04:06:22 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <20201124071356.GA13199@painter.painter> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123204555.GA1928@extensa> <20201124071356.GA13199@painter.painter> Message-ID: <20201124090622.GE1464@straasha.imrryr.org> On Tue, Nov 24, 2020 at 02:13:56AM -0500, amindfv--- via Haskell-Cafe wrote: > Fwiw there is at least some strong user interest in this feature if > anyone is thinking of working on it. I find myself checking on its > progress pretty often, and would use it in our production codebase in > a heartbeat. Rather than waiting, it is perhaps more pragmatic to go with a custom Prelude, which one can have now, even for versions of GHC/base, that won't have the feature in question: {-# LANGUAGE NoImplicitPrelude #-} module Main (main) where import ListPrelude import qualified Data.Foldable as F main :: IO () main = do let { one, two :: Int; one = 1; two = 2 } -- OK print $ length [one, two] print $ F.length (one, two) -- Type error -- print $ length (one, two) -- Viktor. -------------- next part -------------- A non-text attachment was scrubbed... Name: ListPrelude.hs Type: text/x-haskell Size: 3695 bytes Desc: not available URL: From jkb at jkbsc.co.uk Tue Nov 24 09:10:24 2020 From: jkb at jkbsc.co.uk (John Beattie) Date: Tue, 24 Nov 2020 09:10:24 +0000 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: <20201124091024.GA30993@vatersay> On 2020-11-23 10:30 -0500, Sebastiaan Joosten wrote: > length is part of the Foldable class: > > length = foldl' (\c _ -> c+1) 0 > It is probably defined this way s.t. it satisfies: > length = length . toList > Not the actual definition, but you can read toList as: > toList = foldr (:) [] > > So as soon as one defines foldr for pairs: > > foldr f z (_, y) = f y z > > We get: > toList (a,b) = [b] > > Using the 'natural' property: length = length . toList > We obtain: length (a,b) = length [b] = 1 > > > On Mon, Nov 23, 2020 at 10:22 AM Manuel Schneckenreither < > manuel.schnecki at gmail.com> wrote: > >     >>>>> "HT" == Henning Thielemann > writes: > >     HT> "length (a,b) == 1" is only a consequence of defining instance >     HT> Foldable for pairs. It was not the argument to implement that >     HT> instance, at all. > > What was the argument to use 1, not 2 for instance? ok, but why define foldr like that? A long time ago, I saw an exposition of lists in an imperative setting which treated them as pairs of (value, pointer) where the pointer pointed to the next item. If we start with the above folder for pairs, I think we wouldn't get the usual foldr on lists defined in this way from pairs, no? Ok, I see, pairs are used for lots of things, including lists. They could also be used as the basis for longer tuples. Another suggestion, why don't we define foldr via currying: foldr f z (x,y) = f z x y ? From lemming at henning-thielemann.de Tue Nov 24 09:20:58 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 24 Nov 2020 10:20:58 +0100 (CET) Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <20201124090622.GE1464@straasha.imrryr.org> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123204555.GA1928@extensa> <20201124071356.GA13199@painter.painter> <20201124090622.GE1464@straasha.imrryr.org> Message-ID: On Tue, 24 Nov 2020, Viktor Dukhovni wrote: > Rather than waiting, it is perhaps more pragmatic to go with a custom > Prelude, which one can have now, even for versions of GHC/base, that > won't have the feature in question: I have such a Prelude: https://hackage.haskell.org/package/prelude-compat It helps a bit, but does not fully solve the problem. If you use Fold.all on a Map and then switch from Map k a to (Map k a, b) you will again not encounter a warning nor a type error. I had the idea of implementing forbidden instances like: instance Unsatisfiable a => Foldable ((,) a) where If I use them (or import them?) they would conflict with the one from FTP-Prelude. I have not tried that idea. It might exclude importing code that uses Foldable on pair intentionally. From manuel.schnecki at gmail.com Tue Nov 24 09:55:21 2020 From: manuel.schnecki at gmail.com (Manuel Schneckenreither) Date: Tue, 24 Nov 2020 10:55:21 +0100 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <20201123212232.GU25421@cloudinit-builder> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123205426.GB1928@extensa> <20201123212232.GU25421@cloudinit-builder> Message-ID: >>>>> "TE" == Tom Ellis writes: TE> On Mon, Nov 23, 2020 at 09:54:26PM +0100, Francesco Ariis wrote: TE> Which of the following would they give up? TE> A. Foldable as superclass of Traversable TE> B. (a,) as Traversable For me it is B. Even the Foldable hackage description states "Functors representing data structures that can be traversed from left to right." The tuple is however not traversed from left to right, but solely on the right (as it's half filled). For me it doesn't make sense to implement it, just because it's implementable. I think the current implementation does not add more value than it harms. El lun., 23 nov. 2020 22:23, Tom Ellis < tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> escribió: > On Mon, Nov 23, 2020 at 09:54:26PM +0100, Francesco Ariis wrote: > > Il 23 novembre 2020 alle 14:40 Zemyla ha scritto: > > > So what should maximum (2, "potato") be? > > > > For people who did not agree with `instance Foldable (,) a`, a > > type error! > > Which of the following would they give up? > > A. Foldable as superclass of Traversable > > B. (a,) as Traversable > > Personally I think in retrospect I think I'd give up both and use > explicit Traversals (i.e. optics instead). That way one would have to > write > > allOf each (\ i -> contents p i == contents q i) ... > > By contrast > > allOf _2 (\ i -> contents p i == contents q i) ... > > obviously looks wrong. > > Tom > _______________________________________________ > 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 b at chreekat.net Tue Nov 24 13:20:16 2020 From: b at chreekat.net (Bryan Richter) Date: Tue, 24 Nov 2020 15:20:16 +0200 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123205426.GB1928@extensa> <20201123212232.GU25421@cloudinit-builder> Message-ID: In homage to the ironic phrase "It's technically true, which is the best kind of true," perhaps we need a superclass TechnicallyFoldable. :D Then (,) a could be an instance of TechnicallyFoldable but not Foldable , tlength could be defined as tlength = length for (Foldable a => TechnicallyFoldable a), and anybody who really wants the maximally general option could always use tlength. The parallel with fmap speaks for itself. :) Den tis 24 nov. 2020 11:56Manuel Schneckenreither skrev: > >>>>> "TE" == Tom Ellis > writes: > > TE> On Mon, Nov 23, 2020 at 09:54:26PM +0100, Francesco Ariis wrote: > > TE> Which of the following would they give up? > > TE> A. Foldable as superclass of Traversable > > TE> B. (a,) as Traversable > > For me it is B. Even the Foldable hackage description states "Functors > representing data structures that can be traversed from left to right." > The tuple is however not traversed from left to right, but solely on the > right (as it's half filled). > > For me it doesn't make sense to implement it, just because it's > implementable. I think the current implementation does not add more > value than it harms. > > > El lun., 23 nov. 2020 22:23, Tom Ellis < > tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> escribió: > >> On Mon, Nov 23, 2020 at 09:54:26PM +0100, Francesco Ariis wrote: >> > Il 23 novembre 2020 alle 14:40 Zemyla ha scritto: >> > > So what should maximum (2, "potato") be? >> > >> > For people who did not agree with `instance Foldable (,) a`, a >> > type error! >> >> Which of the following would they give up? >> >> A. Foldable as superclass of Traversable >> >> B. (a,) as Traversable >> >> Personally I think in retrospect I think I'd give up both and use >> explicit Traversals (i.e. optics instead). That way one would have to >> write >> >> allOf each (\ i -> contents p i == contents q i) ... >> >> By contrast >> >> allOf _2 (\ i -> contents p i == contents q i) ... >> >> obviously looks wrong. >> >> Tom >> _______________________________________________ >> 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 ietf-dane at dukhovni.org Tue Nov 24 18:49:14 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Tue, 24 Nov 2020 13:49:14 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123204555.GA1928@extensa> <20201124071356.GA13199@painter.painter> <20201124090622.GE1464@straasha.imrryr.org> Message-ID: <20201124184914.GF1464@straasha.imrryr.org> On Tue, Nov 24, 2020 at 10:20:58AM +0100, Henning Thielemann wrote: > > Rather than waiting, it is perhaps more pragmatic to go with a custom > > Prelude, which one can have now, even for versions of GHC/base, that > > won't have the feature in question: > > I have such a Prelude: > https://hackage.haskell.org/package/prelude-compat > > It helps a bit, but does not fully solve the problem. > > If you use Fold.all on a Map and then switch from Map k a to (Map k a, b) > you will again not encounter a warning nor a type error. Yes, for that one might have to be disciplined and use a monomorphised variant: allMapValues :: (a -> Bool) -> Map k a -> Bool allMapValues = Data.Foldable.all although the risk is only present when (a ~ b), or the predicate is sufficiently polymorphic (over some superclass of `a` and `b`). And of course, when refactoring, instead of moving to a 2-tuple, that brings in possibly unwanted instances, one can instead choose a custom product type, that does not have a Foldable instance: -- coercible to a 2-tuple if/as needed newtype T2 a b = T2 { _unT2 :: (a, b) } deriving (Eq, Ord, Show) to give one's 2-tuples exactly the desired instances and no more. This admittedly is not terribly ergonomic. -- Viktor. From lemming at henning-thielemann.de Tue Nov 24 19:40:34 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 24 Nov 2020 20:40:34 +0100 (CET) Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: <20201124184914.GF1464@straasha.imrryr.org> References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> <20201123204555.GA1928@extensa> <20201124071356.GA13199@painter.painter> <20201124090622.GE1464@straasha.imrryr.org> <20201124184914.GF1464@straasha.imrryr.org> Message-ID: On Tue, 24 Nov 2020, Viktor Dukhovni wrote: > And of course, when refactoring, instead of moving to a 2-tuple, that > brings in possibly unwanted instances, one can instead choose a custom > product type, that does not have a Foldable instance: > > -- coercible to a 2-tuple if/as needed > newtype T2 a b = T2 { _unT2 :: (a, b) } deriving (Eq, Ord, Show) > > to give one's 2-tuples exactly the desired instances and no more. This > admittedly is not terribly ergonomic. If people would use custom pair types we would not need Foldable on pairs, at all. From twilson at csufresno.edu Tue Nov 24 22:26:03 2020 From: twilson at csufresno.edu (Todd Wilson) Date: Tue, 24 Nov 2020 14:26:03 -0800 Subject: [Haskell-cafe] Types of partially instantiated polymorphic helper functions Message-ID: Dear Cafe, This has got to be a trivial question, but I don't see a solution, nor could I find anything through searching: If I want to write a type declaration for the helper function g here, what do I write? f :: a -> [b] -> [(a,b)] f a bs = g bs where g :: ???? g [] = [] g (x:xs) = (a,x) : g xs Apologies if I'm wasting bandwidth with my ignorance. Todd Wilson -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at well-typed.com Tue Nov 24 22:37:38 2020 From: adam at well-typed.com (Adam Gundry) Date: Tue, 24 Nov 2020 22:37:38 +0000 Subject: [Haskell-cafe] Types of partially instantiated polymorphic helper functions In-Reply-To: References: Message-ID: Dear Todd, On 24/11/2020 22:26, Todd Wilson wrote: > This has got to be a trivial question, but I don't see a solution, nor > could I find anything through searching: If I want to write a type > declaration for the helper function g here, what do I write? > > f :: a -> [b] -> [(a,b)] > f a bs = g bs where >   g :: ???? >   g [] = [] >   g (x:xs) = (a,x) : g xs This has a disappointingly not-entirely-trivial answer: {-# LANGUAGE ExplicitForAll, ScopedTypeVariables #-} f :: forall a b . a -> [b] -> [(a,b)] f a bs = g bs where g :: [c] -> [(a, c)] g [] = [] g (x:xs) = (a,x) : g xs We need the type variable `a` in the type of `g` to be the same as the one bound in the type of `f`, but Haskell2010 doesn't have a way to express this. The ScopedTypeVariables extension, when used with an explicit forall, makes the type variables scope over type signatures in the body of the function. Hope this helps, Adam -- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/ Registered in England & Wales, OC335890 118 Wymering Mansions, Wymering Road, London W9 2NF, England From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Tue Nov 24 22:37:40 2020 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 24 Nov 2020 22:37:40 +0000 Subject: [Haskell-cafe] Types of partially instantiated polymorphic helper functions In-Reply-To: References: Message-ID: <20201124223740.GB22702@cloudinit-builder> On Tue, Nov 24, 2020 at 02:26:03PM -0800, Todd Wilson wrote: > This has got to be a trivial question, but I don't see a solution, nor > could I find anything through searching: If I want to write a type > declaration for the helper function g here, what do I write? > > f :: a -> [b] -> [(a,b)] > f a bs = g bs where > g :: ???? > g [] = [] > g (x:xs) = (a,x) : g xs You probably want this: {-# LANGUAGE ScopedTypeVariables #-} f :: forall a b. a -> [b] -> [(a,b)] f a bs = g bs where g :: [b'] -> [(a, b')] g [] = [] g (x:xs) = (a,x) : g xs From olf at aatal-apotheke.de Tue Nov 24 22:52:12 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Tue, 24 Nov 2020 23:52:12 +0100 Subject: [Haskell-cafe] What to call Occult Effects Message-ID: <68b5d585528f504859b0765c8922fa162bae2963.camel@aatal-apotheke.de> > Dear Olaf and everyone, > > the law do {_ <- b; a} = a is equivalent to do {_ <- b; return ()} = > return (), for, assuming the latter, > > do {_ <- b; a} > = do {_ <- do {_ <- b; return ()}; a} > = do {_ <- return (); a} > = a > > and it does actually have some history. It was dubbed > 'discardability' by Thielecke [1] and explored by > Führmann in [2] together with some other important properties of > effects, such as 'centrality' and > 'commutativity'. Combinations of these properties and examples are > explored in the conventional > Haskell-like style in [3] (where 'discardability' is called 'side- > effect freeness' though). > > Cheers, > Sergey > > [1] H. Thielecke, Categorical structure of continuation passing > style, Ph.D. Thesis, University of > Edinburgh, 1997. > > [2] C. Führmann, Varieties of effects, in: M. Nielsen, U. Engberg > (Eds.), Foundations of Software > Science and Computation Structures, FOSSACS 2002, in: Lect. Notes > Comput. Sci., vol. 2303, Springer, > 2002, pp. 144–158. > > [3] L. Schröder, T. Mossakowski, Monad-independent dynamic logic in > HasCasl, J. Logic Comput. 14 (2004) > 571–619 I've got the impression that all three of the above works look at a problem dual to the OP in a certain sense: At least [1] and [2] ask: For a given monad M, what is the subset of computations b with b >> a = a for all a? In contrast, I understood Kim-Ee's question as: What are the monads M where all computations b belong to this class? Assuming this property, the monoid M () is isomorphic to (). Indeed, the monoid M () inherits the property a <> b = b for all a, b :: M () and the only monoid with this property is the one- element monoid. In category theory a monad M with M 1 being isomorphic to the terminal object 1 is called 'affine'. Bart Jacobs in [4] gives a diagram (10) that amounts to return.const = fmap.const and shows that this is equivalent to being affine. Hence we might also use 'affine' for monads with Kim-Ee's property. Bart Jacobs' proof first reduces the general identity return.const = fmap.const :: a -> m b -> m a to the case b = () just as Sergey did above. Then = fmap (const a) = fmap (const a) . (id :: m () -> m ()) = fmap (const a) . return . const () by assumption = return . const a . const () by naturality of return = return . const a property of const I also learned that the school of 'effects' tries to avoid monads (this going back to John Power), so the terms 'discardable' and 'affine' might just be names for the same thing in different communities. Further there is a categorical construction (see [4]) to compute the greatest affine sub-monad of a monad. Interestingly, the affine part of the state monad is the reader monad, that is, functions s -> (a,s) that may use s but not change it. Olaf [4] https://hal.inria.fr/hal-01446033/file/418352_1_En_5_Chapter.pdf From twilson at csufresno.edu Tue Nov 24 22:58:33 2020 From: twilson at csufresno.edu (Todd Wilson) Date: Tue, 24 Nov 2020 14:58:33 -0800 Subject: [Haskell-cafe] Types of partially instantiated polymorphic helper functions In-Reply-To: References: Message-ID: I see, thanks! And I guess that if the type variable c in your type of g were changed to b, it will still work, but now g would have a monomorphic instead of polymorphic type. I hope the combination of keywords in my subject line can serve to direct someone else with this problem to your answer! Todd Wilson On Tue, Nov 24, 2020 at 2:37 PM Adam Gundry wrote: > Dear Todd, > > On 24/11/2020 22:26, Todd Wilson wrote: > > This has got to be a trivial question, but I don't see a solution, nor > > could I find anything through searching: If I want to write a type > > declaration for the helper function g here, what do I write? > > > > f :: a -> [b] -> [(a,b)] > > f a bs = g bs where > > g :: ???? > > g [] = [] > > g (x:xs) = (a,x) : g xs > > This has a disappointingly not-entirely-trivial answer: > > {-# LANGUAGE ExplicitForAll, ScopedTypeVariables #-} > > f :: forall a b . a -> [b] -> [(a,b)] > f a bs = g bs where > g :: [c] -> [(a, c)] > g [] = [] > g (x:xs) = (a,x) : g xs > > We need the type variable `a` in the type of `g` to be the same as the > one bound in the type of `f`, but Haskell2010 doesn't have a way to > express this. The ScopedTypeVariables extension, when used with an > explicit forall, makes the type variables scope over type signatures in > the body of the function. > > Hope this helps, > > Adam > > -- > Adam Gundry, Haskell Consultant > Well-Typed LLP, https://www.well-typed.com/ > > Registered in England & Wales, OC335890 > 118 Wymering Mansions, Wymering Road, London W9 2NF, England > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ietf-dane at dukhovni.org Tue Nov 24 23:38:30 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Tue, 24 Nov 2020 18:38:30 -0500 Subject: [Haskell-cafe] Types of partially instantiated polymorphic helper functions In-Reply-To: References: Message-ID: <20201124233830.GI1464@straasha.imrryr.org> On Tue, Nov 24, 2020 at 02:58:33PM -0800, Todd Wilson wrote: > I see, thanks! And I guess that if the type variable c in your type of g > were changed to b, it will still work, but now g would have a monomorphic > instead of polymorphic type. Yes, exactly. I was not going to post my otherwise redundant answer, but since it in fact makes `g` monomorphic, here it is: The simplest thing (which you probably already know) is to not give `g` a type signature, and let GHC infer the type. But since you asked, one solution is: {-# LANGUAGE ScopedTypeVariables #-} f :: forall a b. a -> [b] -> [(a, b)] f a bs = g bs where g :: [b] -> [(a, b)] g [] = [] g (x:xs) = (a, x) : g xs You need scoped type variables becase the `a` in the return-type of `g` needs to be the *same* `a` as in the signature of `f`, and unlike `f` the function `g` is not polymorphic in `a`, so you need a mechanis to identify the two instances of the type variable, and that's where the `ScopedTypeVariables` pragma comes into play. Once you have `ScopedTypeVariables`, you also get (for free) `ExplicitForall`, and each new universally quanitified type variable now needs "forall" to bring it into scope. -- Viktor. From sergey.goncharov at fau.de Tue Nov 24 23:48:02 2020 From: sergey.goncharov at fau.de (Sergey Goncharov) Date: Wed, 25 Nov 2020 00:48:02 +0100 Subject: [Haskell-cafe] What to call Occult Effects In-Reply-To: <68b5d585528f504859b0765c8922fa162bae2963.camel@aatal-apotheke.de> References: <68b5d585528f504859b0765c8922fa162bae2963.camel@aatal-apotheke.de> Message-ID: <6c56d096-b199-9ff7-bb0f-99c85ef787e8@fau.de> Dear Olaf, >> >> [1] H. Thielecke, Categorical structure of continuation passing >> style, Ph.D. Thesis, University of >> Edinburgh, 1997. >> >> [2] C. Führmann, Varieties of effects, in: M. Nielsen, U. Engberg >> (Eds.), Foundations of Software >> Science and Computation Structures, FOSSACS 2002, in: Lect. Notes >> Comput. Sci., vol. 2303, Springer, >> 2002, pp. 144–158. >> >> [3] L. Schröder, T. Mossakowski, Monad-independent dynamic logic in >> HasCasl, J. Logic Comput. 14 (2004) >> 571–619 > > I've got the impression that all three of the above works look at a > problem dual to the OP in a certain sense: At least [1] and [2] ask: > For a given monad M, what is the subset of computations b with > b >> a = a for all a? > In contrast, I understood Kim-Ee's question as: What are the monads M > where all computations b belong to this class? Well, these two questions are closely related, as you actually indicate further below. In [1] the main monad is the continuation monad, and equational laws are used as means to classify classes of computations with important properties, but nothing prevents one from using them for classifying monads entirely satisfying such laws. > > Assuming this property, the monoid M () is isomorphic to (). > Indeed, the monoid M () inherits the property > a <> b = b > for all a, b :: M () and the only monoid with this property is the one- > element monoid. > > In category theory a monad M with M 1 being isomorphic to the terminal > object 1 is called 'affine'. Bart Jacobs in [4] gives a diagram (10) > that amounts to > return.const = fmap.const > and shows that this is equivalent to being affine. Hence we might also > use 'affine' for monads with Kim-Ee's property. Bart Jacobs' proof > first reduces the general identity > > return.const = fmap.const :: a -> m b -> m a > > to the case b = () just as Sergey did above. Then > = fmap (const a) > = fmap (const a) . (id :: m () -> m ()) > = fmap (const a) . return . const () by assumption > = return . const a . const () by naturality of return > = return . const a property of const > Yes, it is again just the same law: isomorphism of M () and () is a yet more concise way to state this property, neat! > I also learned that the school of 'effects' tries to avoid monads (this > going back to John Power), so the terms 'discardable' and 'affine' > might just be names for the same thing in different communities. > > Further there is a categorical construction (see [4]) to compute the > greatest affine sub-monad of a monad. Interestingly, the affine part of > the state monad is the reader monad, that is, functions > s -> (a,s) > that may use s but not change it. > I think [3] and [4] are related (and somewhat contrast [1] and [2]) in that, the laws like discardability are meant to identify those computations (or (sub-)monad), which can in a way play a role of logical assertions. So, the slogan is: assertions are well-behaved computations. In that sense, from the perspective of [3], discardability is a desirable property, but not sufficient. For example, the 'copyability law' do {x <- p; y <- p; return (x, y)} = do {x <- p; return (x, x)} is not satisfied by the probability distribution monad, which is discardable, roughly, because when tossing a coin, getting tails twice in a row is 1/4, while the probability of getting tails after tossing it once is 1/2. So, if we regard sequential composition of programs as a kind of conjunction, then it would not be idempotent. From the perspective of [4], not having copyability is fine, because the underlying logic is meant to be more permissive, and admits non-idempotent conjunctions. Same goes for commutativity: even the conjunction of copyability and discardability does not entail commutativity -- [3] contains a counterexample to this effect (Example 37). Cheers, Sergey > > Olaf > > > [4] https://hal.inria.fr/hal-01446033/file/418352_1_En_5_Chapter.pdf > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 5384 bytes Desc: S/MIME Cryptographic Signature URL: From lemming at henning-thielemann.de Tue Nov 24 23:50:58 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Wed, 25 Nov 2020 00:50:58 +0100 (CET) Subject: [Haskell-cafe] Types of partially instantiated polymorphic helper functions In-Reply-To: <20201124233830.GI1464@straasha.imrryr.org> References: <20201124233830.GI1464@straasha.imrryr.org> Message-ID: On Tue, 24 Nov 2020, Viktor Dukhovni wrote: > On Tue, Nov 24, 2020 at 02:58:33PM -0800, Todd Wilson wrote: > >> I see, thanks! And I guess that if the type variable c in your type of g >> were changed to b, it will still work, but now g would have a monomorphic >> instead of polymorphic type. > > Yes, exactly. I was not going to post my otherwise redundant > answer, but since it in fact makes `g` monomorphic, here it is: > > The simplest thing (which you probably already know) is to not give `g` a type signature, and let GHC infer the type. But since you asked, one solution is: > > {-# LANGUAGE ScopedTypeVariables #-} > > f :: forall a b. a -> [b] -> [(a, b)] > f a bs = g bs where > g :: [b] -> [(a, b)] > g [] = [] > g (x:xs) = (a, x) : g xs An alternative would be to let g be polymorphic but add 'a' as parameter: f a bs = g a bs where g :: a -> [b] -> [(a, b)] g = map ((,) a) From stuart.hungerford at gmail.com Wed Nov 25 03:29:16 2020 From: stuart.hungerford at gmail.com (Stuart Hungerford) Date: Wed, 25 Nov 2020 14:29:16 +1100 Subject: [Haskell-cafe] Looking for idiomatic example of wrapping a Haskell library Message-ID: Hi Haskellers, In a Haskell learning project I'm looking at using a couple of Haskell packages (from Hackage) for linear algebra and graphics. I've got a strong feeling my choices of these libraries are going to change as the project progresses and to avoid having to change references to these library functions throughout my modules I'd like to "wrap" them in modules of my own. Can anyone point me to a project where a Haskell library has been idiomatically wrapped this way? I can see newtypes and "smart" constructors of the wrapped types will go some way towards this, but I suspect there's more techniques I haven't yet learned. Thanks in advance, Stu From david.feuer at gmail.com Wed Nov 25 03:38:19 2020 From: david.feuer at gmail.com (David Feuer) Date: Tue, 24 Nov 2020 22:38:19 -0500 Subject: [Haskell-cafe] Looking for idiomatic example of wrapping a Haskell library In-Reply-To: References: Message-ID: For the specific choices of linear algebra and graphics, I'm going to go out on a limb and guess you probably don't want to do that. Different frameworks have radically different APIs, so a "generic" wrapper is likely to give you a slow subset of the functionality of each package. On Tue, Nov 24, 2020, 10:29 PM Stuart Hungerford < stuart.hungerford at gmail.com> wrote: > Hi Haskellers, > > In a Haskell learning project I'm looking at using a couple of Haskell > packages (from Hackage) for linear algebra and graphics. > > I've got a strong feeling my choices of these libraries are going to > change as the project progresses and to avoid having to change > references to these library functions throughout my modules I'd like > to "wrap" them in modules of my own. Can anyone point me to a project > where a Haskell library has been idiomatically wrapped this way? > > I can see newtypes and "smart" constructors of the wrapped types will > go some way towards this, but I suspect there's more techniques I > haven't yet learned. > > Thanks in advance, > > Stu > _______________________________________________ > 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 stuart.hungerford at gmail.com Wed Nov 25 04:08:28 2020 From: stuart.hungerford at gmail.com (Stuart Hungerford) Date: Wed, 25 Nov 2020 15:08:28 +1100 Subject: [Haskell-cafe] Looking for idiomatic example of wrapping a Haskell library In-Reply-To: References: Message-ID: On Wed, Nov 25, 2020 at 2:38 PM David Feuer wrote: > For the specific choices of linear algebra and graphics, I'm going to go out on a limb and guess you probably don't want to do that. Different frameworks have radically different APIs, so a "generic" wrapper is likely to give you a slow subset of the functionality of each package. Thanks David -- that's a good point I hadn't really considered. Stu From barak at pearlmutter.net Wed Nov 25 14:05:43 2020 From: barak at pearlmutter.net (Barak A. Pearlmutter) Date: Wed, 25 Nov 2020 14:05:43 +0000 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: References: Message-ID: On Tue, 24 Nov 2020, Henning Thielemann wrote: > If people would use custom pair types we would not need Foldable on pairs, > at all. To be fair, if people would use custom pair types we would not need *pairs* at all. --Barak Pearlmutter From zemyla at gmail.com Wed Nov 25 17:26:04 2020 From: zemyla at gmail.com (Zemyla) Date: Wed, 25 Nov 2020 11:26:04 -0600 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: References: Message-ID: Except we would, because we need to be able to express instances like first in Arrow using builtin pairs, rather than try and write some sort of combination for every pair and arrow. And I'm pretty sure there are other libraries which depend on pairs too. On Wed, Nov 25, 2020, 08:07 Barak A. Pearlmutter wrote: > On Tue, 24 Nov 2020, Henning Thielemann wrote: > > > If people would use custom pair types we would not need Foldable on > pairs, > > at all. > > To be fair, if people would use custom pair types we would not need > *pairs* at all. > > --Barak Pearlmutter > _______________________________________________ > 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 ietf-dane at dukhovni.org Wed Nov 25 17:52:56 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Wed, 25 Nov 2020 15:52:56 -0200 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: References: Message-ID: <51B7EC49-CDA2-4CFF-93D8-25830CADC824@dukhovni.org> > On Nov 25, 2020, at 3:26 PM, Zemyla wrote: > > Except we would, because we need to be able to express instances like first in Arrow using builtin pairs, rather than try and write some sort of combination for every pair and arrow. And I'm pretty sure there are other libraries which depend on pairs too. This is why I posted the not terribly ergonomic: newtype T2 a b = T2 { _unT2 :: (a, b) } which has a free coercion to a pair, so you can pass a pair to any library that needs one, without any runtime overhead. This of course takes much discipline to use when refactoring data types, in order to avoid missing needed changes obscured by unwanted instances of the built-in pair. Wherever you need a pair, you'd have to write "(coerce t2)", rather than "t2". -- Viktor. From barak at pearlmutter.net Wed Nov 25 19:56:49 2020 From: barak at pearlmutter.net (Barak A. Pearlmutter) Date: Wed, 25 Nov 2020 19:56:49 +0000 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: References: Message-ID: True. And their use in Arrow is a great example of pairs that do *not* work well as instances of Foldable as currently defined. Arrow is using pairs as abstract Cartesian products, and the natural isomorphism A×B≅B×A is used implicitly all the time. The Foldable definition for pairs breaks that symmetry inappropriately. Cheers, --Barak. From ietf-dane at dukhovni.org Wed Nov 25 20:16:22 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Wed, 25 Nov 2020 15:16:22 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: References: Message-ID: <20201125201622.GJ1464@straasha.imrryr.org> On Wed, Nov 25, 2020 at 07:56:49PM +0000, Barak A. Pearlmutter wrote: > True. And their use in Arrow is a great example of pairs that do *not* > work well as instances of Foldable as currently defined. Arrow is > using pairs as abstract Cartesian products, and the natural > isomorphism A×B≅B×A is used implicitly all the time. The Foldable > definition for pairs breaks that symmetry inappropriately. The "symmetry breaking" is not a result of the perhaps regrettable Foldable instance, rather it is a basic consequence of the fact that given: data Foo a b = Foo a b we immediately get a Functor "Foo a :: * -> *" for each a, of which "(,) a" is but one example. I find nothing objectionable in the Functor instance "(,) a" or the Bifunctor instance "(,)". It is only the Traversable and Foldable instances of "(,) a" that have the noted unexpected behaviour. -- Viktor. From amindfv at mailbox.org Wed Nov 25 21:15:18 2020 From: amindfv at mailbox.org (amindfv at mailbox.org) Date: Wed, 25 Nov 2020 16:15:18 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: <20201125201622.GJ1464@straasha.imrryr.org> References: <20201125201622.GJ1464@straasha.imrryr.org> Message-ID: <20201125211518.GA31173@painter.painter> On Wed, Nov 25, 2020 at 03:16:22PM -0500, Viktor Dukhovni wrote: > On Wed, Nov 25, 2020 at 07:56:49PM +0000, Barak A. Pearlmutter wrote: > > > True. And their use in Arrow is a great example of pairs that do *not* > > work well as instances of Foldable as currently defined. Arrow is > > using pairs as abstract Cartesian products, and the natural > > isomorphism A×B≅B×A is used implicitly all the time. The Foldable > > definition for pairs breaks that symmetry inappropriately. > > The "symmetry breaking" is not a result of the perhaps regrettable > Foldable instance, rather it is a basic consequence of the fact that > given: > > data Foo a b = Foo a b > > we immediately get a Functor "Foo a :: * -> *" for each a, of which > "(,) a" is but one example. I find nothing objectionable in the Functor > instance "(,) a" or the Bifunctor instance "(,)". It is only the > Traversable and Foldable instances of "(,) a" that have the noted > unexpected behaviour. This is almost incidental, though, right? I.e. it's just a result of typeclass "currying" syntax, but it's not hard to imagine a Haskell where similar to how foo :: a -> b -> c gives you both: foo a :: b -> c i.e. (\b -> foo a b) :: b -> c and (\a -> foo a b) :: a -> c we're also allowed to write something like: instance Functor (\a -> Foo a b) instance Functor (\a -> (a, b)) Mirroring the current (implicit) instance Functor (\b -> Foo a b) instance Functor (\b -> (a, b)) If that were the case, the instances favoring the last paramater wouldn't seem natural at all, and we'd be sensibly asking on what basis "(+1) <$> (2, 4)" equals (2, 5) but not (3, 4). Tom From ietf-dane at dukhovni.org Wed Nov 25 23:13:10 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Wed, 25 Nov 2020 18:13:10 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: <20201125211518.GA31173@painter.painter> References: <20201125201622.GJ1464@straasha.imrryr.org> <20201125211518.GA31173@painter.painter> Message-ID: <20201125231310.GL1464@straasha.imrryr.org> On Wed, Nov 25, 2020 at 04:15:18PM -0500, amindfv--- via Haskell-Cafe wrote: > > The "symmetry breaking" is not a result of the perhaps regrettable > > Foldable instance, rather it is a basic consequence of the fact that > > given: > > > > data Foo a b = Foo a b > > > > we immediately get a Functor "Foo a :: * -> *" for each a, of which > > "(,) a" is but one example. I find nothing objectionable in the Functor > > instance "(,) a" or the Bifunctor instance "(,)". It is only the > > Traversable and Foldable instances of "(,) a" that have the noted > > unexpected behaviour. > > This is almost incidental, though, right? I.e. it's just a result of > typeclass "currying" syntax, Yes, the last type variable gets the "for free" functor instance. > but it's not hard to imagine a Haskell where [...] > > we're also allowed to write something like: > > instance Functor (\a -> Foo a b) > instance Functor (\a -> (a, b)) > > Mirroring the current (implicit) > > instance Functor (\b -> Foo a b) > instance Functor (\b -> (a, b)) > > If that were the case, the instances favoring the last paramater > wouldn't seem natural at all, and we'd be sensibly asking on what > basis "(+1) <$> (2, 4)" equals (2, 5) but not (3, 4). The intent is clear, but ultimately not as useful as one might wish, since when it comes down to evaluating terms: fmap f (x, y) at most one such instance can match, since the terms don't carry any information about whether you want to fmap on the left or right. So all you'd get to do is flip the bias from right to left. To avoid the bias we have Bifunctors: first :: Bifunctor p => (a -> b) -> p a c -> p b c second :: Bifunctor p => (b -> c) -> p a b -> p a c For selectable bias on 2-tuples, one needs newtypes: {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FunctionalDependencies #-} import Data.Bifunctor import Data.Coerce class Coercible c (a,b) => NewPair c a b | c -> a, c -> b where toPair :: c -> (a, b) toPair = coerce {-# INLINE toPair #-} fromPair :: (a, b) -> c fromPair = coerce {-# INLINE fromPair #-} -- RPair is redundant, except to avoid Foldable, ... instances newtype LPair b a = LPair (a, b) deriving (Eq, Ord, Read, Show) newtype RPair a b = RPair (a, b) deriving (Eq, Ord, Read, Show) instance NewPair (a, b) a b instance NewPair (LPair b a) a b instance NewPair (RPair a b) a b instance Functor (LPair a) where fmap f = fromPair . first f . toPair instance Functor (RPair a) where fmap f = fromPair . second f . toPair with the above: λ> fmap succ $ LPair (1, 10) LPair (2,10) λ> fmap succ $ RPair (1, 10) RPair (1,11) -- Viktor. From twilson at csufresno.edu Thu Nov 26 00:19:57 2020 From: twilson at csufresno.edu (Todd Wilson) Date: Wed, 25 Nov 2020 16:19:57 -0800 Subject: [Haskell-cafe] Types of partially instantiated polymorphic helper functions In-Reply-To: References: <20201124233830.GI1464@straasha.imrryr.org> Message-ID: Thanks for the additional responses. For the record, in response to On Tue, Nov 24, 2020 at 3:51 PM Henning Thielemann wrote: > An alternative would be to let g be polymorphic but add 'a' as parameter: > > f a bs = g a bs where > g :: a -> [b] -> [(a, b)] > g = map ((,) a) this is what I had been doing before -- adding variables that were in scope as additional arguments to recursive helper functions, even though they don't change during recursive calls -- just so that I could give type annotations to helper functions for the purposes of documentation, since I didn't see any other way. (Of course, my helper function here is a simple application of `map`, but I was choosing this minimal example to illustrate something that came up repeatedly in more complicated situations.) The use of `ScopedTypeVariables`, though, is a better solution for me, since it allows me to continue my annotation practice without having to change the code I would ordinarily write. FWIW, my audience is college students using Haskell to supplement non-PL classes, and the annotations, perhaps more than usual, help them understand the code. Since I've already discussed polymorphism and type variables by that point, the explicit `forall`s (and language pragmas) are a satisfyingly minimal and easily explainable intrusion. Todd Wilson From amindfv at mailbox.org Thu Nov 26 00:23:20 2020 From: amindfv at mailbox.org (amindfv at mailbox.org) Date: Wed, 25 Nov 2020 19:23:20 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: <20201125231310.GL1464@straasha.imrryr.org> References: <20201125201622.GJ1464@straasha.imrryr.org> <20201125211518.GA31173@painter.painter> <20201125231310.GL1464@straasha.imrryr.org> Message-ID: <20201126002320.GA4766@painter.painter> On Wed, Nov 25, 2020 at 06:13:10PM -0500, Viktor Dukhovni wrote: > On Wed, Nov 25, 2020 at 04:15:18PM -0500, amindfv--- via Haskell-Cafe wrote: > > > > The "symmetry breaking" is not a result of the perhaps regrettable > > > Foldable instance, rather it is a basic consequence of the fact that > > > given: > > > > > > data Foo a b = Foo a b > > > > > > we immediately get a Functor "Foo a :: * -> *" for each a, of which > > > "(,) a" is but one example. I find nothing objectionable in the Functor > > > instance "(,) a" or the Bifunctor instance "(,)". It is only the > > > Traversable and Foldable instances of "(,) a" that have the noted > > > unexpected behaviour. > > > > This is almost incidental, though, right? I.e. it's just a result of > > typeclass "currying" syntax, > > Yes, the last type variable gets the "for free" functor instance. > > > but it's not hard to imagine a Haskell where [...] > > > > we're also allowed to write something like: > > > > instance Functor (\a -> Foo a b) > > instance Functor (\a -> (a, b)) > > > > Mirroring the current (implicit) > > > > instance Functor (\b -> Foo a b) > > instance Functor (\b -> (a, b)) > > > > If that were the case, the instances favoring the last paramater > > wouldn't seem natural at all, and we'd be sensibly asking on what > > basis "(+1) <$> (2, 4)" equals (2, 5) but not (3, 4). > > The intent is clear, but ultimately not as useful as one might wish, > since when it comes down to evaluating terms: > > fmap f (x, y) > > at most one such instance can match, since the terms don't carry any > information about whether you want to fmap on the left or right. So > all you'd get to do is flip the bias from right to left. > Not sure if we're agreeing or not :-), but this is exactly my point: The fact that (fmap f (x, y)) == (Control.Arrow.second f (x, y)) seems to only be based, essentially, on the historical accident that in Haskell the last type variable is special w.r.t. typeclass instances. It's not hard to imagine, in the absence of these instances, Haskell loosening the restriction on creating these types of instances. The restriction is certainly not innate to mathematics or type theory. My position is against having most of these instances in base, not for switching the bias from right to left. Tom From kazu at iij.ad.jp Thu Nov 26 01:10:12 2020 From: kazu at iij.ad.jp (Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=)) Date: Thu, 26 Nov 2020 10:10:12 +0900 (JST) Subject: [Haskell-cafe] network v3.1.2.1 Message-ID: <20201126.101012.1048233394485845766.kazu@iij.ad.jp> Hi cafe, network v3.1.2.1 has been released. This version is bug-fixes only: * Increasing base lower bound to 4.9. [#473](https://github.com/haskell/network/pull/473) * Suppressing errors from removeFile in UNIX bind. [#478](https://github.com/haskell/network/pull/478) * Restoring UNIX stub functions on Windows. [#489](https://github.com/haskell/network/pull/489) --Kazu From ietf-dane at dukhovni.org Thu Nov 26 04:24:41 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Wed, 25 Nov 2020 23:24:41 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: <20201126002320.GA4766@painter.painter> References: <20201125201622.GJ1464@straasha.imrryr.org> <20201125211518.GA31173@painter.painter> <20201125231310.GL1464@straasha.imrryr.org> <20201126002320.GA4766@painter.painter> Message-ID: <20201126042441.GM1464@straasha.imrryr.org> On Wed, Nov 25, 2020 at 07:23:20PM -0500, amindfv--- via Haskell-Cafe wrote: > > The intent is clear, but ultimately not as useful as one might wish, > > since when it comes down to evaluating terms: > > > > fmap f (x, y) > > > > at most one such instance can match, since the terms don't carry any > > information about whether you want to fmap on the left or right. So > > all you'd get to do is flip the bias from right to left. > > Not sure if we're agreeing or not :-), but this is exactly my point: We're not disagreeing. :-) > The fact that (fmap f (x, y)) == (Control.Arrow.second f (x, y)) seems > to only be based, essentially, on the historical accident that in > Haskell the last type variable is special w.r.t. typeclass instances. Yes, basically, which makes it easy to define Functor and related instances for the partially applied two parameter type constructor: Foo a :: * -> * and these are somewhat useful, since one then gets to embelish a general thing with some additional data: a -> (decorated, a) and adding the decoration on the left comes with a built-in functor instance, which, though the left/right choice is a somewhat (but not entirely) arbitrary choice, does no harm. No surprising behaviour arises from the Functor/Applicative/Monad instances for 2-tuples. Indeed, you probably find it less surprising that with "Either a b" and "Left a" as the conventional "exception" slot, the Functor instance transforms "Right b". The overall approach is consistent in its right bias, made more convenient through currying of multi-parameter type constructors. AFAICT, it is really just the Foldable instance that can lead to unexpected and behaviour and unnoticed bugs. > It's not hard to imagine, in the absence of these instances, Haskell > loosening the restriction on creating these types of instances. The > restriction is certainly not innate to mathematics or type theory. Type inference would get more complicated if it would have to consider all possible slots in each term when searching for the instance head. > My position is against having most of these instances in base, not for > switching the bias from right to left. So you'd like to see a 2-tuple with fewer built-in instances, I'm sympathetic to the case for not having Traversable/Foldable for 2-tuples, but I don't see a compelling for not having Functor/Monad. -- Viktor. From magnus at therning.org Thu Nov 26 13:12:49 2020 From: magnus at therning.org (Magnus Therning) Date: Thu, 26 Nov 2020 14:12:49 +0100 Subject: [Haskell-cafe] Amazonka, conduit and sockets not closing Message-ID: <874klcgt2m.fsf@therning.org> I've run into a problem with running out of filedescriptors. The following snippet is a trimmed down version of what I'm doing: #+begin_src haskell main :: IO () main = do awsEnv <- newEnv Discover runAWSCond awsEnv $ sqsSource queueUrl .| C.mapC snd .| sqsDeleteSink queueUrl where runAWSCond awsEnv = runResourceT . runAWS awsEnv . within Frankfurt . C.runConduit sqsSource :: MonadAWS m => T.Text -> C.ConduitT () (T.Text, T.Text) m () sqsSource queueUrl = do (_, msgs) <- C.lift $ recvSQS queueUrl C.yieldMany msgs sqsSource queueUrl sqsDeleteSink :: MonadAWS m => T.Text -> C.ConduitT T.Text o m () sqsDeleteSink queueUrl = do C.await >>= \case Nothing -> pure () Just receiptHandle -> do void $ C.lift $ delSQS queueUrl receiptHandle sqsDeleteSink queueUrl recvSQS queueUrl = do let rm = receiveMessage queueUrl & rmMaxNumberOfMessages ?~ 10 rmrs <- send rm let status = rmrs ^. rmrsResponseStatus msgs = rmrs ^. rmrsMessages & traversed %~ extract pure (status, catMaybes msgs) where extract msg = do body <- msg ^. mBody rh <- msg ^. mReceiptHandle pure (body, rh) delSQS queueUrl receiptHandle = do let dm = deleteMessage queueUrl receiptHandle send dm #+end_src This works fine for a while, but given a queue with enough messages it will fail with something like #+begin_example TransportError (HttpExceptionRequest Request { host = "sqs.eu-central-1.amazonaws.com" port = 443 secure = True requestHeaders = [("Host","sqs.eu-central-1.amazonaws.com"),("X-Amz-Date","20201126T101659Z"),("X-Amz-Content-SHA256","2e4bdf20a857a1416f218b1218670cf019ff53268d0adb34fe06402a62f3271d"),("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),("Authorization","")] path = "/" queryString = "" method = "POST" proxy = Nothing rawBody = False redirectCount = 0 responseTimeout = ResponseTimeoutMicro 70000000 requestVersion = HTTP/1.1 } (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = , addrCanonName = }, host name: Just "sqs.eu-central-1.amazonaws.com", service name: Just "443"): does not exist (System error))) #+end_example After some detours I found out that it's actually not a network issue, but rather that the process runs out of filedescriptors. Using =lsof= I can see that it doesn't seem to close /any/ sockets at all, instead they get stuck in a =CLOSE_WAIT= state: #+begin_example COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME wd-stats 88674 magnus 23u IPv4 815196 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60624->52.119.188.213:https (CLOSE_WAIT) wd-stats 88674 magnus 24u IPv4 811362 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43482->52.119.189.184:https (CLOSE_WAIT) wd-stats 88674 magnus 25u IPv4 811386 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60628->52.119.188.213:https (CLOSE_WAIT) wd-stats 88674 magnus 26u IPv4 813527 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43486->52.119.189.184:https (CLOSE_WAIT) ... #+end_example Am I using Amazonka and/or Conduit in a way that results in this? How do I should I use them? Or, is it an issue somewhere "below" my code? What can I do address that? Thanks for any insights or help /M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus at therning.org twitter: magthe http://magnus.therning.org/ Action is the foundational key to all success. — Pablo Picasso -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 861 bytes Desc: not available URL: From ietf-dane at dukhovni.org Thu Nov 26 20:20:22 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Thu, 26 Nov 2020 15:20:22 -0500 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,)a) In-Reply-To: <20201126042441.GM1464@straasha.imrryr.org> References: <20201125201622.GJ1464@straasha.imrryr.org> <20201125211518.GA31173@painter.painter> <20201125231310.GL1464@straasha.imrryr.org> <20201126002320.GA4766@painter.painter> <20201126042441.GM1464@straasha.imrryr.org> Message-ID: <20201126202022.GO1464@straasha.imrryr.org> On Wed, Nov 25, 2020 at 11:24:41PM -0500, Viktor Dukhovni wrote: > > It's not hard to imagine, in the absence of these instances, Haskell > > loosening the restriction on creating these types of instances. The > > restriction is certainly not innate to mathematics or type theory. > > Type inference would get more complicated if it would have to consider > all possible slots in each term when searching for the instance head. > > > My position is against having most of these instances in base, not for > > switching the bias from right to left. > > So you'd like to see a 2-tuple with fewer built-in instances, I'm > sympathetic to the case for not having Traversable/Foldable for > 2-tuples, but I don't see a compelling for not having Functor/Monad. Would the attached module be useful to you or anyone else? It implements two newtype-wrapped types: 'LP a b' and 'RP a b'. 'LP a b' has a run-time represenation of (and is coercible to) (b, a). It is a Functor, Applicative and Monad in the left slot of the underlying 2-tuple. 'RP a b' has a run-time representation of (a, b) and is a Functor, Applicative and Monad in the right slot of the underlying 2-tuple. λ> :t LP (1, "foo") LP (1, "foo") :: Num b => OrderedPair 'BL [Char] b λ> :t RP (1, "foo") RP (1, "foo") :: Num a => OrderedPair 'BR a [Char] These share the "safe" class instances of (,) from Prelude, but omit the potentially problematic Foldable (and hence also Traversable). λ> fmap succ $ LP (1, 10) LP (2,10) λ> fmap succ $ RP (1, 10) RP (1,11) The Bifunctor instance is therefore "flipped" in the "LP" case: λ> bimap succ pred $ LP (1, 10) LP (0,11) λ> bimap succ pred $ RP (1, 10) RP (2,9) The class 'LROrder' exports zero-cost coercions to ordinary 2-tuples, and also conversions to 2-tuples that take/return (a, b) regardless of the underlying 2-tuple representation. λ> toPair $ LP (1, "foo") (1,"foo") λ> rePair $ LP (1, "foo") ("foo",1) λ> toPair $ RP (1, "foo") (1,"foo") λ> rePair $ RP (1, "foo") (1,"foo") Application code can be polymorphic in the 2-tuple order: foo :: LROrder o => ((a, b) -> x) -> OrderedPair o a b -> x foo f = f . rePair bar :: LROrder o => (b -> c) -> OrderedPair o a b -> OrderedPair o a c bar f = fmap f or when desired work with a given order using coercions to extract the underlying representation for interaction with external libraries. foo :: ((b, a) -> x) -> LP a b -> x foo f = f . toPair bar :: ((a, b) -> x) -> RP a b -> x bar f = f . toPair baz :: (b -> c) -> ((c, a) -> x) -> LP a b -> x baz f g = g . toPair . fmap f I expect that for most cases the (b, a) representation is not particularly compelling. And the order-polymorphism is not needed. In other words, the existing "bias" of Functor, Applicative and Monad to operate on the second element is a natural convention rather than an obstacle. -- Viktor. -------------- next part -------------- A non-text attachment was scrubbed... Name: LRPair.hs Type: text/x-haskell Size: 3742 bytes Desc: not available URL: From b at chreekat.net Sat Nov 28 16:41:57 2020 From: b at chreekat.net (Bryan Richter) Date: Sat, 28 Nov 2020 18:41:57 +0200 Subject: [Haskell-cafe] Amazonka, conduit and sockets not closing In-Reply-To: <874klcgt2m.fsf@therning.org> References: <874klcgt2m.fsf@therning.org> Message-ID: I thought CLOSE_WAIT *is* one of the "closed" states. TCP sockets stick around for a few minutes after use, right? You may simply be generating sockets faster than one operating system can handle. Find some way to reuse existing sockets, perhaps? On Thu, Nov 26, 2020 at 3:13 PM Magnus Therning wrote: > > I've run into a problem with running out of filedescriptors. The > following snippet is a trimmed down version of what I'm doing: > > #+begin_src haskell > main :: IO () > main = do > awsEnv <- newEnv Discover > runAWSCond awsEnv $ > sqsSource queueUrl > .| C.mapC snd > .| sqsDeleteSink queueUrl > where > runAWSCond awsEnv = runResourceT . runAWS awsEnv . within Frankfurt . C.runConduit > > sqsSource :: MonadAWS m => T.Text -> C.ConduitT () (T.Text, T.Text) m () > sqsSource queueUrl = do > (_, msgs) <- C.lift $ recvSQS queueUrl > C.yieldMany msgs > sqsSource queueUrl > > sqsDeleteSink :: MonadAWS m => T.Text -> C.ConduitT T.Text o m () > sqsDeleteSink queueUrl = do > C.await >>= \case > Nothing -> pure () > Just receiptHandle -> do > void $ C.lift $ delSQS queueUrl receiptHandle > sqsDeleteSink queueUrl > > recvSQS queueUrl = do > let rm = receiveMessage queueUrl & rmMaxNumberOfMessages ?~ 10 > rmrs <- send rm > let status = rmrs ^. rmrsResponseStatus > msgs = rmrs ^. rmrsMessages & traversed %~ extract > pure (status, catMaybes msgs) > where > extract msg = do > body <- msg ^. mBody > rh <- msg ^. mReceiptHandle > pure (body, rh) > > delSQS queueUrl receiptHandle = do > let dm = deleteMessage queueUrl receiptHandle > send dm > #+end_src > > This works fine for a while, but given a queue with enough messages it will fail > with something like > > #+begin_example > TransportError (HttpExceptionRequest Request { > host = "sqs.eu-central-1.amazonaws.com" > port = 443 > secure = True > requestHeaders = [("Host","sqs.eu-central-1.amazonaws.com"),("X-Amz-Date","20201126T101659Z"),("X-Amz-Content-SHA256","2e4bdf20a857a1416f218b1218670cf019ff53268d0adb34fe06402a62f3271d"),("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),("Authorization","")] > path = "/" > queryString = "" > method = "POST" > proxy = Nothing > rawBody = False > redirectCount = 0 > responseTimeout = ResponseTimeoutMicro 70000000 > requestVersion = HTTP/1.1 > } > (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = , addrCanonName = }, host name: Just "sqs.eu-central-1.amazonaws.com", service name: Just "443"): does not exist (System error))) > #+end_example > > After some detours I found out that it's actually not a network issue, but > rather that the process runs out of filedescriptors. Using =lsof= I can see that > it doesn't seem to close /any/ sockets at all, instead they get stuck in a > =CLOSE_WAIT= state: > > #+begin_example > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME > wd-stats 88674 magnus 23u IPv4 815196 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60624->52.119.188.213:https (CLOSE_WAIT) > wd-stats 88674 magnus 24u IPv4 811362 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43482->52.119.189.184:https (CLOSE_WAIT) > wd-stats 88674 magnus 25u IPv4 811386 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60628->52.119.188.213:https (CLOSE_WAIT) > wd-stats 88674 magnus 26u IPv4 813527 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43486->52.119.189.184:https (CLOSE_WAIT) > ... > #+end_example > > Am I using Amazonka and/or Conduit in a way that results in this? How do I should I use them? > > Or, is it an issue somewhere "below" my code? What can I do address that? > > Thanks for any insights or help > /M > > -- > Magnus Therning OpenPGP: 0x927912051716CE39 > email: magnus at therning.org > twitter: magthe http://magnus.therning.org/ > > Action is the foundational key to all success. > — Pablo Picasso > _______________________________________________ > 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 will.yager at gmail.com Sat Nov 28 17:42:58 2020 From: will.yager at gmail.com (Will Yager) Date: Sat, 28 Nov 2020 09:42:58 -0800 Subject: [Haskell-cafe] Amazonka, conduit and sockets not closing In-Reply-To: References: Message-ID: Linux has kernel params you can tweak for socket reuse. Also look up SO_REUSEADDR for background. > On Nov 28, 2020, at 8:44 AM, Bryan Richter wrote: > > I thought CLOSE_WAIT *is* one of the "closed" states. TCP sockets > stick around for a few minutes after use, right? You may simply be > generating sockets faster than one operating system can handle. Find > some way to reuse existing sockets, perhaps? > >> On Thu, Nov 26, 2020 at 3:13 PM Magnus Therning wrote: >> >> I've run into a problem with running out of filedescriptors. The >> following snippet is a trimmed down version of what I'm doing: >> >> #+begin_src haskell >> main :: IO () >> main = do >> awsEnv <- newEnv Discover >> runAWSCond awsEnv $ >> sqsSource queueUrl >> .| C.mapC snd >> .| sqsDeleteSink queueUrl >> where >> runAWSCond awsEnv = runResourceT . runAWS awsEnv . within Frankfurt . C.runConduit >> >> sqsSource :: MonadAWS m => T.Text -> C.ConduitT () (T.Text, T.Text) m () >> sqsSource queueUrl = do >> (_, msgs) <- C.lift $ recvSQS queueUrl >> C.yieldMany msgs >> sqsSource queueUrl >> >> sqsDeleteSink :: MonadAWS m => T.Text -> C.ConduitT T.Text o m () >> sqsDeleteSink queueUrl = do >> C.await >>= \case >> Nothing -> pure () >> Just receiptHandle -> do >> void $ C.lift $ delSQS queueUrl receiptHandle >> sqsDeleteSink queueUrl >> >> recvSQS queueUrl = do >> let rm = receiveMessage queueUrl & rmMaxNumberOfMessages ?~ 10 >> rmrs <- send rm >> let status = rmrs ^. rmrsResponseStatus >> msgs = rmrs ^. rmrsMessages & traversed %~ extract >> pure (status, catMaybes msgs) >> where >> extract msg = do >> body <- msg ^. mBody >> rh <- msg ^. mReceiptHandle >> pure (body, rh) >> >> delSQS queueUrl receiptHandle = do >> let dm = deleteMessage queueUrl receiptHandle >> send dm >> #+end_src >> >> This works fine for a while, but given a queue with enough messages it will fail >> with something like >> >> #+begin_example >> TransportError (HttpExceptionRequest Request { >> host = "sqs.eu-central-1.amazonaws.com" >> port = 443 >> secure = True >> requestHeaders = [("Host","sqs.eu-central-1.amazonaws.com"),("X-Amz-Date","20201126T101659Z"),("X-Amz-Content-SHA256","2e4bdf20a857a1416f218b1218670cf019ff53268d0adb34fe06402a62f3271d"),("Content-Type","application/x-www-form-urlencoded; charset=utf-8"),("Authorization","")] >> path = "/" >> queryString = "" >> method = "POST" >> proxy = Nothing >> rawBody = False >> redirectCount = 0 >> responseTimeout = ResponseTimeoutMicro 70000000 >> requestVersion = HTTP/1.1 >> } >> (ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = , addrCanonName = }, host name: Just "sqs.eu-central-1.amazonaws.com", service name: Just "443"): does not exist (System error))) >> #+end_example >> >> After some detours I found out that it's actually not a network issue, but >> rather that the process runs out of filedescriptors. Using =lsof= I can see that >> it doesn't seem to close /any/ sockets at all, instead they get stuck in a >> =CLOSE_WAIT= state: >> >> #+begin_example >> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME >> wd-stats 88674 magnus 23u IPv4 815196 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60624->52.119.188.213:https (CLOSE_WAIT) >> wd-stats 88674 magnus 24u IPv4 811362 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43482->52.119.189.184:https (CLOSE_WAIT) >> wd-stats 88674 magnus 25u IPv4 811386 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60628->52.119.188.213:https (CLOSE_WAIT) >> wd-stats 88674 magnus 26u IPv4 813527 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43486->52.119.189.184:https (CLOSE_WAIT) >> ... >> #+end_example >> >> Am I using Amazonka and/or Conduit in a way that results in this? How do I should I use them? >> >> Or, is it an issue somewhere "below" my code? What can I do address that? >> >> Thanks for any insights or help >> /M >> >> -- >> Magnus Therning OpenPGP: 0x927912051716CE39 >> email: magnus at therning.org >> twitter: magthe http://magnus.therning.org/ >> >> Action is the foundational key to all success. >> — Pablo Picasso >> _______________________________________________ >> 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. From ietf-dane at dukhovni.org Sat Nov 28 18:34:16 2020 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Sat, 28 Nov 2020 13:34:16 -0500 Subject: [Haskell-cafe] Amazonka, conduit and sockets not closing In-Reply-To: <874klcgt2m.fsf@therning.org> References: <874klcgt2m.fsf@therning.org> Message-ID: <20201128183416.GQ1464@straasha.imrryr.org> On Thu, Nov 26, 2020 at 02:12:49PM +0100, Magnus Therning wrote: > After some detours I found out that it's actually not a network issue, but > rather that the process runs out of filedescriptors. Using =lsof= I can see that > it doesn't seem to close /any/ sockets at all, instead they get stuck in a > =CLOSE_WAIT= state: > > #+begin_example > COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME > wd-stats 88674 magnus 23u IPv4 815196 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60624->52.119.188.213:https (CLOSE_WAIT) > wd-stats 88674 magnus 24u IPv4 811362 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43482->52.119.189.184:https (CLOSE_WAIT) > wd-stats 88674 magnus 25u IPv4 811386 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60628->52.119.188.213:https (CLOSE_WAIT) > wd-stats 88674 magnus 26u IPv4 813527 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43486->52.119.189.184:https (CLOSE_WAIT) > ... > #+end_example How many such still open file descriptors did you find? (If you run "lsof -n -P -i tcp -a -p $pid", it'll produce the output faster, reporting only sockets). Contrary to other replies, indeed the sockets above are NOT closed in your process, otherwise they'd not be associated with a file descriptor and would just show up in "netstat", but not "lsof" output. I don't know what happens inside Amazonka, but typically clients doing many concurrent HTTPS calls employ a TlsManager that maintains a connection pool, and would avoid opening too many concurrent connections, but would also keep a limited number of connections open for more requests. How many still open connections did you find? I don't know whether TlsManager aggregates connections by name or IP address, if the latter, perhaps (very speculatively, without looking at the underlying code, ...) Amazon's IP address is changing quickly (short or 0 TTL) breaking the connection pool's per-destination connection limits. This is a wild guess, more evidence is needed to make it actually plausible or rule it out. -- Viktor. From amindfv at mailbox.org Sat Nov 28 21:05:52 2020 From: amindfv at mailbox.org (amindfv at mailbox.org) Date: Sat, 28 Nov 2020 16:05:52 -0500 Subject: [Haskell-cafe] STM rollback? Message-ID: <20201128210552.GB20626@painter.painter> I'd like to be able to give up on an STM transaction: roll back and don't retry. I've cooked up something with exceptions but it feels a bit icky to use exceptions for something like this - is there a better way?: data Rollback = Rollback deriving (Show) instance Exception Rollback rollback :: STM x rollback = throwSTM Rollback atomicallyWithRollback :: STM x -> IO (Maybe x) atomicallyWithRollback a = (Just <$> atomically a) `catch` (\Rollback -> pure Nothing) The alternative I've found is something like: otherWay :: STM x -> IO (Maybe x) otherWay a = atomically $ (Just <$> a) `orElse` pure Nothing But this turns any "retry" in "a" into a rollback, and I'd like to have the option to do either (retry or rollback). Thanks, Tom From alexander.vershilov at gmail.com Sat Nov 28 21:14:03 2020 From: alexander.vershilov at gmail.com (Alexander Vershilov) Date: Sun, 29 Nov 2020 00:14:03 +0300 Subject: [Haskell-cafe] STM rollback? In-Reply-To: <20201128210552.GB20626@painter.painter> References: <20201128210552.GB20626@painter.painter> Message-ID: <1A2C5375-780D-4337-B1F2-E310DEF89C7A@gmail.com> As far as I understand you can call throwSTM and get desired effect. — Alexander Vershilov > 29 нояб. 2020 г., в 00:07, amindfv--- via Haskell-Cafe написал(а): > > I'd like to be able to give up on an STM transaction: roll back and don't retry. > I've cooked up something with exceptions but it feels a bit icky to use exceptions for something like this - is there a better way?: > > data Rollback = Rollback deriving (Show) > instance Exception Rollback > > rollback :: STM x > rollback = throwSTM Rollback > > atomicallyWithRollback :: STM x -> IO (Maybe x) > atomicallyWithRollback a = > (Just <$> atomically a) > `catch` (\Rollback -> pure Nothing) > > The alternative I've found is something like: > > otherWay :: STM x -> IO (Maybe x) > otherWay a = > atomically $ (Just <$> a) `orElse` pure Nothing > > But this turns any "retry" in "a" into a rollback, and I'd like to have the option to do either (retry or rollback). > > Thanks, > Tom > > > _______________________________________________ > 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 fryguybob at gmail.com Sat Nov 28 23:40:37 2020 From: fryguybob at gmail.com (Ryan Yates) Date: Sat, 28 Nov 2020 18:40:37 -0500 Subject: [Haskell-cafe] STM rollback? In-Reply-To: <20201128210552.GB20626@painter.painter> References: <20201128210552.GB20626@painter.painter> Message-ID: I think how you want to do this depends on the motivation of why you want to rollback. Note that rolling back based on information *inside* the transaction means that the transaction must be consistent to successfully rollback. If you want to trigger rolling back from *outside* the transaction you can do something like this: atomicallyWithCancel :: TVar Bool -> STM x -> IO (Maybe x) atomicallyWithCancel cancel act = atomically ((readTVar cancel >>= check . not >> return Nothing) `orElse` (Just <$> act)) Note that this still has to have a consistent view of memory to successfully "cancel", but if it reaches the end of the transaction it will notice an inconsistent read of the "cancel" tvar and restart the transaction. Then it will quickly commit the cancel transaction that only reads a single TVar and returns Nothing. Ryan On Sat, Nov 28, 2020 at 4:07 PM amindfv--- via Haskell-Cafe < haskell-cafe at haskell.org> wrote: > I'd like to be able to give up on an STM transaction: roll back and don't > retry. > I've cooked up something with exceptions but it feels a bit icky to use > exceptions for something like this - is there a better way?: > > data Rollback = Rollback deriving (Show) > instance Exception Rollback > > rollback :: STM x > rollback = throwSTM Rollback > > atomicallyWithRollback :: STM x -> IO (Maybe x) > atomicallyWithRollback a = > (Just <$> atomically a) > `catch` (\Rollback -> pure Nothing) > > The alternative I've found is something like: > > otherWay :: STM x -> IO (Maybe x) > otherWay a = > atomically $ (Just <$> a) `orElse` pure Nothing > > But this turns any "retry" in "a" into a rollback, and I'd like to have > the option to do either (retry or rollback). > > Thanks, > Tom > > > _______________________________________________ > 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 magnus at therning.org Sun Nov 29 09:27:59 2020 From: magnus at therning.org (Magnus Therning) Date: Sun, 29 Nov 2020 10:27:59 +0100 Subject: [Haskell-cafe] Amazonka, conduit and sockets not closing In-Reply-To: <20201128183416.GQ1464@straasha.imrryr.org> References: <874klcgt2m.fsf@therning.org> <20201128183416.GQ1464@straasha.imrryr.org> Message-ID: <87sg8sbjhc.fsf@therning.org> Viktor Dukhovni writes: > On Thu, Nov 26, 2020 at 02:12:49PM +0100, Magnus Therning wrote: > >> After some detours I found out that it's actually not a network issue, but >> rather that the process runs out of filedescriptors. Using =lsof= I can see that >> it doesn't seem to close /any/ sockets at all, instead they get stuck in a >> =CLOSE_WAIT= state: >> >> #+begin_example >> COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME >> wd-stats 88674 magnus 23u IPv4 815196 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60624->52.119.188.213:https (CLOSE_WAIT) >> wd-stats 88674 magnus 24u IPv4 811362 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43482->52.119.189.184:https (CLOSE_WAIT) >> wd-stats 88674 magnus 25u IPv4 811386 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:60628->52.119.188.213:https (CLOSE_WAIT) >> wd-stats 88674 magnus 26u IPv4 813527 0t0 TCP ip-192-168-0-9.eu-central-1.compute.internal:43486->52.119.189.184:https (CLOSE_WAIT) >> ... >> #+end_example > > How many such still open file descriptors did you find? Hundreds of them. > (If you run "lsof -n -P -i tcp -a -p $pid", it'll produce > the output faster, reporting only sockets). > > Contrary to other replies, indeed the sockets above are NOT closed in > your process, otherwise they'd not be associated with a file > descriptor and would just show up in "netstat", but not "lsof" output. > > I don't know what happens inside Amazonka, but typically clients doing > many concurrent HTTPS calls employ a TlsManager that maintains a > connection pool, and would avoid opening too many concurrent > connections, but would also keep a limited number of connections open > for more requests. After I reported it to the Amazonka project[1] I found out that it most likely is a known issue[2]. I have still to confirm that the fix for [2] solves the issue I'm seeing. [1]: https://github.com/brendanhay/amazonka/issues/608 [2]: https://github.com/brendanhay/amazonka/issues/490 /M -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus at therning.org twitter: magthe http://magnus.therning.org/ I am always doing that which I cannot do, in order that I may learn how to do it. — Pablo Picasso -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 861 bytes Desc: not available URL: From tonymorris at gmail.com Mon Nov 30 04:29:22 2020 From: tonymorris at gmail.com (Tony Morris) Date: Mon, 30 Nov 2020 14:29:22 +1000 Subject: [Haskell-cafe] Textbook example of instance Foldable ((,) a) In-Reply-To: References: <874klg6rtx.fsf@uibk.ac.at> <87wnyc5cba.fsf@gmail.com> Message-ID: <5405a232-bc9f-c970-67e5-14374e6cf2b2@gmail.com> Yes. On 11/24/20 6:18 AM, Sven Panne wrote: > but is this really what comes to your mind first? -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From compl.yue at icloud.com Mon Nov 30 06:21:29 2020 From: compl.yue at icloud.com (YueCompl) Date: Mon, 30 Nov 2020 14:21:29 +0800 Subject: [Haskell-cafe] STM rollback? In-Reply-To: <20201128210552.GB20626@painter.painter> References: <20201128210552.GB20626@painter.painter> Message-ID: <651D1B93-9322-4B7A-8CE2-CE9F0BA907D9@icloud.com> The exception based solution is the best as far as I can tell for now (But I'm not authoritative of course). Maybe a dedicated `Rollback` algebraic effect and its respective handler would feel less "icky"? But the machinery is not generally available yet, and maybe an algebraic effects based solution will be overkill taking the ergonomic cost it'll impose, even if practically doable? Regards, Compl > On 2020-11-29, at 05:05, amindfv--- via Haskell-Cafe wrote: > > I'd like to be able to give up on an STM transaction: roll back and don't retry. > I've cooked up something with exceptions but it feels a bit icky to use exceptions for something like this - is there a better way?: > > data Rollback = Rollback deriving (Show) > instance Exception Rollback > > rollback :: STM x > rollback = throwSTM Rollback > > atomicallyWithRollback :: STM x -> IO (Maybe x) > atomicallyWithRollback a = > (Just <$> atomically a) > `catch` (\Rollback -> pure Nothing) > > The alternative I've found is something like: > > otherWay :: STM x -> IO (Maybe x) > otherWay a = > atomically $ (Just <$> a) `orElse` pure Nothing > > But this turns any "retry" in "a" into a rollback, and I'd like to have the option to do either (retry or rollback). > > Thanks, > Tom > > > _______________________________________________ > 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 jo at durchholz.org Mon Nov 30 08:45:33 2020 From: jo at durchholz.org (Joachim Durchholz) Date: Mon, 30 Nov 2020 09:45:33 +0100 Subject: [Haskell-cafe] STM rollback? In-Reply-To: <20201128210552.GB20626@painter.painter> References: <20201128210552.GB20626@painter.painter> Message-ID: <5292b95a-e477-1cf4-deee-4605c8296e90@durchholz.org> From a contract design perspective, rolling back means that an operation failed and had to be undone. (If everything was fine, you wouldn't want to rollback, wouldn't you?) So if rollback is the reaction to some failure, then triggering it via an exception is the Right Thing To Do, actually. Oh, and you always want to rollback if there's an exception somewhere. Now that contract thing warrants a few more words. Yes, you can word your contracts so that they include failure. It's just that they get more complicated. Usually so much more complicated that it's not worth it. Also, you want any exception (i.e. breach of contract) to go into a rollback. Now in Haskell, rolling back means just abandoning the computation since things aren't mutable and there is no state that you need to restore. Technically, not even in STM - so there *is* reason to make the rollback non-exceptional here: One could argue that STM is *supposed* to include the rollback in the contract. In the end, it depends on your use case: Do you want the rollback in the contract or not? Now for STM itself, yeah using an exception to trigger a rollback is a bit hacky. OTOH it works. OT3H it might be a good idea to have a rollback function for STM. Technically it would just trigger the same exception, but it would indicate that the rollback is part of the contract. OT4H throwing Rollback is essentially an indicator of non-failure rollback (otherwise you'd be throwing whatever exception is appropriate, or get aborted by some library functionality that throws an exception). Regards, Jo Am 28.11.20 um 22:05 schrieb amindfv--- via Haskell-Cafe: > I'd like to be able to give up on an STM transaction: roll back and don't retry. > I've cooked up something with exceptions but it feels a bit icky to use exceptions for something like this - is there a better way?: > > data Rollback = Rollback deriving (Show) > instance Exception Rollback > > rollback :: STM x > rollback = throwSTM Rollback > > atomicallyWithRollback :: STM x -> IO (Maybe x) > atomicallyWithRollback a = > (Just <$> atomically a) > `catch` (\Rollback -> pure Nothing) > > The alternative I've found is something like: > > otherWay :: STM x -> IO (Maybe x) > otherWay a = > atomically $ (Just <$> a) `orElse` pure Nothing > > But this turns any "retry" in "a" into a rollback, and I'd like to have the option to do either (retry or rollback). > > Thanks, > Tom > > > _______________________________________________ > 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 gueven.bay at googlemail.com Mon Nov 30 20:34:26 2020 From: gueven.bay at googlemail.com (Gueven Bay) Date: Mon, 30 Nov 2020 21:34:26 +0100 Subject: [Haskell-cafe] What features should an (fictitious) IDE for Haskell have? Message-ID: Greetings, Imagine that you can decide what functionality and features an Integrated Development Environment for Haskell should get. You can make this IDE with your wishlist similar in power as other IDEs for Java for example. Now list as many features as you can, what would make the life of a Haskell developer as comfortable as possible!? I am dying to know how this list of features at the end (of this thread) will look like. From alan.zimm at gmail.com Mon Nov 30 20:46:39 2020 From: alan.zimm at gmail.com (Alan & Kim Zimmerman) Date: Mon, 30 Nov 2020 20:46:39 +0000 Subject: [Haskell-cafe] What features should an (fictitious) IDE for Haskell have? In-Reply-To: References: Message-ID: I would want to see moldable development[1] style search and visualisation. Or something like [2] Alan [1] https://gtoolkit.com/ [2] https://2020.splashcon.org/details/splash-2020-oopsla/98/Adding-Interactive-Visual-Syntax-to-Textual-Code On Mon, 30 Nov 2020 at 20:35, Gueven Bay via Haskell-Cafe < haskell-cafe at haskell.org> wrote: > Greetings, > > Imagine that you can decide what functionality and features an > Integrated Development Environment for Haskell should get. You can > make this IDE with your wishlist similar in power as other IDEs for > Java for example. > > Now list as many features as you can, what would make the life of a > Haskell developer as comfortable as possible!? > > I am dying to know how this list of features at the end (of this > thread) will look like. > _______________________________________________ > 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 tikhon at jelv.is Mon Nov 30 21:25:06 2020 From: tikhon at jelv.is (Tikhon Jelvis) Date: Mon, 30 Nov 2020 13:25:06 -0800 Subject: [Haskell-cafe] What features should an (fictitious) IDE for Haskell have? In-Reply-To: References: Message-ID: Biggest feature I want is automated refactoring. Changing a type definition and getting a bunch of errors to fix is one of the defining features of Haskell as a development experience—but the changes themselves are still pretty manual, and in larger codebases, this quickly gets painful. I would love a system where I make a change, get a bunch of errors and as much of the refactoring as possible is done for me automatically. This would include traditional refactorings like renaming functions and constructors, but it would also include more Haskell-specific refactorings, potentially with some amount of interactiveness. One example I ran into recently: I added a field to a constructor that was used pretty widely in my code, especially in lots of tests, and I had to manually update each pattern using that constructor to disregard the new field and add a default value (an empty string, in this case) everywhere the constructor was used to build a value. This was really tedious to do, and seems systematic enough that it could have been fully automated. In other scenarios, I would want my editor to cycle me through each location that needs to update and give me an automated suggestion I can accept or reject so that I could do a first pass quickly and only spend time on cases that require more manual intervention. I have not used any Haskell refactoring tools yet, so I am not sure what exists today. Google around now, it looks like Facebook's retrie[1] project might be expressive enough to do the heavy lifting for a tool like this, so perhaps we just need a friendly frontend for it. [1]: https://github.com/facebookincubator/retrie On Mon, Nov 30, 2020 at 12:49 PM Alan & Kim Zimmerman wrote: > I would want to see moldable development[1] style search and visualisation. > > Or something like [2] > > Alan > > [1] https://gtoolkit.com/ > [2] > https://2020.splashcon.org/details/splash-2020-oopsla/98/Adding-Interactive-Visual-Syntax-to-Textual-Code > > > On Mon, 30 Nov 2020 at 20:35, Gueven Bay via Haskell-Cafe < > haskell-cafe at haskell.org> wrote: > >> Greetings, >> >> Imagine that you can decide what functionality and features an >> Integrated Development Environment for Haskell should get. You can >> make this IDE with your wishlist similar in power as other IDEs for >> Java for example. >> >> Now list as many features as you can, what would make the life of a >> Haskell developer as comfortable as possible!? >> >> I am dying to know how this list of features at the end (of this >> thread) will look like. >> _______________________________________________ >> 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 lemming at henning-thielemann.de Mon Nov 30 21:40:49 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon, 30 Nov 2020 22:40:49 +0100 (CET) Subject: [Haskell-cafe] What features should an (fictitious) IDE for Haskell have? In-Reply-To: References: Message-ID: On Mon, 30 Nov 2020, Tikhon Jelvis wrote: > Biggest feature I want is automated refactoring. Any such refactoring tool would require a (configurable) formatting and indentation tool, because even simple search&replace will break your layout. Thus, a good code formatter would be an even more important feature of the IDE. From alan.zimm at gmail.com Mon Nov 30 22:26:44 2020 From: alan.zimm at gmail.com (Alan & Kim Zimmerman) Date: Mon, 30 Nov 2020 22:26:44 +0000 Subject: [Haskell-cafe] What features should an (fictitious) IDE for Haskell have? In-Reply-To: References: Message-ID: On Mon, 30 Nov 2020 at 21:42, Henning Thielemann < lemming at henning-thielemann.de> wrote: > > On Mon, 30 Nov 2020, Tikhon Jelvis wrote: > > > Biggest feature I want is automated refactoring. > > Any such refactoring tool would require a (configurable) formatting and > indentation tool, because even simple search&replace will break your > layout. Thus, a good code formatter would be an even more important > feature of the IDE. > The ghc-exactprint library (as used in retrie, hlint refactors and HaRe) makes it so you can change the AST in a refactoring and preserve formatting/layout in the result. Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: