From mechvel at scico.botik.ru Sun Mar 1 19:44:47 2020 From: mechvel at scico.botik.ru (mechvel at scico.botik.ru) Date: Sun, 01 Mar 2020 22:44:47 +0300 Subject: [Haskell-cafe] lib for drawing with mouse Message-ID: Please, does there exist a tool (library) in Haskell that supports doing the following with graphics? (1) To draw a curve by mouse on a screen and save this picture in a file (many different curves to be input this way). (2) To save in data.txt the coordinates of the points of this curve, say, 800 pairs of numbers (floating point or rational ...). (3) Reversely: to draw a curve on a screen by inputting from such data.txt. The main is (1)&(2). Because currently I set a curve by putting many times the '*' character and `space' to a text file, and this takes long. Thanks, ------ Sergei From simon at joyful.com Mon Mar 2 02:16:07 2020 From: simon at joyful.com (Simon Michael) Date: Sun, 1 Mar 2020 18:16:07 -0800 Subject: [Haskell-cafe] ANN: hledger 1.16 Message-ID: <99887FFD-0AA3-47CA-9908-8BBCABC66065@joyful.com> I'm pleased to announce hledger 1.17 ! hledger is a robust, cross-platform, plain text accounting tool, with command-line, terminal and web UIs. It is a modern and largely compatible reimplementation of Ledger CLI with many improvements. You can use it to track time, money, investents, cryptocurrencies, inventory and more. See: http://hledger.org http://plaintextaccounting.org hledger 1.17 is released on schedule on 2020-03-01. Thanks to release contributors Aleksandar Dimitrov, Brian Wignall, Stephen Morgan, Jacek Generowicz, Gaith Hallak, Eric Mertens, Jakob Schöttl, Carl Richard Theodor Schneider, David Zhang, Amarandus, Evilham, Mateus Furquim, and Rui Chen. HIGHLIGHTS: CSV single-field matching, easier SSV/TSV conversion, fixed/enhanced close command, undo in add command, more JSON output, org headline support in timedot format, GHC 8.10 support. See all changes at https://hledger.org/release-notes . GETTING STARTED: Many install methods are described at http://hledger.org/download. Here are three ways to build from source: stack update; stack install --resolver=lts hledger-lib-1.17 hledger-1.17 hledger-ui-1.17 hledger-web-1.17 --silent or: cabal v2-update; cabal v2-install hledger-1.17 hledger-web-1.17 hledger-ui-1.17 or: curl -sO https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-install/hledger-install.sh less hledger-install.sh bash hledger-install.sh While building, peruse https://hledger.org/start For help, see http://hledger.org#help-feedback and join us on Freenode (#hledger, http://irc.hledger.org) or via Matrix (#freenode_#hledger:matrix.org, http://riot.hledger.org). New and old users, contributors, sponsors, and all feedback are most welcome! Best, -Simon From simon at joyful.com Mon Mar 2 02:33:02 2020 From: simon at joyful.com (Simon Michael) Date: Sun, 1 Mar 2020 18:33:02 -0800 Subject: [Haskell-cafe] ANN: hledger 1.17 In-Reply-To: <99887FFD-0AA3-47CA-9908-8BBCABC66065@joyful.com> References: <99887FFD-0AA3-47CA-9908-8BBCABC66065@joyful.com> Message-ID: <219AF75B-B0A1-4EBA-9BC7-9653BBA3155D@joyful.com> Oops. One more time with right subject. And a bonus: https://podcastle.org/2009/10/09/pc-miniature-38-accounting-for-dragons . Guard your hoard! -Simon > On Mar 1, 2020, at 6:16 PM, Simon Michael wrote: > > I'm pleased to announce hledger 1.17 ! > > hledger is a robust, cross-platform, plain text accounting tool, with > command-line, terminal and web UIs. It is a modern and largely > compatible reimplementation of Ledger CLI with many improvements. > You can use it to track time, money, investents, cryptocurrencies, > inventory and more. See: > > http://hledger.org > http://plaintextaccounting.org > > hledger 1.17 is released on schedule on 2020-03-01. > Thanks to release contributors Aleksandar Dimitrov, Brian Wignall, > Stephen Morgan, Jacek Generowicz, Gaith Hallak, Eric Mertens, Jakob > Schöttl, Carl Richard Theodor Schneider, David Zhang, Amarandus, > Evilham, Mateus Furquim, and Rui Chen. > > HIGHLIGHTS: > > CSV single-field matching, > easier SSV/TSV conversion, > fixed/enhanced close command, > undo in add command, > more JSON output, > org headline support in timedot format, > GHC 8.10 support. > > See all changes at https://hledger.org/release-notes . > > GETTING STARTED: > > Many install methods are described at http://hledger.org/download. > Here are three ways to build from source: > > stack update; stack install --resolver=lts hledger-lib-1.17 hledger-1.17 hledger-ui-1.17 hledger-web-1.17 --silent > > or: > > cabal v2-update; cabal v2-install hledger-1.17 hledger-web-1.17 hledger-ui-1.17 > > or: > > curl -sO https://raw.githubusercontent.com/simonmichael/hledger/master/hledger-install/hledger-install.sh > less hledger-install.sh > bash hledger-install.sh > > While building, peruse https://hledger.org/start > > For help, see http://hledger.org#help-feedback > and join us on Freenode (#hledger, http://irc.hledger.org) > or via Matrix (#freenode_#hledger:matrix.org, http://riot.hledger.org). > > New and old users, contributors, sponsors, and all feedback are most welcome! > > Best, > -Simon > > -- > You received this message because you are subscribed to the Google Groups "hledger" group. > To unsubscribe from this group and stop receiving emails from it, send an email to hledger+unsubscribe at googlegroups.com. > To view this discussion on the web visit https://groups.google.com/d/msgid/hledger/99887FFD-0AA3-47CA-9908-8BBCABC66065%40joyful.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From branimir.maksimovic at gmail.com Mon Mar 2 22:45:24 2020 From: branimir.maksimovic at gmail.com (Branimir Maksimovic) Date: Mon, 2 Mar 2020 23:45:24 +0100 Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: References: Message-ID: Gtk? On 3/1/20 8:44 PM, mechvel at scico.botik.ru wrote: > Please, > > does there exist a tool (library) in Haskell that supports doing the > following > with graphics? > > (1) To draw a curve by mouse on a screen and save this picture in a file >     (many different curves to be input this way). > (2) To save in  data.txt  the coordinates of the points of this curve, >     say, 800 pairs of numbers (floating point or rational ...). > (3) Reversely: to draw a curve on a screen by inputting from such > data.txt. > > The main is (1)&(2). Because currently I set a curve by putting many > times the > '*' character and `space' to a text file, and this takes long. > > Thanks, > > ------ > Sergei > > _______________________________________________ > 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 lemming at henning-thielemann.de Mon Mar 2 22:59:20 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon, 2 Mar 2020 23:59:20 +0100 (CET) Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: References: Message-ID: > On 3/1/20 8:44 PM, mechvel at scico.botik.ru wrote: >> Please, >> >> does there exist a tool (library) in Haskell that supports doing the >> following >> with graphics? >> >> (1) To draw a curve by mouse on a screen and save this picture in a file >>     (many different curves to be input this way). >> (2) To save in  data.txt  the coordinates of the points of this curve, >>     say, 800 pairs of numbers (floating point or rational ...). >> (3) Reversely: to draw a curve on a screen by inputting from such >> data.txt. >> >> The main is (1)&(2). Because currently I set a curve by putting many >> times the >> '*' character and `space' to a text file, and this takes long. Sounds like a part of what Detexify does. Detexify runs in a Browser. From mechvel at scico.botik.ru Tue Mar 3 12:26:21 2020 From: mechvel at scico.botik.ru (mechvel at scico.botik.ru) Date: Tue, 03 Mar 2020 15:26:21 +0300 Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: References: Message-ID: <19f72f6512ba71af46b24f57dfed0f57@scico.botik.ru> Thanks to people for help. So far I have an impression that this one is close to what it is needed: a Gtk2Hs library for GUI (graphical user interface), https://archives.haskell.org/code.haskell.org/gtk2hs/docs/tutorial/Tutorial_Port/ It has Appendix. Drawing with Cairo: Getting Started It reads the mouse movements converting it into a drawing, with saving a picture in the formats of pdf, png, svg, ... But I do not find there the possibility to save this drawing as a sequence of the coordinate pairs, pairs of numbers in a .txt file. It is evident that such a possibility can easily be provided. I look at its homepage http://projects.haskell.org/gtk2hs/ and wonder: where is any email address to ask this question about obtaining the coordinates. (?) Thanks, ------ Sergei On 2020-03-03 01:45, Branimir Maksimovic wrote: > Gtk? > > On 3/1/20 8:44 PM, mechvel at scico.botik.ru wrote: >> Please, >> >> does there exist a tool (library) in Haskell that supports doing the >> following >> with graphics? >> >> (1) To draw a curve by mouse on a screen and save this picture in a >> file >>     (many different curves to be input this way). >> (2) To save in  data.txt  the coordinates of the points of this curve, >>     say, 800 pairs of numbers (floating point or rational ...). >> (3) Reversely: to draw a curve on a screen by inputting from such >> data.txt. >> >> The main is (1)&(2). Because currently I set a curve by putting many >> times the >> '*' character and `space' to a text file, and this takes long. >> >> Thanks, >> >> ------ >> Sergei >> >> _______________________________________________ >> 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 amindfv at gmail.com Tue Mar 3 12:46:32 2020 From: amindfv at gmail.com (amindfv at gmail.com) Date: Tue, 3 Mar 2020 07:46:32 -0500 Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: References: Message-ID: Hoodle is a program that does items 1-3, though you have to work in its file format. > El 1 mar 2020, a las 14:44, mechvel at scico.botik.ru escribió: > > Please, > > does there exist a tool (library) in Haskell that supports doing the following > with graphics? > > (1) To draw a curve by mouse on a screen and save this picture in a file > (many different curves to be input this way). > (2) To save in data.txt the coordinates of the points of this curve, > say, 800 pairs of numbers (floating point or rational ...). > (3) Reversely: to draw a curve on a screen by inputting from such data.txt. > > The main is (1)&(2). Because currently I set a curve by putting many times the > '*' character and `space' to a text file, and this takes long. > > Thanks, > > ------ > Sergei > > _______________________________________________ > 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 allbery.b at gmail.com Tue Mar 3 12:44:59 2020 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 3 Mar 2020 07:44:59 -0500 Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: <19f72f6512ba71af46b24f57dfed0f57@scico.botik.ru> References: <19f72f6512ba71af46b24f57dfed0f57@scico.botik.ru> Message-ID: gtk2hs is a dead project, gi is its successor. I don't know if it has similar examples. On Tue, Mar 3, 2020 at 7:27 AM wrote: > Thanks to people for help. > > So far I have an impression that this one is close to what it is needed: > > a Gtk2Hs library for GUI (graphical user interface), > > > > https://archives.haskell.org/code.haskell.org/gtk2hs/docs/tutorial/Tutorial_Port/ > > It has > Appendix. Drawing with Cairo: Getting Started > > It reads the mouse movements converting it into a drawing, with saving a > picture in > the formats of pdf, png, svg, ... > > But I do not find there the possibility to save this drawing as a > sequence of the > coordinate pairs, pairs of numbers in a .txt file. > It is evident that such a possibility can easily be provided. > > I look at its homepage http://projects.haskell.org/gtk2hs/ > > and wonder: where is any email address to ask this question about > obtaining the > coordinates. > (?) > > Thanks, > > ------ > Sergei > > > > On 2020-03-03 01:45, Branimir Maksimovic wrote: > > Gtk? > > > > On 3/1/20 8:44 PM, mechvel at scico.botik.ru wrote: > >> Please, > >> > >> does there exist a tool (library) in Haskell that supports doing the > >> following > >> with graphics? > >> > >> (1) To draw a curve by mouse on a screen and save this picture in a > >> file > >> (many different curves to be input this way). > >> (2) To save in data.txt the coordinates of the points of this curve, > >> say, 800 pairs of numbers (floating point or rational ...). > >> (3) Reversely: to draw a curve on a screen by inputting from such > >> data.txt. > >> > >> The main is (1)&(2). Because currently I set a curve by putting many > >> times the > >> '*' character and `space' to a text file, and this takes long. > >> > >> Thanks, > >> > >> ------ > >> Sergei > >> > >> _______________________________________________ > >> 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. -- brandon s allbery kf8nh allbery.b at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mechvel at scico.botik.ru Tue Mar 3 17:14:44 2020 From: mechvel at scico.botik.ru (mechvel at scico.botik.ru) Date: Tue, 03 Mar 2020 20:14:44 +0300 Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: References: <19f72f6512ba71af46b24f57dfed0f57@scico.botik.ru> Message-ID: On 2020-03-03 15:44, Brandon Allbery wrote: > gtk2hs is a dead project, gi is its successor. I don't know if it has > similar examples. * Still Gtk2Hs does no seem to provide an interface mouse-drawn curve <--> coordinate list, * I do not see a Manual on gi or Gtk or Hoodle, * Detexity does not look like a free tool (?). So, it looks like I have to use a Python script for the needed interface, while the main program being written in Haskell. ------ Sergei >> On 2020-03-03 01:45, Branimir Maksimovic wrote: >>> Gtk? >>> >>> On 3/1/20 8:44 PM, mechvel at scico.botik.ru wrote: >>>> Please, >>>> >>>> does there exist a tool (library) in Haskell that supports doing >> the >>>> following >>>> with graphics? >>>> >>>> (1) To draw a curve by mouse on a screen and save this picture in >> a >>>> file >>>> (many different curves to be input this way). >>>> (2) To save in data.txt the coordinates of the points of this >> curve, >>>> say, 800 pairs of numbers (floating point or rational ...). >>>> (3) Reversely: to draw a curve on a screen by inputting from such >> >>>> data.txt. >>>> >>>> The main is (1)&(2). Because currently I set a curve by putting >> many >>>> times the >>>> '*' character and `space' to a text file, and this takes long. >>>> >>>> Thanks, >>>> >>>> ------ >>>> Sergei >>>> >>>> _______________________________________________ >>>> 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. > > -- > > brandon s allbery kf8nh > allbery.b at gmail.com From lemming at henning-thielemann.de Tue Mar 3 18:04:42 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Tue, 3 Mar 2020 19:04:42 +0100 (CET) Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: References: <19f72f6512ba71af46b24f57dfed0f57@scico.botik.ru> Message-ID: On Tue, 3 Mar 2020, mechvel at scico.botik.ru wrote: > On 2020-03-03 15:44, Brandon Allbery wrote: >> gtk2hs is a dead project, gi is its successor. I don't know if it has >> similar examples. > > > * Still Gtk2Hs does no seem to provide an interface > mouse-drawn curve <--> coordinate list, > * I do not see a Manual on gi or Gtk or Hoodle, > * Detexity does not look like a free tool (?). https://github.com/kirel/detexify I have not tried, but I guess that you could also do it with wxhaskell. From mechvel at scico.botik.ru Tue Mar 3 19:57:44 2020 From: mechvel at scico.botik.ru (mechvel at scico.botik.ru) Date: Tue, 03 Mar 2020 22:57:44 +0300 Subject: [Haskell-cafe] lib for drawing with mouse In-Reply-To: References: <19f72f6512ba71af46b24f57dfed0f57@scico.botik.ru> Message-ID: On 2020-03-03 21:04, Henning Thielemann wrote: > On Tue, 3 Mar 2020, mechvel at scico.botik.ru wrote: > >> On 2020-03-03 15:44, Brandon Allbery wrote: >>> gtk2hs is a dead project, gi is its successor. I don't know if it has >>> similar examples. >> >> >> * Still Gtk2Hs does no seem to provide an interface >> mouse-drawn curve <--> coordinate list, >> * I do not see a Manual on gi or Gtk or Hoodle, >> * Detexity does not look like a free tool (?). > > https://github.com/kirel/detexify Thank you for the references. I am sorry. It looks now that Detexify is free. > I have not tried, but I guess that you could also do it with wxhaskell. I do not see tutorials on Detexify nor on wxHaskell. But at least I see the web pages on these tools to where I just put my question. Thanks, ------ Sergei From jasonsychau at gmail.com Tue Mar 3 20:04:54 2020 From: jasonsychau at gmail.com (Jason Chau) Date: Tue, 3 Mar 2020 12:04:54 -0800 Subject: [Haskell-cafe] LF: senior Haskeller to be GSoC mentor Message-ID: Hi, I am looking for a someone who has a lot of Haskell, OS, networking, and databases experience and knowledge to be a mentor for Google Summer of Code. I need advise on best practises. The project URL is https://github.com/jasonsychau/graphql-w-persistent. Jason Sent from my iPhone From genaim at gmail.com Thu Mar 5 07:35:23 2020 From: genaim at gmail.com (Samir Genaim) Date: Thu, 5 Mar 2020 08:35:23 +0100 Subject: [Haskell-cafe] WST 2020 - 2nd Call for Papers Message-ID: ========================================================================== WST 2020 - Call for Papers 17th International Workshop on Termination http://costa.fdi.ucm.es/wst2020 June 29-30, 2020, Paris, France co-located with IJCAR and FSCD 2020. ========================================================================== The Workshop on Termination (WST) traditionally brings together, in an informal setting, researchers interested in all aspects of termination, whether this interest be practical or theoretical, primary or derived. The workshop also provides a ground for cross-fertilization of ideas from the different communities interested in termination (e.g., working on computational mechanisms, programming languages, software engineering, constraint solving, etc.). The friendly atmosphere enables fruitful exchanges leading to joint research and subsequent publications. The workshop is part of "Paris Nord Summer of LoVe 2020", a joint event on LOgic and VErification at Université Paris 13, made of Petri Nets 2020, IJCAR 2020, FSCD 2020, and over 20 satellite events. https://lipn.univ-paris13.fr/summer-of-love-2020/ IMPORTANT DATES: * submission deadline: April 12, 2020 * notification: May 10, 2020 * final version due: May 31, 2020 * workshop: June 29-30, 2020 TOPICS: The 17th International Workshop on Termination welcomes contributions on all aspects of termination. In particular, papers investigating applications of termination (for example in complexity analysis, program analysis and transformation, theorem proving, program correctness, modeling computational systems, etc.) are very welcome. Topics of interest include (but are not limited to): * abstraction methods in termination analysis * certification of termination and complexity proofs * challenging termination problems * comparison and classification of termination methods * complexity analysis in any domain * implementation of termination methods * non-termination analysis and loop detection * normalization and infinitary normalization * operational termination of logic-based systems * ordinal notation and subrecursive hierarchies * SAT, SMT, and constraint solving for (non-)termination analysis * scalability and modularity of termination methods * termination analysis in any domain (lambda calculus, declarative programming, rewriting, transition systems, etc.) * well-founded relations and well-quasi-orders COMPETITION: Since 2003, the catalytic effect of WST to stimulate new research on termination has been enhanced by the celebration of the Termination Competition and its continuously developing problem databases containing thousands of programs as challenges for termination analysis in different categories, see http://termination-portal.org/wiki/Termination_Competition In 2020, the Termination Competition will run shortly before WST and the main venues (IJCAR-FSCD), and the results will be presented at IJCAR or FSCD. PROGRAM COMMITTEE: Martin Avanzini - INRIA Sophia, Antipolis Florian Frohn - Max-Planck-Institut für Informatik, Saarbrücken Carsten Fuhs - Birkbeck, U. of London Samir Genaim (chair) - U. Complutense de Madrid Jürgen Giesl - RWTH Aachen Matthias Heizmann - U. of Freiburg Cynthia Kop - Radboud U. Nijmegen Salvador Lucas - U. Politècnica de València Étienne Payet - U. de La Réunion Albert Rubio - U. Complutense de Madrid René Thiemann - U. of Innsbruck Johannes Waldmann - HTWK Leipzig INVITED SPEAKERS: tba SUBMISSION: Submissions are short papers/extended abstracts which should not exceed 5 pages. There will be no formal reviewing. In particular, we welcome short versions of recently published articles and papers submitted elsewhere. The program committee checks relevance and provides additional feedback for each submission. The accepted papers will be made available electronically before the workshop. Papers should be submitted electronically via the submission page: https://easychair.org/conferences/?conf=wst2020 Please, use LaTeX and the LIPIcs style file http://drops.dagstuhl.de/styles/lipics/lipics-authors.tgz to prepare your submission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg.grenrus at iki.fi Fri Mar 6 12:41:00 2020 From: oleg.grenrus at iki.fi (Oleg Grenrus) Date: Fri, 6 Mar 2020 14:41:00 +0200 Subject: [Haskell-cafe] ANN: latex-svg Message-ID: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> I occasionally write blog posts with some math. So far I have been using latex-formulae family of packages. This week Andres Löh asked whether LaTeX can be rendered as SVGs. The answer turns out to be yes, it wasn't few years ago. The preview CTAN package, and the dvisvgm tool make it very easy. I forked latex-formulae into latex-svg to use above mentioned tools. There are three packages on Hackage now: - latex-svg-image: render LaTeX formulae to SVG images - latex-svg-pandoc: render LaTeX formulae in pandoc documents - latex-svg-hakyll: render LaTeX formulae in hakyll pages To mention some differences between latex-formulae and latex-svg: - latex-svg-image uses only latex and dvisvgm, ImageMagick is not required. You don't need to tweak policy.xml to allow rasterization of PostScript. (See this StackOverflow question). - latex-svg-image supports global cache (off by default), which speedups hakyll site builds. My blog builds in 20 seconds instead of three minutes with empty cache. I wouldn't worry about space usage too much, the cache contents take 15M after building my blog. which is way less than the size of site executable. - latex-svg-hakyll has initFormulaCompilerSVGPure variant, which doesn't need IO to be created. You don't need to thread renderFormulae function through. Together with global cache, the perfomance penalty is small. - One drawback is that result pages become bigger (and slower). For example a formula-heavy https://oleg.fi/gists/posts/2018-12-12-find-correct-laws.html is     - 576k in size with latex-formulae     - 2819k in size with latex-svg (almost 5 times larger).   Rendering SVG images is also more CPU expensive. Otherwise the API and module names are the same. If you are already a user of latex-formulae you can easily migrate to latex-svg. See the announcement blog post how some examples look like: https://oleg.fi/gists/posts/2020-03-06-latex-svg.html Crisp math-blogging to everyone - Oleg Grenrus From profunctor at pm.me Sun Mar 8 16:20:18 2020 From: profunctor at pm.me (Marcin Szamotulski) Date: Sun, 08 Mar 2020 16:20:18 +0000 Subject: [Haskell-cafe] [ANN] ghc-tag-plugin Message-ID: Hi, I wrote a GHC plugin which writes tags files. I've been proof testing it on a large code base where parts of it is using various type extensions, or formats (literate haskell, haskell, hsc files) - it works very well. Here's a blog post about it: https://coot.me/posts/ghc-tags-plugin.html And here's a very fresh hackage version 0.1.3.0: https://hackage.haskell.org/package/ghc-tags-plugin Best regards, Marcin Szamotulski -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 477 bytes Desc: OpenPGP digital signature URL: From jack at jackkelly.name Sun Mar 8 21:38:51 2020 From: jack at jackkelly.name (Jack Kelly) Date: Mon, 09 Mar 2020 07:38:51 +1000 Subject: [Haskell-cafe] [ANN] ghc-tag-plugin In-Reply-To: (Marcin Szamotulski via Haskell-Cafe's message of "Sun, 08 Mar 2020 16:20:18 +0000") References: Message-ID: <87d09mwmqc.fsf@jackkelly.name> Marcin Szamotulski via Haskell-Cafe writes: > I wrote a GHC plugin which writes tags files. I've been proof testing > it on a large code base where parts of it is using various type > extensions, or formats (literate haskell, haskell, hsc files) - it > works very well. This looks really neat. I'm not familiar with GHC's plugin system; does this mean that with this enabled, ghcid will also maintain the tags table as it reloads files? -- Jack From profunctor at pm.me Mon Mar 9 18:08:30 2020 From: profunctor at pm.me (Marcin Szamotulski) Date: Mon, 09 Mar 2020 18:08:30 +0000 Subject: [Haskell-cafe] [ANN] ghc-tag-plugin In-Reply-To: <87d09mwmqc.fsf@jackkelly.name> References: <87d09mwmqc.fsf@jackkelly.name> Message-ID: Yes, indeed - which is really neat. -- Marcin ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Sunday, March 8, 2020 10:38 PM, Jack Kelly wrote: > Marcin Szamotulski via Haskell-Cafe haskell-cafe at haskell.org writes: > > > I wrote a GHC plugin which writes tags files. I've been proof testing > > it on a large code base where parts of it is using various type > > extensions, or formats (literate haskell, haskell, hsc files) - it > > works very well. > > This looks really neat. I'm not familiar with GHC's plugin system; does > this mean that with this enabled, ghcid will also maintain the tags > table as it reloads files? > > -- Jack -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 477 bytes Desc: OpenPGP digital signature URL: From nutr1t07 at outlook.com Tue Mar 10 02:30:40 2020 From: nutr1t07 at outlook.com (Nutr1t07) Date: Tue, 10 Mar 2020 10:30:40 +0800 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault Message-ID: Hi, I added '-optl-static' in GHC option to make my program compiled statically. When I compiled the following code using 'stack build': -- Main.hs {-# LANGUAGE OverloadedStrings #-} module Main where import Web.Scotty                     as Scotty import Network.Wreq                as Wreq import Control.Monad.IO.Class main :: IO () main = scotty 8443 $ do   Scotty.get (literal "/") $ do     _ <- liftIO $ Wreq.get "https://www.google.com/"     html "Could not see this" -- Ran the compiled program and accessing "http://localhost:8443" would raise a segmentation fault. Here are what in my 'ghc-option':     ghc-options:     - -optl-static     - -threaded     - -rtsopts     - -with-rtsopts=-N Then I removed the '-optl-static', compiled it, and the program ran well. It seems that it something has to do with glibc. What can I do with this problem? Regards PS. I'm using GHC 8.8.2, stack 2.1.3 From vamchale at gmail.com Tue Mar 10 03:24:28 2020 From: vamchale at gmail.com (Vanessa McHale) Date: Mon, 9 Mar 2020 22:24:28 -0500 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: References: Message-ID: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> I’ve run into that before; I think it arises because you can’t link statically against libc? In any case, trying to use network code fails with a segfault. I think it is hard to work around; you need to build GHC against musl and then use that to compile your program. Cheers, Vanessa > On Mar 9, 2020, at 9:32 PM, Nutr1t07 wrote: > > Hi, > > I added '-optl-static' in GHC option to make my program compiled statically. When I compiled the following code using 'stack build': > > -- Main.hs > > {-# LANGUAGE OverloadedStrings #-} > module Main where > > import Web.Scotty as Scotty > import Network.Wreq as Wreq > import Control.Monad.IO.Class > > main :: IO () > main = scotty 8443 $ do > Scotty.get (literal "/") $ do > _ <- liftIO $ Wreq.get "https://www.google.com/" > html "Could not see this" > > -- > > Ran the compiled program and accessing "http://localhost:8443" would raise a segmentation fault. > > Here are what in my 'ghc-option': > > ghc-options: > - -optl-static > - -threaded > - -rtsopts > - -with-rtsopts=-N > > Then I removed the '-optl-static', compiled it, and the program ran well. > > It seems that it something has to do with glibc. What can I do with this problem? > > Regards > > PS. I'm using GHC 8.8.2, stack 2.1.3 > > _______________________________________________ > 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 nutr1t07 at outlook.com Tue Mar 10 05:10:07 2020 From: nutr1t07 at outlook.com (Nutr1t07) Date: Tue, 10 Mar 2020 13:10:07 +0800 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> References: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> Message-ID: It's pretty weird that program compiled with '-optl-static' runs just well on my server Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-48-generic x86_64), but failed running on my PC Archlinux (x86_64 Linux 5.5.8-arch1-1). Since there are static compiling problems with glibc, why is the GHC in stack is still built with ghlic instead of musl? On 3/10/20 11:24 AM, Vanessa McHale wrote: > I’ve run into that before; I think it arises because you can’t link statically against libc? In any case, trying to use network code fails with a segfault. > > I think it is hard to work around; you need to build GHC against musl and then use that to compile your program. > > Cheers, > Vanessa > >> On Mar 9, 2020, at 9:32 PM, Nutr1t07 wrote: >> >> Hi, >> >> I added '-optl-static' in GHC option to make my program compiled statically. When I compiled the following code using 'stack build': >> >> -- Main.hs >> >> {-# LANGUAGE OverloadedStrings #-} >> module Main where >> >> import Web.Scotty as Scotty >> import Network.Wreq as Wreq >> import Control.Monad.IO.Class >> >> main :: IO () >> main = scotty 8443 $ do >> Scotty.get (literal "/") $ do >> _ <- liftIO $ Wreq.get "https://www.google.com/" >> html "Could not see this" >> >> -- >> >> Ran the compiled program and accessing "http://localhost:8443" would raise a segmentation fault. >> >> Here are what in my 'ghc-option': >> >> ghc-options: >> - -optl-static >> - -threaded >> - -rtsopts >> - -with-rtsopts=-N >> >> Then I removed the '-optl-static', compiled it, and the program ran well. >> >> It seems that it something has to do with glibc. What can I do with this problem? >> >> Regards >> >> PS. I'm using GHC 8.8.2, stack 2.1.3 >> >> _______________________________________________ >> 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 vados+haskell-cafe at vadosware.io Tue Mar 10 05:29:16 2020 From: vados+haskell-cafe at vadosware.io (Victor Adossi) Date: Tue, 10 Mar 2020 14:29:16 +0900 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: References: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> Message-ID: <99784128-738e-5171-1e38-637871659522@vadosware.io> While I also like static binaries, most people do not necessarily need or want them -- changing the default for GHC to be built with musl would be a huge risk, IMO. More concretely, while GHC has a maintained alpine linux package (which is based on musl), stack does not -- see https://github.com/commercialhaskell/stack/issues/2387. I've written about it a little bit (https://vadosware.io/post/static-binaries-for-haskell-a-convoluted-approach/), the post is quite old so things have likely shifted. Static linking for programs in linux is surprisingly hard (but possible with some caveats), even when you get a library linked with musl (or some other small libc) you often need to ensure that libnss is available if you're going to do dns resolutions. One alternative that looks viable is nsss (https://skarnet.org/software/nsss), but I've never actually used it -- other languages like rust and go get around this by offering domain name resolution at the language level (https://doc.rust-lang.org/std/net/trait.ToSocketAddrs.html, https://golang.org/pkg/net/#hdr-Name_Resolution). I'm not entirely sure how easy this would be to do with haskell -- is the move to make a haskell binding to nsss then using that? How easy is it to write a haskell library that will include the relevant headers that make nsss go? Here's the quick rundown on how one uses nsss: > Application programs can use the internal API directly, or the prefixed nsss_ functions directly. Most programs, however, will simply use the standard pwd.h , grp.h or shadow.h interfaces. nsss provides a version of these standard headers: if an application is built with these headers, then getpwnam() will automatically be aliased to nsss_all_getpwnam(), and the other functions will be aliased similarly. Also, a cabal-based workflow might be better for building static haskell binaries -- it's normally included with containers that have the toolchain set up already like https://github.com/utdemir/ghc-musl (but as I mentioned earlier, stack is not). I *think* you could somewhat easily get stack to build a musl derived binary by using the stack docker integration (https://docs.haskellstack.org/en/stable/docker_integration/) -- again, I haven't tried this but it'd be a good subject of a blog post at some point. Victor On 3/10/20 2:10 PM, Nutr1t07 wrote: > It's pretty weird that program compiled with '-optl-static' runs just > well on my server Ubuntu 18.04.2 LTS (GNU/Linux 4.15.0-48-generic > x86_64), but failed running on my PC Archlinux (x86_64 Linux > 5.5.8-arch1-1). > > Since there are static compiling problems with glibc, why is the GHC > in stack is still built with ghlic instead of musl? > > On 3/10/20 11:24 AM, Vanessa McHale wrote: >> I’ve run into that before; I think it arises because you can’t link >> statically against libc? In any case, trying to use network code >> fails with a segfault. >> >> I think it is hard to work around; you need to build GHC against musl >> and then use that to compile your program. >> >> Cheers, >> Vanessa >> >>> On Mar 9, 2020, at 9:32 PM, Nutr1t07 wrote: >>> >>> Hi, >>> >>> I added '-optl-static' in GHC option to make my program compiled >>> statically. When I compiled the following code using 'stack build': >>> >>> -- Main.hs >>> >>> {-# LANGUAGE OverloadedStrings #-} >>> module Main where >>> >>> import Web.Scotty                     as Scotty >>> import Network.Wreq                as Wreq >>> import Control.Monad.IO.Class >>> >>> main :: IO () >>> main = scotty 8443 $ do >>>    Scotty.get (literal "/") $ do >>>      _ <- liftIO $ Wreq.get "https://www.google.com/" >>>      html "Could not see this" >>> >>> -- >>> >>> Ran the compiled program and accessing "http://localhost:8443" would >>> raise a segmentation fault. >>> >>> Here are what in my 'ghc-option': >>> >>>      ghc-options: >>>      - -optl-static >>>      - -threaded >>>      - -rtsopts >>>      - -with-rtsopts=-N >>> >>> Then I removed the '-optl-static', compiled it, and the program ran >>> well. >>> >>> It seems that it something has to do with glibc. What can I do with >>> this problem? >>> >>> Regards >>> >>> PS. I'm using GHC 8.8.2, stack 2.1.3 >>> >>> _______________________________________________ >>> 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 branimir.maksimovic at gmail.com Tue Mar 10 06:57:24 2020 From: branimir.maksimovic at gmail.com (Branimir Maksimovic) Date: Tue, 10 Mar 2020 07:57:24 +0100 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> References: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> Message-ID: <14a367f8-88ac-2619-d19f-04075aa0af6e@gmail.com> On 3/10/20 4:24 AM, Vanessa McHale wrote: > I’ve run into that before; I think it arises because you can’t link statically against libc? Correct, that is why I use musl for that... > In any case, trying to use network code fails with a segfault. > > I think it is hard to work around; you need to build GHC against musl and then use that to compile your program. > > Cheers, > Vanessa > >> On Mar 9, 2020, at 9:32 PM, Nutr1t07 wrote: >> >> Hi, >> >> I added '-optl-static' in GHC option to make my program compiled statically. When I compiled the following code using 'stack build': >> >> -- Main.hs >> >> {-# LANGUAGE OverloadedStrings #-} >> module Main where >> >> import Web.Scotty as Scotty >> import Network.Wreq as Wreq >> import Control.Monad.IO.Class >> >> main :: IO () >> main = scotty 8443 $ do >> Scotty.get (literal "/") $ do >> _ <- liftIO $ Wreq.get "https://www.google.com/" >> html "Could not see this" >> >> -- >> >> Ran the compiled program and accessing "http://localhost:8443" would raise a segmentation fault. >> >> Here are what in my 'ghc-option': >> >> ghc-options: >> - -optl-static >> - -threaded >> - -rtsopts >> - -with-rtsopts=-N >> >> Then I removed the '-optl-static', compiled it, and the program ran well. >> >> It seems that it something has to do with glibc. What can I do with this problem? >> >> Regards >> >> PS. I'm using GHC 8.8.2, stack 2.1.3 >> >> _______________________________________________ >> 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 mail at nh2.me Tue Mar 10 09:07:20 2020 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Tue, 10 Mar 2020 10:07:20 +0100 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> References: <4BC862E2-54A5-45CF-8EA6-E72E502DD847@gmail.com> Message-ID: <04a3f62b-3ee1-e12a-d1b9-60489b631495@nh2.me> On 3/10/20 4:24 AM, Vanessa McHale wrote: > I’ve run into that before; I think it arises because you can’t link statically against libc? In any case, trying to use network code fails with a segfault. Just for clarity, this is a slightly incorrect wording: It should be "libc" -> "glibc". Other libcs (like musl) are perfectly happy to be statically linked against. From mail at nh2.me Tue Mar 10 09:21:33 2020 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Tue, 10 Mar 2020 10:21:33 +0100 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: References: Message-ID: Hi, > It seems that it something has to do with glibc. What can I do with this problem? that's right, you cannot statically link against glibc, especially not networking code, without getting crashes. Your specific issue is described on: https://github.com/nh2/static-haskell-nix/issues/17 Check out https://github.com/nh2/static-haskell-nix/#static-haskell-nix for the background and more information of how you can link statically correctly. Your current 2 choices are this (static-haskell-nix), and building in an Alpine docker container. * Stack+Docker is conceptually easier, but makes you dependent on good support for the Haskell ecosystem in Alpine, which sometimes breaks (and it is only partially under our control to fix it). * static-haskell-nix requires you to learn some nix, but allows you to override any (system) package so you have control to fix things in case things do not work (for example, if some system package is compiled without .a files you need for static linking). Finally, don't hesitate to ask me anything about it; I have spent multiple hundreds of hours on statically linking Haskell :) Niklas From nutr1t07 at outlook.com Tue Mar 10 10:29:15 2020 From: nutr1t07 at outlook.com (Nutr1t07) Date: Tue, 10 Mar 2020 18:29:15 +0800 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: References: Message-ID: Much thanks to /Niklas Hambüchen/, /Victor Adossi/ and everyone who helped me! I'm now using "Stack+Docker"(thanks to https://github.com/utdemir/ghc-musl) way to statically compile the code, and it looks just work as expect! I have also seen static-haskell-nix and it looks awesome but I don't know how to use nix yet so I think I should use the approach above temporarily util I learn nix or another problem arise. Thank you, Nutr1t07 -------------- next part -------------- An HTML attachment was scrubbed... URL: From nutr1t07 at outlook.com Wed Mar 11 00:38:16 2020 From: nutr1t07 at outlook.com (Nutr1t07) Date: Wed, 11 Mar 2020 08:38:16 +0800 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: References: Message-ID: Hi, On 3/10/20 5:21 PM, Niklas Hambüchen wrote: > that's right, you cannot statically link against glibc, especially not networking code, without getting crashes. Sorry to mention again, but I wonder why cannot link *especially networking code*? Because if I remove the networking part of my codes it seems to run well. From jack at jackkelly.name Wed Mar 11 02:06:16 2020 From: jack at jackkelly.name (Jack Kelly) Date: Wed, 11 Mar 2020 12:06:16 +1000 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: (Nutr1t's message of "Wed, 11 Mar 2020 08:38:16 +0800") References: Message-ID: <871rpzve5j.fsf@jackkelly.name> Nutr1t07 writes: > On 3/10/20 5:21 PM, Niklas Hambüchen wrote: >> that's right, you cannot statically link against glibc, especially not networking code, without getting crashes. > Sorry to mention again, but I wonder why cannot link *especially > networking code*? Because if I remove the networking part of my codes > it seems to run well. It's because glibc's NSS (name service switch) relies on dynamic linking whatever you do. https://stackoverflow.com/questions/3430400/linux-static-linking-is-dead See also `info libc "Name Service Switch"` on a system with texinfo installed, or the corresponding node in the glibc documentation online. -- Jack From michael at orlitzky.com Wed Mar 11 03:05:09 2020 From: michael at orlitzky.com (Michael Orlitzky) Date: Tue, 10 Mar 2020 23:05:09 -0400 Subject: [Haskell-cafe] ANN: latex-svg In-Reply-To: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> References: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> Message-ID: <1c51cf4b-80bb-70c1-888e-ab71e0f6bdc0@orlitzky.com> On 3/6/20 7:41 AM, Oleg Grenrus wrote: > > - One drawback is that result pages become bigger (and slower). For > example a formula-heavy > https://oleg.fi/gists/posts/2018-12-12-find-correct-laws.html is > >     - 576k in size with latex-formulae >     - 2819k in size with latex-svg (almost 5 times larger). > >   Rendering SVG images is also more CPU expensive. > I've been looking for a way to do away with MathJax for a while, and this is pretty cool. I know this is probably tricky to do in Hakyll, but you might be able to address the page-size issue by saving the SVG files externally and gzipping them. That would also get rid of some of the XHTML strict warnings (like the duplicate id="page1"). From mail at nh2.me Wed Mar 11 11:11:55 2020 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Wed, 11 Mar 2020 12:11:55 +0100 Subject: [Haskell-cafe] Using GHC option '-optl-static' causes segfault In-Reply-To: <871rpzve5j.fsf@jackkelly.name> References: <871rpzve5j.fsf@jackkelly.name> Message-ID: <01adfcb4-2dd5-b4d7-6d59-f6bec891805e@nh2.me> On 3/11/20 3:06 AM, Jack Kelly wrote:> It's because glibc's NSS (name service switch) relies on dynamic linking > whatever you do. > > https://stackoverflow.com/questions/3430400/linux-static-linking-is-dead Another similar explanation into the same direction: https://stackoverflow.com/questions/57476533/why-is-statically-linking-glibc-discouraged/57478728#57478728 From oleg.grenrus at iki.fi Wed Mar 11 11:23:54 2020 From: oleg.grenrus at iki.fi (Oleg Grenrus) Date: Wed, 11 Mar 2020 13:23:54 +0200 Subject: [Haskell-cafe] ANN: latex-svg In-Reply-To: <1c51cf4b-80bb-70c1-888e-ab71e0f6bdc0@orlitzky.com> References: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> <1c51cf4b-80bb-70c1-888e-ab71e0f6bdc0@orlitzky.com> Message-ID: <028550a4-706c-3ac9-74a1-11e9f9f0eeb6@iki.fi> Hi Michael, thanks for the reply. In my blog I use mod_deflate (Transfer-Encoding: gzip), and the result is Uncompressed Page Size: 2392.6 KB Compressed Page Size: 806.5 KB Savings: 66.3% (I tweaked parameters for dvisvgm, so uncompressed size went down too). The overall gzipping is quite good and easy solution, basically adding AddOutputFilterByType DEFLATE text/html to .htaccess for Apache. --- Good that you pointed out ``; that id is unnecessary, and I should strip it off. It does not add any value. --- About saving images as external files, Hakyll does support such functionality: https://groups.google.com/forum/#!topic/hakyll/vQpijNtTG5M The latex-formulae-hakyll (and therefore latex-svg-hakyll) has internal to do note to add support for storing files externally, which is doable using Hakyll metacompilers. One can name files using hash of their contents. That is a feature waiting to be done. --- I opened issues to remember these issues, but I cannot promise to work on them (especially second one) any time soon. - https://github.com/phadej/latex-svg/issues/2 - https://github.com/phadej/latex-svg/issues/3 Best regards, Oleg Grenrus On 11.3.2020 5.05, Michael Orlitzky wrote: > On 3/6/20 7:41 AM, Oleg Grenrus wrote: >> - One drawback is that result pages become bigger (and slower). For >> example a formula-heavy >> https://oleg.fi/gists/posts/2018-12-12-find-correct-laws.html is >> >>     - 576k in size with latex-formulae >>     - 2819k in size with latex-svg (almost 5 times larger). >> >>   Rendering SVG images is also more CPU expensive. >> > I've been looking for a way to do away with MathJax for a while, and > this is pretty cool. I know this is probably tricky to do in Hakyll, but > you might be able to address the page-size issue by saving the SVG files > externally and gzipping them. That would also get rid of some of the > XHTML strict warnings (like the duplicate id="page1"). > _______________________________________________ > 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 michael at orlitzky.com Thu Mar 12 15:21:07 2020 From: michael at orlitzky.com (Michael Orlitzky) Date: Thu, 12 Mar 2020 11:21:07 -0400 Subject: [Haskell-cafe] ANN: latex-svg In-Reply-To: <028550a4-706c-3ac9-74a1-11e9f9f0eeb6@iki.fi> References: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> <1c51cf4b-80bb-70c1-888e-ab71e0f6bdc0@orlitzky.com> <028550a4-706c-3ac9-74a1-11e9f9f0eeb6@iki.fi> Message-ID: <6a4c7204-effc-58f4-66a1-31d40e0667b4@orlitzky.com> On 3/11/20 7:23 AM, Oleg Grenrus wrote: > Hi Michael, > > thanks for the reply. In my blog I use mod_deflate (Transfer-Encoding: > gzip), and the result is > > Uncompressed Page Size: 2392.6 KB > Compressed Page Size: 806.5 KB > Savings: 66.3% > That would actually work great on my static site, but for example we have mod_deflate disabled at work to mitigate the BREACH attacks in the thousands of random copy & pasted javascript/PHP libraries that constitute "web development" these days. I'm glad to hear the compression brings things back down to a reasonable size, though. > I opened issues to remember these issues, but I cannot promise to work > on them (especially second one) any time soon. > - https://github.com/phadej/latex-svg/issues/2 > - https://github.com/phadej/latex-svg/issues/3 Thanks! I'll keep an eye on them. From mightybyte at gmail.com Thu Mar 12 18:53:11 2020 From: mightybyte at gmail.com (MightyByte) Date: Thu, 12 Mar 2020 18:53:11 +0000 Subject: [Haskell-cafe] ANNOUNCE: Save the date! Compose Conference 2020 colocated with ICFP Message-ID: We are excited to announce that the Compose Conference will be colocated with ICFP this year. Compose will be Thursday and Friday August 20 and 21 at the NJCU School of Business, a short subway / bus ride from Manhattan. The Compose Unconference will be Saturday and Sunday August 22 and 23 at Microsoft in Times Square. Regarding COVID-19, the Compose Team is closely monitoring the situation and are prepared to make responsible decisions if it comes to that. That being said, the situation will undoubtedly evolve a lot between now and August. We have been very excited about the collaboration between Compose and ICFP and wanted to get an announcement out so that if the conferences do happen as planned everyone is aware. A more detailed announcement will be coming when we have more confirmed details, but if you are already planning to attend ICFP, consider extending your trip by a few days and coming to Compose as well. To get a sense of Compose, you can check out the great talks from past conferences and the Compose Conference website: https://www.youtube.com/channel/UC0pEknZxL7Q1j0Ok8qImWdQ http://www.composeconference.org/ We look forward to seeing you! The Compose Conference Team Sent via Superhuman ( https://sprh.mn/?vip=mightybyte at gmail.com ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From emilypi at cohomolo.gy Thu Mar 12 21:21:55 2020 From: emilypi at cohomolo.gy (Emily Pillmore) Date: Thu, 12 Mar 2020 21:21:55 +0000 Subject: [Haskell-cafe] ANNOUNCE: Save the date! Compose Conference 2020 colocated with ICFP In-Reply-To: References: Message-ID: Compose *and* ICFP co-located? Count me in! On Thu, Mar 12, 2020 at 2:53 PM, MightyByte < mightybyte at gmail.com > wrote: > > We are excited to announce that the Compose Conference will be colocated > with ICFP this year. Compose will be Thursday and Friday August 20 and 21 > at the NJCU School of Business, a short subway / bus ride from Manhattan. > The Compose Unconference will be Saturday and Sunday August 22 and 23 at > Microsoft in Times Square. > > > > Regarding COVID-19, the Compose Team is closely monitoring the situation > and are prepared to make responsible decisions if it comes to that. That > being said, the situation will undoubtedly evolve a lot between now and > August. We have been very excited about the collaboration between Compose > and ICFP and wanted to get an announcement out so that if the conferences > do happen as planned everyone is aware. > > > > A more detailed announcement will be coming when we have more confirmed > details, but if you are already planning to attend ICFP, consider > extending your trip by a few days and coming to Compose as well. To get a > sense of Compose, you can check out the great talks from past conferences > and the Compose Conference website: > > > > https:/ / www. youtube. com/ channel/ UC0pEknZxL7Q1j0Ok8qImWdQ ( > https://www.youtube.com/channel/UC0pEknZxL7Q1j0Ok8qImWdQ ) > > http:/ / www. composeconference. org/ ( http://www.composeconference.org/ ) > > > > > We look forward to seeing you! > > > > The Compose Conference Team > > > Sent via Superhuman ( https://sprh.mn/?vip=mightybyte at gmail.com ) > > > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: http:/ / mail. haskell. > org/ cgi-bin/ mailman/ listinfo/ haskell-cafe ( > 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 capn.freako at gmail.com Fri Mar 13 22:56:55 2020 From: capn.freako at gmail.com (David Banas) Date: Fri, 13 Mar 2020 15:56:55 -0700 Subject: [Haskell-cafe] Calling a State Monad recursively from within a let-block, via runState? Message-ID: <37D551FB-9943-4743-96BB-614EB5E85667@gmail.com> Can I call a State Monad recursively from within a let-block, via `runState`, or is that going way out of bounds? -db From juan.casanova at ed.ac.uk Fri Mar 13 23:00:42 2020 From: juan.casanova at ed.ac.uk (Juan Casanova) Date: Fri, 13 Mar 2020 23:00:42 +0000 Subject: [Haskell-cafe] Calling a State Monad recursively from within a let-block, via runState? In-Reply-To: <37D551FB-9943-4743-96BB-614EB5E85667@gmail.com> References: <37D551FB-9943-4743-96BB-614EB5E85667@gmail.com> Message-ID: <20200313230042.17894n121zc5edgg@www.staffmail.ed.ac.uk> I do this relatively often. I see the State monad as a convenient way to see the type (s -> (a,s)) that happens to have a monad instance. When the best way to make use of it is to go in and out of monad "mode", I do that. Quoting David Banas on Fri, 13 Mar 2020 15:56:55 -0700: > Can I call a State Monad recursively from within a let-block, via > `runState`, or is that going way out of bounds? > -db > > _______________________________________________ > 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. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From poscat at mail.poscat.moe Sun Mar 15 08:54:07 2020 From: poscat at mail.poscat.moe (Poscat) Date: Sun, 15 Mar 2020 16:54:07 +0800 Subject: [Haskell-cafe] ANN: latex-svg In-Reply-To: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> References: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> Message-ID: <161a4bc4-713d-94fc-2957-ffabdd843e0f@mail.poscat.moe> I wrote a package a month ago with the same name and does roughly the same XD (https://github.com/poscat0x04/latex-svg) Your package is definitely more polished. On 3/6/20 8:41 PM, Oleg Grenrus wrote: > I occasionally write blog posts with some math. So far I have been using > latex-formulae family of packages. This week Andres Löh asked whether > LaTeX can be rendered as SVGs. > > The answer turns out to be yes, it wasn't few years ago. > > The preview CTAN package, and the dvisvgm tool make it very easy. I > forked latex-formulae into latex-svg to use above mentioned tools. There > are three packages on Hackage now: > > - latex-svg-image: render LaTeX formulae to SVG images > - latex-svg-pandoc: render LaTeX formulae in pandoc documents > - latex-svg-hakyll: render LaTeX formulae in hakyll pages > > To mention some differences between latex-formulae and latex-svg: > > - latex-svg-image uses only latex and dvisvgm, ImageMagick is not > required. You don't need to tweak policy.xml to allow rasterization of > PostScript. (See this StackOverflow question). > > - latex-svg-image supports global cache (off by default), which speedups > hakyll site builds. My blog builds in 20 seconds instead of three > minutes with empty cache. I wouldn't worry about space usage too much, > the cache contents take 15M after building my blog. which is way less > than the size of site executable. > > - latex-svg-hakyll has initFormulaCompilerSVGPure variant, which doesn't > need IO to be created. You don't need to thread renderFormulae function > through. Together with global cache, the perfomance penalty is small. > > - One drawback is that result pages become bigger (and slower). For > example a formula-heavy > https://oleg.fi/gists/posts/2018-12-12-find-correct-laws.html is > >     - 576k in size with latex-formulae >     - 2819k in size with latex-svg (almost 5 times larger). > >   Rendering SVG images is also more CPU expensive. > > Otherwise the API and module names are the same. If you are already a > user of latex-formulae you can easily migrate to latex-svg. > > See the announcement blog post how some examples look like: > https://oleg.fi/gists/posts/2020-03-06-latex-svg.html > > > > Crisp math-blogging to everyone > > - Oleg Grenrus > > > > > _______________________________________________ > 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 compl.yue at icloud.com Sun Mar 15 11:20:43 2020 From: compl.yue at icloud.com (Compl Yue) Date: Sun, 15 Mar 2020 19:20:43 +0800 Subject: [Haskell-cafe] Data.Map - visiting tree nodes within a given key range ? Message-ID: Hello, I have a question regarding 'Data.Map' api, filed an issue https://github.com/haskell/containers/issues/708 And may be I can ask here at the same time? I'm not sure why|Data.Map|doesn't have a key range based visiting API, I figured out I can do it this way: |indexKeyRange :: IndexKey -> IndexKey -> Map IndexKey Object -> [(IndexKey, Object)] indexKeyRange !minKey !maxKey = toList . takeWhileAntitone (<= maxKey) . dropWhileAntitone (< minKey) | But wouldn't it save the computation needed to re-balance the intermediate tree generated ? Or that re-balancing can be optimized out actually ? I am creating an in-memory graph database, using|Data.Map.Strict.Map|as business object indices with specified object attributes. The typical scenario will be querying a small number of entries by key range, out of possibly all business objects of a certain class globally, so the implementation above would work, but not reasonable by far as it seems. I think a lazy list returned by mere node visiting (i.e. no new node creation) would satisfy my needs, or I missed something ? Thanks, Compl -------------- next part -------------- An HTML attachment was scrubbed... URL: From olf at aatal-apotheke.de Sun Mar 15 13:37:16 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Sun, 15 Mar 2020 14:37:16 +0100 Subject: [Haskell-cafe] Data.Map - visiting tree nodes withi a given key range ? Message-ID: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> You can roll your own indexKeyRange using the Data.Map.Internal module which exposes the (currently used) Map implementation. Also note that if the list of values in range is to be consumed immediately, you might want to go for a fold-based function: foldlWithRange :: (a -> k -> b -> a) -> (a,a) -> b -> Map k a -> b Olaf From david.feuer at gmail.com Sun Mar 15 13:49:08 2020 From: david.feuer at gmail.com (David Feuer) Date: Sun, 15 Mar 2020 09:49:08 -0400 Subject: [Haskell-cafe] Data.Map - visiting tree nodes within a given key range ? In-Reply-To: References: Message-ID: Yes, a custom-built fold would be a little faster in general, and significantly faster if the range only included a few elements. The challenge is that there are lots of such functions we could add, and it's not clear which would pay for their API clutter. Someone might want any combination of including and excluding each endpoint, with (at least) all the methods of Foldable and also a monomorphic traverse-like function. On Sun, Mar 15, 2020, 7:21 AM Compl Yue via Haskell-Cafe < haskell-cafe at haskell.org> wrote: > Hello, > > I have a question regarding 'Data.Map' api, filed an issue > https://github.com/haskell/containers/issues/708 > > And may be I can ask here at the same time? > > I'm not sure why Data.Map doesn't have a key range based visiting API, I > figured out I can do it this way: > > indexKeyRange > :: IndexKey -> IndexKey -> Map IndexKey Object -> [(IndexKey, Object)] > indexKeyRange !minKey !maxKey = > toList > . takeWhileAntitone (<= maxKey) > . dropWhileAntitone (< minKey) > > But wouldn't it save the computation needed to re-balance the intermediate > tree generated ? Or that re-balancing can be optimized out actually ? > > I am creating an in-memory graph database, using Data.Map.Strict.Map as > business object indices with specified object attributes. The typical > scenario will be querying a small number of entries by key range, out of > possibly all business objects of a certain class globally, so the > implementation above would work, but not reasonable by far as it seems. > > I think a lazy list returned by mere node visiting (i.e. no new node > creation) would satisfy my needs, or I missed something ? > > > Thanks, > > Compl > > > _______________________________________________ > 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 compl.yue at icloud.com Sun Mar 15 17:30:14 2020 From: compl.yue at icloud.com (Compl Yue) Date: Mon, 16 Mar 2020 01:30:14 +0800 Subject: [Haskell-cafe] Data.Map - visiting tree nodes withi a given key range ? In-Reply-To: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> References: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> Message-ID: <3e581890-d31f-9b47-b69b-2e5bba4a31e6@icloud.com> Thanks Olaf, Can you point me to the specific function for key range traversal? I went over the module doc for Data.Map.Internal and Data.Map.Strict.Internal twice, yet still don't get which one supposed to work for me, or I should ignore doc and look at the code instead ? And the values to be scanned in specific key range are going to be consumed by some CPS mutual iterator, so fold can't be used as I see it. Best regards, Compl On 2020/3/15 下午9:37, Olaf Klinke wrote: > You can roll your own indexKeyRange using the Data.Map.Internal module which exposes the (currently used) Map implementation. Also note that if the list of values in range is to be consumed immediately, you might want to go for a fold-based function: > > foldlWithRange :: (a -> k -> b -> a) -> (a,a) -> b -> Map k a -> b > > Olaf From olf at aatal-apotheke.de Sun Mar 15 18:42:44 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Sun, 15 Mar 2020 19:42:44 +0100 Subject: [Haskell-cafe] Data.Map - visiting tree nodes withi a given key range ? In-Reply-To: <3e581890-d31f-9b47-b69b-2e5bba4a31e6@icloud.com> References: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> <3e581890-d31f-9b47-b69b-2e5bba4a31e6@icloud.com> Message-ID: Dear Compl, there is no such function in the Data.Map.Internal module. You have to decompose the map structure yourself. import Data.Map.Internal -- name clash with Control.Monad when :: (Monoid b) => Bool -> b -> b when t b = if t then b else mempty contains :: Ord k => (k,k) -> k -> Bool contains (lbound,ubound) k = lbound <= k && k <= ubound foldRange :: (Monoid b, Ord k) => (a -> b) -> (k,k) -> Map k a -> b foldRange f range@(lbound,ubound) m = case m of Tip -> mempty (Bin _ k a left right) -> foldLeft <> this <> foldRight where foldLeft = when (lbound < k) (foldRange f range left) this = when (range `contains` k) (f a) foldRight = when (k < ubound) (foldRange f range right) -- verify that only the range is processed >>> let m = fromList $ zip [1..] [undefined,"bar","baz",undefined] >>> foldRange (\a -> [a]) (2,3) m ["bar","baz"] > Am 15.03.2020 um 18:30 schrieb Compl Yue : > > Thanks Olaf, > > Can you point me to the specific function for key range traversal? I went over the module doc for Data.Map.Internal and Data.Map.Strict.Internal twice, yet still don't get which one supposed to work for me, or I should ignore doc and look at the code instead ? > > And the values to be scanned in specific key range are going to be consumed by some CPS mutual iterator, so fold can't be used as I see it. > > Best regards, > > Compl > > > On 2020/3/15 下午9:37, Olaf Klinke wrote: >> You can roll your own indexKeyRange using the Data.Map.Internal module which exposes the (currently used) Map implementation. Also note that if the list of values in range is to be consumed immediately, you might want to go for a fold-based function: >> >> foldlWithRange :: (a -> k -> b -> a) -> (a,a) -> b -> Map k a -> b >> >> Olaf From olf at aatal-apotheke.de Sun Mar 15 19:46:30 2020 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Sun, 15 Mar 2020 20:46:30 +0100 Subject: [Haskell-cafe] Data.Map - visiting tree nodes withi a given key range ? In-Reply-To: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> References: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> Message-ID: <78A9E630-8438-4DC3-85D3-93643916F673@aatal-apotheke.de> By the way, there are tools to retrieve a certain range from compressed data, which IMHO is a very cool feature of gzip. https://www.htslib.org/doc/bgzip.html https://www.htslib.org/doc/tabix.html Bioinformaticians use it (among other things) for fast retrieval of genomic annotation from data sets with on the order of 10^9 keys (in case of human genome). Would be nice if someone wrote a Haskell binding. Olaf > Hello, > > I have a question regarding 'Data.Map' api, filed an issue > https://github.com/haskell/containers/issues/708 > > And may be I can ask here at the same time? > > I'm not sure why|Data.Map|doesn't have a key range based visiting API, I > figured out I can do it this way: > > |indexKeyRange :: IndexKey -> IndexKey -> Map IndexKey Object -> > [(IndexKey, Object)] indexKeyRange !minKey !maxKey = toList . > takeWhileAntitone (<= maxKey) . dropWhileAntitone (< minKey) | > > But wouldn't it save the computation needed to re-balance the > intermediate tree generated ? Or that re-balancing can be optimized out > actually ? > > I am creating an in-memory graph database, using|Data.Map.Strict.Map|as > business object indices with specified object attributes. The typical > scenario will be querying a small number of entries by key range, out of > possibly all business objects of a certain class globally, so the > implementation above would work, but not reasonable by far as it seems. > > I think a lazy list returned by mere node visiting (i.e. no new node > creation) would satisfy my needs, or I missed something ? > > > Thanks, > > Compl From compl.yue at icloud.com Mon Mar 16 06:02:40 2020 From: compl.yue at icloud.com (Compl Yue) Date: Mon, 16 Mar 2020 14:02:40 +0800 Subject: [Haskell-cafe] Data.Map - visiting tree nodes withi a given key range ? In-Reply-To: References: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> <3e581890-d31f-9b47-b69b-2e5bba4a31e6@icloud.com> Message-ID: Thanks so much Olaf! I think `foldRange` should already work for my case without concerns. And more importantly this example builds the intuition to get me started in touching Map internals, I was hesitating with fear before :p That said, I have another improvement postponed, which I assumed much tougher. That is fast re-indexing at the time some of a business object's key attributes change. I currently use another HashMap to associate the old IndexKey of an Object with itself, on re-indexing , I just lookup the old IndexKey from the HashMap, and delete the resulted key from the tree Map, before putting the Object with new IndexKey into tree Map. This works but not reasonably efficient. I have an idea in my mind that insertion operation into the tree Map could return a fast-entry-remover function with sufficient internal structure captured, so instead of going the O(log n) deletion by old key (also re-balancing effort to be added), this remover function can be reverse-lookup'ed by Object, then applied to have its rival entry removed from a later version of the tree Map. Yet better to upgrade the remover into a replacer, that inserts an entry with the new IndexKey of the Object in a single pass. Changing a later field on a multi-field index should produce the new IndexKey sufficiently nearer to the old key in tree Map's respect, so I expect amortized complexity to be greatly reduced, especially when the number of indexed objects is very large. A bit context for clarity: an Object value is identified by an embedded Data.Unique field, and has a mutable Control.Concurrent.STM.*TVar* pointer to its attributes. I'm not aware of existing codebase doing that, maybe I'll be extending Data.Map to do that, but it'll be excellent to hear about your insights about tackling this improvement. I still need to finish PoC of the dababase first, no hurry for performance improvement atm, as long as it's working correctly. Best regards, Compl On 2020/3/16 上午2:42, Olaf Klinke wrote: > Dear Compl, > > there is no such function in the Data.Map.Internal module. You have to decompose the map structure yourself. > > import Data.Map.Internal > > -- name clash with Control.Monad > when :: (Monoid b) => Bool -> b -> b > when t b = if t then b else mempty > > contains :: Ord k => (k,k) -> k -> Bool > contains (lbound,ubound) k = lbound <= k && k <= ubound > > foldRange :: (Monoid b, Ord k) => (a -> b) -> (k,k) -> Map k a -> b > foldRange f range@(lbound,ubound) m = case m of > Tip -> mempty > (Bin _ k a left right) -> foldLeft <> this <> foldRight where > foldLeft = when (lbound < k) (foldRange f range left) > this = when (range `contains` k) (f a) > foldRight = when (k < ubound) (foldRange f range right) > > -- verify that only the range is processed >>>> let m = fromList $ zip [1..] [undefined,"bar","baz",undefined] >>>> foldRange (\a -> [a]) (2,3) m > ["bar","baz"] > >> Am 15.03.2020 um 18:30 schrieb Compl Yue : >> >> Thanks Olaf, >> >> Can you point me to the specific function for key range traversal? I went over the module doc for Data.Map.Internal and Data.Map.Strict.Internal twice, yet still don't get which one supposed to work for me, or I should ignore doc and look at the code instead ? >> >> And the values to be scanned in specific key range are going to be consumed by some CPS mutual iterator, so fold can't be used as I see it. >> >> Best regards, >> >> Compl >> >> >> On 2020/3/15 下午9:37, Olaf Klinke wrote: >>> You can roll your own indexKeyRange using the Data.Map.Internal module which exposes the (currently used) Map implementation. Also note that if the list of values in range is to be consumed immediately, you might want to go for a fold-based function: >>> >>> foldlWithRange :: (a -> k -> b -> a) -> (a,a) -> b -> Map k a -> b >>> >>> Olaf -------------- next part -------------- An HTML attachment was scrubbed... URL: From compl.yue at icloud.com Mon Mar 16 09:51:05 2020 From: compl.yue at icloud.com (Compl Yue) Date: Mon, 16 Mar 2020 17:51:05 +0800 Subject: [Haskell-cafe] Data.Map - visiting tree nodes withi a given key range ? In-Reply-To: <78A9E630-8438-4DC3-85D3-93643916F673@aatal-apotheke.de> References: <3CD459E0-E8E1-459E-8CB4-487BE76B611A@aatal-apotheke.de> <78A9E630-8438-4DC3-85D3-93643916F673@aatal-apotheke.de> Message-ID: <095cbc70-cb47-93ab-574b-f4e65d6dff8f@icloud.com> Maybe off topic, my work environment deals with datasets sized 20~200 Giga Bytes, consisting of small time series arrays mostly, I offload the compression (and dedup) work to ZFS (by deploying a SmartOS storage server managing a dozen of spinning disks with several TB capacity. Many computing nodes run a local FUSE mount viewing those data files over network, as if being part of a virtual large data file in local filesystem, and access (mostly reads, small fraction of writes) the data via mmap. This way, parallel processes run on multi CPU cores of a single computing node share the OS' kernel page for cache of the dataset, a program just assumes random access to the whole dataset as available at somewhere within its virtual address space. Giving just enough physical RAM (in order to prevent thrashing) to the storage server and computing nodes (my env currently have a typical size of 128GB per node), this achieves both simplicity of programming and efficient use of processor/memory/storage resources. This architecture should scale well to datasets of a few TBs. On 2020/3/16 上午3:46, Olaf Klinke wrote: > By the way, there are tools to retrieve a certain range from compressed data, which IMHO is a very cool feature of gzip. > > https://www.htslib.org/doc/bgzip.html > https://www.htslib.org/doc/tabix.html > > Bioinformaticians use it (among other things) for fast retrieval of genomic annotation from data sets with on the order of 10^9 keys (in case of human genome). Would be nice if someone wrote a Haskell binding. > > Olaf > >> Hello, >> >> I have a question regarding 'Data.Map' api, filed an issue >> https://github.com/haskell/containers/issues/708 >> >> And may be I can ask here at the same time? >> >> I'm not sure why|Data.Map|doesn't have a key range based visiting API, I >> figured out I can do it this way: >> >> |indexKeyRange :: IndexKey -> IndexKey -> Map IndexKey Object -> >> [(IndexKey, Object)] indexKeyRange !minKey !maxKey = toList . >> takeWhileAntitone (<= maxKey) . dropWhileAntitone (< minKey) | >> >> But wouldn't it save the computation needed to re-balance the >> intermediate tree generated ? Or that re-balancing can be optimized out >> actually ? >> >> I am creating an in-memory graph database, using|Data.Map.Strict.Map|as >> business object indices with specified object attributes. The typical >> scenario will be querying a small number of entries by key range, out of >> possibly all business objects of a certain class globally, so the >> implementation above would work, but not reasonable by far as it seems. >> >> I think a lazy list returned by mere node visiting (i.e. no new node >> creation) would satisfy my needs, or I missed something ? >> >> >> Thanks, >> >> Compl From ben at well-typed.com Mon Mar 16 15:59:16 2020 From: ben at well-typed.com (Ben Gamari) Date: Mon, 16 Mar 2020 11:59:16 -0400 Subject: [Haskell-cafe] [HiW'20] Call for Talks Message-ID: <87blow8f57.fsf@smart-cactus.org> Hello everyone, Haskell Implementors Workshop is calling for talk proposals. Co-located with ICFP, HiW is an ideal place to describe a Haskell library, a Haskell extension, compiler, works-in-progress, demo a new Haskell-related tool, or even propose future lines of Haskell development. The deadline for submissions is July 2nd 2020. Call for Talks ============== The 12th Haskell Implementors’ Workshop is to be held alongside ICFP 2020 this year in New Jersey. It is a forum for people involved in the design and development of Haskell implementations, tools, libraries, and supporting infrastructure, to share their work and discuss future directions and collaborations with others. Talks and/or demos are proposed by submitting an abstract, and selected by a small program committee. There will be no published proceedings. The workshop will be informal and interactive, with open spaces in the timetable and room for ad-hoc discussion, demos and lightning talks. Scope and Target Audience ------------------------- It is important to distinguish the Haskell Implementors’ Workshop from the Haskell Symposium which is also co-located with ICFP 2020. The Haskell Symposium is for the publication of Haskell-related research. In contrast, the Haskell Implementors’ Workshop will have no proceedings – although we will aim to make talk videos, slides and presented data available with the consent of the speakers. The Implementors’ Workshop is an ideal place to describe a Haskell extension, describe works-in-progress, demo a new Haskell-related tool, or even propose future lines of Haskell development. Members of the wider Haskell community encouraged to attend the workshop – we need your feedback to keep the Haskell ecosystem thriving. Students working with Haskell are specially encouraged to share their work. The scope covers any of the following topics. There may be some topics that people feel we’ve missed, so by all means submit a proposal even if it doesn’t fit exactly into one of these buckets: - Compilation techniques - Language features and extensions - Type system implementation - Concurrency and parallelism: language design and implementation - Performance, optimization and benchmarking - Virtual machines and run-time systems - Libraries and tools for development or deployment Talks ----- We invite proposals from potential speakers for talks and demonstrations. We are aiming for 20-minute talks with 5 minutes for questions and changeovers. We want to hear from people writing compilers, tools, or libraries, people with cool ideas for directions in which we should take the platform, proposals for new features to be implemented, and half-baked crazy ideas. Please submit a talk title and abstract of no more than 300 words. Submissions can be made via HotCRP at https://icfp-hiw20.hotcrp.com/ until July 2nd (anywhere on earth). We will also have lightning talks session. These have been very well received in recent years, and we aim to increase the time available to them. Lightning talks be ~7mins and are scheduled on the day of the workshop. Suggested topics for lightning talks are to present a single idea, a work-in-progress project, a problem to intrigue and perplex Haskell implementors, or simply to ask for feedback and collaborators. Logistics --------- We recognize the on-going threat that COVID-19 poses to our participants' safety. While August is nearly half a year away, we must account for the possibility that the virus continues to pose a significant threat into the summer. For this reason, we are investigating options that would allow remote presentations this year. In light of this, we urge potential presenters not to be discouraged from submitting and encourage participants to keep time open in their calendars, regardless of the on-going COVID situation. Rest assured that the conference organizers are working to ensure that the Implementors Workshop can be held safely and productively, regardless of how the COVID-19 situation evolves. Program Committee ----------------- - Andrey Mokhov (Newcastle University) - Ben Gamari (Well-Typed LLP) - Christian Baaij (QBayLogic) - George Karachalias (Tweag I/O) - Klara Marntirosian (KU Leuven) - Matthew Pickering (Univeristy of Bristol) - Ryan Scott (Indiana University Bloomington) Best wishes, Ben From mikehulluk at gmail.com Tue Mar 17 20:50:42 2020 From: mikehulluk at gmail.com (Michael Hull) Date: Tue, 17 Mar 2020 20:50:42 +0000 Subject: [Haskell-cafe] Help with async library and killing child processes Message-ID: Hi, I am currently learning Haskell, and really enjoying it, thankyou to the community for this well considered language. I have started using the async library, and I can't quite figure out some of the documentation, and I wonder if someone could help. https://hackage.haskell.org/package/async-2.2.2/docs/Control-Concurrent-Async.html#g:3 Makes the comment that: "This is a useful variant of async that ensures an Async is never left running unintentionally." However, I can't see how I would use this. To make the example more concrete, I have a function that looks like this: runNodeHwBridgeUdp :: NodeHwInterface -> NodeHwUdpConfig-> IO() runNodeHwBridgeUdp (NodeHwInterface l0up l0down) config = do putStrLn "Starting Node bridge" -- Launch all the subprocesses: t0 <- async $ (runMsgUpReader hwBridgeSharedData l0up) t1 <- async $ (evalStateT (runUDPWriter hwBridgeSharedData) (initialUdpDispatchData timeUs) ) t2 <- async $ (runUDPReader hwBridgeSharedData l0down) putStrLn "Created child processes. Waiting...." (a, is_exception) <- waitAnyCatchCancel [t0, t1, t2] case is_exception of Right _ -> do error "SHOULD NOT GET HERE" Left exception -> do case (fromException exception) of Just (ex :: HwDestroyException) -> do putStrLn $ "BRIDGE ENDING: >>>> GOOD: SHUTDOWN: " ++ show exception Nothing -> do throwIO exception return () This process launches 3 child processes, and then waits on them. I launch this function as an async-process, and it would be really helpful if when I "cancel"ed it, it would also also cancelled the children, but I don't understand how I would structure that... t0 <- withAsync $ (runMsgUpReader hwBridgeSharedData l0up) $ \async -> do ???? t1 <- withAsync $ (evalStateT (runUDPWriter hwBridgeSharedData) (initialUdpDispatchData timeUs) ) $ \async -> do ???? t2 <- async $ (runUDPReader hwBridgeSharedData l0down) $ \async -> do ???? I feel like I must be missing something here. I'd appreciate any input; many thanks for your time, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From chpatrick at gmail.com Wed Mar 18 00:48:31 2020 From: chpatrick at gmail.com (Patrick Chilton) Date: Wed, 18 Mar 2020 08:48:31 +0800 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: Message-ID: Hi, I think you're looking for Concurrently: https://hackage.haskell.org/package/async-2.2.2/docs/Control-Concurrent-Async.html#t:Concurrently On Wed, Mar 18, 2020 at 4:52 AM Michael Hull wrote: > Hi, > I am currently learning Haskell, and really enjoying it, thankyou to the > community for this well considered language. > I have started using the async library, and I can't quite figure out some > of the documentation, and I wonder if someone could help. > > > https://hackage.haskell.org/package/async-2.2.2/docs/Control-Concurrent-Async.html#g:3 > > Makes the comment that: "This is a useful variant of async > that > ensures an Async is never left running unintentionally." However, I can't > see how I would use this. > > To make the example more concrete, I have a function that looks like this: > > > runNodeHwBridgeUdp :: NodeHwInterface -> NodeHwUdpConfig-> IO() > runNodeHwBridgeUdp (NodeHwInterface l0up l0down) config = do > putStrLn "Starting Node bridge" > > -- Launch all the subprocesses: > t0 <- async $ (runMsgUpReader hwBridgeSharedData l0up) > t1 <- async $ (evalStateT (runUDPWriter hwBridgeSharedData) > (initialUdpDispatchData timeUs) ) > t2 <- async $ (runUDPReader hwBridgeSharedData l0down) > > putStrLn "Created child processes. Waiting...." > (a, is_exception) <- waitAnyCatchCancel [t0, t1, t2] > > case is_exception of > Right _ -> do > error "SHOULD NOT GET HERE" > Left exception -> do > case (fromException exception) of > Just (ex :: HwDestroyException) -> do > putStrLn $ "BRIDGE ENDING: >>>> GOOD: SHUTDOWN: " ++ show > exception > Nothing -> do > throwIO exception > return () > > > This process launches 3 child processes, and then waits on them. I launch > this function as an async-process, and it would be really helpful if when I > "cancel"ed it, it would also also cancelled the children, but I don't > understand how I would structure that... > > t0 <- withAsync $ (runMsgUpReader hwBridgeSharedData l0up) $ \async -> > do > ???? > t1 <- withAsync $ (evalStateT (runUDPWriter hwBridgeSharedData) > (initialUdpDispatchData timeUs) ) $ \async -> do > ???? > t2 <- async $ (runUDPReader hwBridgeSharedData l0down) $ \async -> do > ???? > > I feel like I must be missing something here. > I'd appreciate any input; many thanks for your time, > > > > Mike > > > _______________________________________________ > 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 mail at nh2.me Wed Mar 18 03:15:38 2020 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Wed, 18 Mar 2020 04:15:38 +0100 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: Message-ID: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> I've you're new to async, also check out my recent rework of the docs that talk about this topic specifically: https://github.com/simonmar/async/pull/105/files (To be available in the next release of async.) From compl.yue at icloud.com Wed Mar 18 08:37:50 2020 From: compl.yue at icloud.com (YueCompl) Date: Wed, 18 Mar 2020 16:37:50 +0800 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> Message-ID: If not for tight loops or other CPU intensive tasks, you may be interested in Edh, which introduces Go's goroutine to GHC runtime. But Edh threads add much higher overhead on top of GHC threads, so there's a price to pay for simplicity of end programmer's job. It's briefly described at https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . This is very new and I'm right now actively working on it for PoC of an STM powered in-memory graph database implementation. Best regards, Compl > On 2020-03-18, at 11:15, Niklas Hambüchen wrote: > > I've you're new to async, also check out my recent rework of the docs that talk about this topic specifically: > > https://github.com/simonmar/async/pull/105/files > > (To be available in the next release of async.) > _______________________________________________ > 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 branimir.maksimovic at gmail.com Wed Mar 18 08:58:11 2020 From: branimir.maksimovic at gmail.com (Branimir Maksimovic) Date: Wed, 18 Mar 2020 09:58:11 +0100 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> Message-ID: What's wrong with forkIO? Greets, Branimir. On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote: > If not for tight loops or other CPU intensive tasks, you may be > interested in Edh, which introduces Go's goroutine to GHC runtime. But > Edh threads add much higher overhead on top of GHC threads, so there's > a price to pay for simplicity of end programmer's job. > > It's briefly described at > https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . > This is very new and I'm right now actively working on it for PoC of > an STM powered in-memory graph database implementation. > > Best regards, > Compl > >> On 2020-03-18, at 11:15, Niklas Hambüchen > > wrote: >> >> I've you're new to async, also check out my recent rework of the docs >> that talk about this topic specifically: >> >> https://github.com/simonmar/async/pull/105/files >> >> (To be available in the next release of async.) >> _______________________________________________ >> 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 compl.yue at icloud.com Wed Mar 18 09:10:19 2020 From: compl.yue at icloud.com (YueCompl) Date: Wed, 18 Mar 2020 17:10:19 +0800 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> Message-ID: <3B0EBA42-ECA4-482A-9675-3166CFB54454@icloud.com> Idiomatic resource leakage prevention in short. An app wants to be as responsive to its users as practically feasible, it would try multiple paths to load-balanced resources, and use the first response that come back, then cancel other paths. Cancellation can help reducing vain computation in such architectures, sometimes largely enough. > On 2020-03-18, at 16:58, Branimir Maksimovic wrote: > > What's wrong with forkIO? > > Greets, > Branimir. > > On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote: >> If not for tight loops or other CPU intensive tasks, you may be interested in Edh, which introduces Go's goroutine to GHC runtime. But Edh threads add much higher overhead on top of GHC threads, so there's a price to pay for simplicity of end programmer's job. >> >> It's briefly described at https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . This is very new and I'm right now actively working on it for PoC of an STM powered in-memory graph database implementation. >> >> Best regards, >> Compl >> >>> On 2020-03-18, at 11:15, Niklas Hambüchen > wrote: >>> >>> I've you're new to async, also check out my recent rework of the docs that talk about this topic specifically: >>> >>> https://github.com/simonmar/async/pull/105/files >>> >>> (To be available in the next release of async.) >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> To (un)subscribe, modify options or view archives go to: >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> Only members subscribed via the mailman list are allowed to post. >> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From branimir.maksimovic at gmail.com Wed Mar 18 09:16:22 2020 From: branimir.maksimovic at gmail.com (Branimir Maksimovic) Date: Wed, 18 Mar 2020 10:16:22 +0100 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: <3B0EBA42-ECA4-482A-9675-3166CFB54454@icloud.com> References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> <3B0EBA42-ECA4-482A-9675-3166CFB54454@icloud.com> Message-ID: <6513d62b-cb27-2d73-cf55-45904193c83d@gmail.com> I'm pretty sure you can't cancel goroutine. Actually I have very bad experience with thread cancelation. Therefore flags passed via channels/mvars or shared flags are used to stop threads. Greets, Branimir. On 3/18/20 10:10 AM, YueCompl wrote: > Idiomatic resource leakage prevention in short. > > An app wants to be as responsive to its users as practically feasible, > it would try multiple paths to load-balanced resources, and use the > first response that come back, then cancel other paths. Cancellation > can help reducing vain computation in such architectures, sometimes > largely enough. > >> On 2020-03-18, at 16:58, Branimir Maksimovic >> > > wrote: >> >> What's wrong with forkIO? >> >> Greets, >> Branimir. >> >> On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote: >>> If not for tight loops or other CPU intensive tasks, you may be >>> interested in Edh, which introduces Go's goroutine to GHC runtime. >>> But Edh threads add much higher overhead on top of GHC threads, so >>> there's a price to pay for simplicity of end programmer's job. >>> >>> It's briefly described at >>> https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . >>> This is very new and I'm right now actively working on it for PoC of >>> an STM powered in-memory graph database implementation. >>> >>> Best regards, >>> Compl >>> >>>> On 2020-03-18, at 11:15, Niklas Hambüchen >>> > wrote: >>>> >>>> I've you're new to async, also check out my recent rework of the >>>> docs that talk about this topic specifically: >>>> >>>> https://github.com/simonmar/async/pull/105/files >>>> >>>> (To be available in the next release of async.) >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> To (un)subscribe, modify options or view archives go to: >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>> Only members subscribed via the mailman list are allowed to post. >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> To (un)subscribe, modify options or view archives go to: >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> Only members subscribed via the mailman list are allowed to post. >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From compl.yue at icloud.com Wed Mar 18 10:06:32 2020 From: compl.yue at icloud.com (YueCompl) Date: Wed, 18 Mar 2020 18:06:32 +0800 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: <6513d62b-cb27-2d73-cf55-45904193c83d@gmail.com> References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> <3B0EBA42-ECA4-482A-9675-3166CFB54454@icloud.com> <6513d62b-cb27-2d73-cf55-45904193c83d@gmail.com> Message-ID: <8D29ADE0-2219-4E4B-9E09-2F3345B4CD4F@icloud.com> No, not to cancel a thread, but the business task on that thread's way ahead. That's what Go's Context is designed for. About Go context from: https://blog.golang.org/context At Google, we require that Go programmers pass a Context parameter as the first argument to every function on the call path between incoming and outgoing requests. This allows Go code developed by many different teams to interoperate well. It provides simple control over timeouts and cancelation and ensures that critical values like security credentials transit Go programs properly. Server frameworks that want to build on Context should provide implementations of Context to bridge between their packages and those that expect a Context parameter. Their client libraries would then accept a Context from the calling code. By establishing a common interface for request-scoped data and cancelation, Context makes it easier for package developers to share code for creating scalable services. I (and seems Windows api too) strongly agree that cancelling a thread is problematic: https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread TerminateThread is a dangerous function that should only be used in the most extreme cases. You should call TerminateThread only if you know exactly what the target thread is doing, and you control all of the code that the target thread could possibly be running at the time of the termination. For example, TerminateThread can result in the following problems: If the target thread owns a critical section, the critical section will not be released. If the target thread is allocating memory from the heap, the heap lock will not be released. If the target thread is executing certain kernel32 calls when it is terminated, the kernel32 state for the thread's process could be inconsistent. If the target thread is manipulating the global state of a shared DLL, the state of the DLL could be destroyed, affecting other users of the DLL. > On 2020-03-18, at 17:16, Branimir Maksimovic wrote: > > I'm pretty sure you can't cancel goroutine. Actually I have > > very bad experience with thread cancelation. Therefore flags > > passed via channels/mvars or shared flags are used to stop > > threads. > > Greets, > Branimir. > > On 3/18/20 10:10 AM, YueCompl wrote: >> Idiomatic resource leakage prevention in short. >> >> An app wants to be as responsive to its users as practically feasible, it would try multiple paths to load-balanced resources, and use the first response that come back, then cancel other paths. Cancellation can help reducing vain computation in such architectures, sometimes largely enough. >> >>> On 2020-03-18, at 16:58, Branimir Maksimovic > wrote: >>> >>> What's wrong with forkIO? >>> >>> Greets, >>> Branimir. >>> >>> On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote: >>>> If not for tight loops or other CPU intensive tasks, you may be interested in Edh, which introduces Go's goroutine to GHC runtime. But Edh threads add much higher overhead on top of GHC threads, so there's a price to pay for simplicity of end programmer's job. >>>> >>>> It's briefly described at https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . This is very new and I'm right now actively working on it for PoC of an STM powered in-memory graph database implementation. >>>> >>>> Best regards, >>>> Compl >>>> >>>>> On 2020-03-18, at 11:15, Niklas Hambüchen > wrote: >>>>> >>>>> I've you're new to async, also check out my recent rework of the docs that talk about this topic specifically: >>>>> >>>>> https://github.com/simonmar/async/pull/105/files >>>>> >>>>> (To be available in the next release of async.) >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> To (un)subscribe, modify options or view archives go to: >>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>>> Only members subscribed via the mailman list are allowed to post. >>>> >>>> >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> To (un)subscribe, modify options or view archives go to: >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>> Only members subscribed via the mailman list are allowed to post. >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> To (un)subscribe, modify options or view archives go to: >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> Only members subscribed via the mailman list are allowed to post. >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From branimir.maksimovic at gmail.com Wed Mar 18 10:18:22 2020 From: branimir.maksimovic at gmail.com (Branimir Maksimovic) Date: Wed, 18 Mar 2020 11:18:22 +0100 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: <8D29ADE0-2219-4E4B-9E09-2F3345B4CD4F@icloud.com> References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> <3B0EBA42-ECA4-482A-9675-3166CFB54454@icloud.com> <6513d62b-cb27-2d73-cf55-45904193c83d@gmail.com> <8D29ADE0-2219-4E4B-9E09-2F3345B4CD4F@icloud.com> Message-ID: <9d4d0e85-cb75-75c9-3877-ed03823a90e5@gmail.com> That's just library, not built into language. You can do it with forkIO as I do it per specifics of application. Greets, Branimir. On 3/18/20 11:06 AM, YueCompl wrote: > No, not to cancel a thread, but the business task on that thread's way > ahead.  That's what Go's Context is designed for. > > * About Go context from: https://blog.golang.org/context > > At Google, we require that Go programmers pass a Context parameter > as the first argument to every function on the call path between > incoming and outgoing requests. This allows Go code developed by > many different teams to interoperate well. It provides simple > control over timeouts and cancelation and ensures that critical > values like security credentials transit Go programs properly. > > Server frameworks that want to build on Context should provide > implementations of Context to bridge between their packages and > those that expect a Context parameter. Their client libraries > would then accept a Context from the calling code. By establishing > a common interface for request-scoped data and cancelation, > Context makes it easier for package developers to share code for > creating scalable services. > > I (and seems Windows api too) strongly agree that cancelling a thread > is problematic: > > https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread > > TerminateThread is a dangerous function that should only be used in > the most extreme cases. You should call TerminateThread only if you > know exactly what the target thread is doing, and you control all of > the code that the target thread could possibly be running at the time > of the termination. For example, TerminateThread can result in the > following problems: > > * If the target thread owns a critical section, the critical section > will not be released. > * If the target thread is allocating memory from the heap, the heap > lock will not be released. > * If the target thread is executing certain kernel32 calls when it > is terminated, the kernel32 state for the thread's process could > be inconsistent. > * If the target thread is manipulating the global state of a shared > DLL, the state of the DLL could be destroyed, affecting other > users of the DLL. > > >> On 2020-03-18, at 17:16, Branimir Maksimovic >> > > wrote: >> >> I'm pretty sure you can't cancel goroutine. Actually I have >> >> very bad experience with thread cancelation. Therefore flags >> >> passed via channels/mvars or shared flags are used to stop >> >> threads. >> >> Greets, >> Branimir. >> >> On 3/18/20 10:10 AM, YueCompl wrote: >>> Idiomatic resource leakage prevention in short. >>> >>> An app wants to be as responsive to its users as practically >>> feasible, it would try multiple paths to load-balanced resources, >>> and use the first response that come back, then cancel other paths. >>> Cancellation can help reducing vain computation in such >>> architectures, sometimes largely enough. >>> >>>> On 2020-03-18, at 16:58, Branimir Maksimovic >>>> >>> > wrote: >>>> >>>> What's wrong with forkIO? >>>> >>>> Greets, >>>> Branimir. >>>> >>>> On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote: >>>>> If not for tight loops or other CPU intensive tasks, you may be >>>>> interested in Edh, which introduces Go's goroutine to GHC runtime. >>>>> But Edh threads add much higher overhead on top of GHC threads, so >>>>> there's a price to pay for simplicity of end programmer's job. >>>>> >>>>> It's briefly described at >>>>> https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . >>>>> This is very new and I'm right now actively working on it for PoC >>>>> of an STM powered in-memory graph database implementation. >>>>> >>>>> Best regards, >>>>> Compl >>>>> >>>>>> On 2020-03-18, at 11:15, Niklas Hambüchen >>>>> > wrote: >>>>>> >>>>>> I've you're new to async, also check out my recent rework of the >>>>>> docs that talk about this topic specifically: >>>>>> >>>>>> https://github.com/simonmar/async/pull/105/files >>>>>> >>>>>> (To be available in the next release of async.) >>>>>> _______________________________________________ >>>>>> Haskell-Cafe mailing list >>>>>> To (un)subscribe, modify options or view archives go to: >>>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>>>> Only members subscribed via the mailman list are allowed to post. >>>>> >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> To (un)subscribe, modify options or view archives go to: >>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>>> Only members subscribed via the mailman list are allowed to post. >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> To (un)subscribe, modify options or view archives go to: >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>> Only members subscribed via the mailman list are allowed to post. >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From compl.yue at icloud.com Wed Mar 18 10:42:56 2020 From: compl.yue at icloud.com (YueCompl) Date: Wed, 18 Mar 2020 18:42:56 +0800 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: <9d4d0e85-cb75-75c9-3877-ed03823a90e5@gmail.com> References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> <3B0EBA42-ECA4-482A-9675-3166CFB54454@icloud.com> <6513d62b-cb27-2d73-cf55-45904193c83d@gmail.com> <8D29ADE0-2219-4E4B-9E09-2F3345B4CD4F@icloud.com> <9d4d0e85-cb75-75c9-3877-ed03823a90e5@gmail.com> Message-ID: Um, event processing applications by procedural programmers (part data analyst personnels for some) is a thing in my org, so I'm baking an DSL doing it. > On 2020-03-18, at 18:18, Branimir Maksimovic wrote: > > That's just library, not built into language. You can do it with forkIO as I do it per specifics > > of application. > > Greets, > Branimir. > > On 3/18/20 11:06 AM, YueCompl wrote: >> No, not to cancel a thread, but the business task on that thread's way ahead. That's what Go's Context is designed for. >> >> About Go context from: https://blog.golang.org/context >> At Google, we require that Go programmers pass a Context parameter as the first argument to every function on the call path between incoming and outgoing requests. This allows Go code developed by many different teams to interoperate well. It provides simple control over timeouts and cancelation and ensures that critical values like security credentials transit Go programs properly. >> >> Server frameworks that want to build on Context should provide implementations of Context to bridge between their packages and those that expect a Context parameter. Their client libraries would then accept a Context from the calling code. By establishing a common interface for request-scoped data and cancelation, Context makes it easier for package developers to share code for creating scalable services. >> I (and seems Windows api too) strongly agree that cancelling a thread is problematic: >> >> https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread >> TerminateThread is a dangerous function that should only be used in the most extreme cases. You should call TerminateThread only if you know exactly what the target thread is doing, and you control all of the code that the target thread could possibly be running at the time of the termination. For example, TerminateThread can result in the following problems: >> If the target thread owns a critical section, the critical section will not be released. >> If the target thread is allocating memory from the heap, the heap lock will not be released. >> If the target thread is executing certain kernel32 calls when it is terminated, the kernel32 state for the thread's process could be inconsistent. >> If the target thread is manipulating the global state of a shared DLL, the state of the DLL could be destroyed, affecting other users of the DLL. >> >>> On 2020-03-18, at 17:16, Branimir Maksimovic > wrote: >>> >>> I'm pretty sure you can't cancel goroutine. Actually I have >>> >>> very bad experience with thread cancelation. Therefore flags >>> >>> passed via channels/mvars or shared flags are used to stop >>> >>> threads. >>> >>> Greets, >>> Branimir. >>> >>> On 3/18/20 10:10 AM, YueCompl wrote: >>>> Idiomatic resource leakage prevention in short. >>>> >>>> An app wants to be as responsive to its users as practically feasible, it would try multiple paths to load-balanced resources, and use the first response that come back, then cancel other paths. Cancellation can help reducing vain computation in such architectures, sometimes largely enough. >>>> >>>>> On 2020-03-18, at 16:58, Branimir Maksimovic > wrote: >>>>> >>>>> What's wrong with forkIO? >>>>> >>>>> Greets, >>>>> Branimir. >>>>> >>>>> On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote: >>>>>> If not for tight loops or other CPU intensive tasks, you may be interested in Edh, which introduces Go's goroutine to GHC runtime. But Edh threads add much higher overhead on top of GHC threads, so there's a price to pay for simplicity of end programmer's job. >>>>>> >>>>>> It's briefly described at https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . This is very new and I'm right now actively working on it for PoC of an STM powered in-memory graph database implementation. >>>>>> >>>>>> Best regards, >>>>>> Compl >>>>>> >>>>>>> On 2020-03-18, at 11:15, Niklas Hambüchen > wrote: >>>>>>> >>>>>>> I've you're new to async, also check out my recent rework of the docs that talk about this topic specifically: >>>>>>> >>>>>>> https://github.com/simonmar/async/pull/105/files >>>>>>> >>>>>>> (To be available in the next release of async.) >>>>>>> _______________________________________________ >>>>>>> Haskell-Cafe mailing list >>>>>>> To (un)subscribe, modify options or view archives go to: >>>>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>>>>> Only members subscribed via the mailman list are allowed to post. >>>>>> >>>>>> >>>>>> >>>>>> _______________________________________________ >>>>>> Haskell-Cafe mailing list >>>>>> To (un)subscribe, modify options or view archives go to: >>>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>>>> Only members subscribed via the mailman list are allowed to post. >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> To (un)subscribe, modify options or view archives go to: >>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>>> Only members subscribed via the mailman list are allowed to post. >>>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From haskell-cafe at chrisdone.com Wed Mar 18 11:21:29 2020 From: haskell-cafe at chrisdone.com (Chris Done) Date: Wed, 18 Mar 2020 11:21:29 +0000 Subject: [Haskell-cafe] Adding Content-Addressable Storage to GHC Message-ID: <38595d16-9c70-49f0-a573-454820bd6d18@www.fastmail.com> Hi all, Is there any effort or designs ongoing to add CAS (content-addressable storage) to GHC, as in Unison? < https://www.unisonweb.org/docs/tour/> == The idea == The summary of the idea is simply that top-level declarations can be addressed by a hash of their contents. Recursive definitions are transformed into the worker/wrapper to eliminate the self-referencing issue of hashing. == Why I want this == There are lots of advantages to this, but the one that excites me the most is that we can move to running tests, especially property tests, at compile-time. The main downside to running tests at compile-time, as seen done with template-haskell is that you will re-run tests every time the module is recompiled, making your dev cycle slower. However, if your tests are keyed upon CAS hashes, then those hashes are only invalidated when individual declarations actually change. This means the re-running of tests becomes granular at the declaration-level. When a single test completes, either successfully or not, you can cache the result and lookup the result next time, using e.g. the SHA512 of the expression evaluated. Therefore you could change a single function in a library and it would only re-run the tests that are actually affected, rather than running all the tests in the whole module, and rather than the more typical approach which is running ALL tests in a test suite just because one thing changed. If you can couple tests with code then you can avoid the decoupling of code from the tests. == Implementation approaches == There are various ways to implement this with varying degrees of satisfaction: 1. Use TH: reify declarations, inspect the AST, and produce a SHA512. Use ambient values such as the GHC version, instances in scope, extensions, ghc options, etc. With TH, I'm confident that you can only achieve an imperfect hash because I doubt that all information is available to TH. Names that come from external packages could be treated as CAS'd at the scope of the package's installed hash. Ideally, you could have granularity into other packages. But it's not a necessity if you just want caching for your current development package. 2. Use a source plugin. A source plugin is already capable of accessing all GHC context information, so this might lead to more of a perfect hash. 3. Add it to GHC directly. Exposing a `expressionSHA512 :: Exp -> ByteString` could be one imaginary way to access this information. With such a function you could implement caching of fine-grained tests. A related discussion is the deterministic builds: https://gitlab.haskell.org/ghc/ghc/wikis/deterministic-builds Anyone else exploring this? Cheers, Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: From mgajda at mimuw.edu.pl Wed Mar 18 14:45:15 2020 From: mgajda at mimuw.edu.pl (Michal J Gajda) Date: Wed, 18 Mar 2020 15:45:15 +0100 Subject: [Haskell-cafe] Haskell-Cafe Digest, Vol 199, Issue 15 In-Reply-To: References: Message-ID: Great idea! We already have syntax for package imports: ``` import "bytestring" Data.ByteString ``` Source plugin could probably pull and build package by CAS: ``` import "CAS_6ffeacff768590" Data.ByteString ``` That would reuse existing syntax without confusion. And without inconvenience of having to import expressions one by one. Or declaring their types. One could even add CAS hashes to Hackage db. Wonder if source plugin can add `-package` parameters? On Wed, Mar 18, 2020, 13:01 wrote: > Send Haskell-Cafe mailing list submissions to > haskell-cafe at haskell.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > or, via email, send a message with subject or body 'help' to > haskell-cafe-request at haskell.org > > You can reach the person managing the list at > haskell-cafe-owner at haskell.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Haskell-Cafe digest..." > Today's Topics: > > 1. Re: Help with async library and killing child processes (YueCompl) > 2. Adding Content-Addressable Storage to GHC (Chris Done) > > > > ---------- Forwarded message ---------- > From: YueCompl > To: Branimir Maksimovic > Cc: haskell-cafe at haskell.org > Bcc: > Date: Wed, 18 Mar 2020 18:42:56 +0800 > Subject: Re: [Haskell-cafe] Help with async library and killing child > processes > Um, event processing applications by procedural programmers (part data > analyst personnels for some) is a thing in my org, so I'm baking an DSL > doing it. > > On 2020-03-18, at 18:18, Branimir Maksimovic < > branimir.maksimovic at gmail.com> wrote: > > That's just library, not built into language. You can do it with forkIO as > I do it per specifics > > of application. > > Greets, > Branimir. > On 3/18/20 11:06 AM, YueCompl wrote: > > No, not to cancel a thread, but the business task on that thread's way > ahead. That's what Go's Context is designed for. > > > - About Go context from: https://blog.golang.org/context > > At Google, we require that Go programmers pass a Context parameter as the > first argument to every function on the call path between incoming and > outgoing requests. This allows Go code developed by many different teams to > interoperate well. It provides simple control over timeouts and cancelation > and ensures that critical values like security credentials transit Go > programs properly. > Server frameworks that want to build on Context should provide > implementations of Context to bridge between their packages and those that > expect a Context parameter. Their client libraries would then accept a > Context from the calling code. By establishing a common interface for > request-scoped data and cancelation, Context makes it easier for package > developers to share code for creating scalable services. > > I (and seems Windows api too) strongly agree that cancelling a thread is > problematic: > > > https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-terminatethread > > TerminateThread is a dangerous function that should only be used in the > most extreme cases. You should call TerminateThread only if you know > exactly what the target thread is doing, and you control all of the code > that the target thread could possibly be running at the time of the > termination. For example, TerminateThread can result in the following > problems: > > - If the target thread owns a critical section, the critical section > will not be released. > - If the target thread is allocating memory from the heap, the heap > lock will not be released. > - If the target thread is executing certain kernel32 calls when it is > terminated, the kernel32 state for the thread's process could be > inconsistent. > - If the target thread is manipulating the global state of a shared > DLL, the state of the DLL could be destroyed, affecting other users of the > DLL. > > > On 2020-03-18, at 17:16, Branimir Maksimovic < > branimir.maksimovic at gmail.com> wrote: > > I'm pretty sure you can't cancel goroutine. Actually I have > > very bad experience with thread cancelation. Therefore flags > > passed via channels/mvars or shared flags are used to stop > > threads. > > Greets, > Branimir. > On 3/18/20 10:10 AM, YueCompl wrote: > > Idiomatic resource leakage prevention in short. > > An app wants to be as responsive to its users as practically feasible, it > would try multiple paths to load-balanced resources, and use the first > response that come back, then cancel other paths. Cancellation can help > reducing vain computation in such architectures, sometimes largely enough. > > On 2020-03-18, at 16:58, Branimir Maksimovic < > branimir.maksimovic at gmail.com> wrote: > > What's wrong with forkIO? > > Greets, > Branimir. > On 3/18/20 9:37 AM, YueCompl via Haskell-Cafe wrote: > > If not for tight loops or other CPU intensive tasks, you may be interested > in Edh, which introduces Go's goroutine to GHC runtime. But Edh threads add > much higher overhead on top of GHC threads, so there's a price to pay for > simplicity of end programmer's job. > > It's briefly described at > https://github.com/e-wrks/edh/tree/master/Tour#program--threading-model . > This is very new and I'm right now actively working on it for PoC of an STM > powered in-memory graph database implementation. > > Best regards, > Compl > > On 2020-03-18, at 11:15, Niklas Hambüchen wrote: > > I've you're new to async, also check out my recent rework of the docs that > talk about this topic specifically: > > https://github.com/simonmar/async/pull/105/files > > (To be available in the next release of async.) > _______________________________________________ > 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. > > > > > > > > ---------- Forwarded message ---------- > From: Chris Done > To: haskell-cafe at haskell.org > Cc: > Bcc: > Date: Wed, 18 Mar 2020 11:21:29 +0000 > Subject: [Haskell-cafe] Adding Content-Addressable Storage to GHC > Hi all, > > Is there any effort or designs ongoing to add CAS (content-addressable > storage) to GHC, as in Unison? < > https://www.unisonweb.org/docs/tour/> > > == The idea == > > The summary of the idea is simply that top-level declarations can be > addressed by a hash of their contents. Recursive definitions are > transformed into the worker/wrapper to eliminate the self-referencing issue > of hashing. > > == Why I want this == > > There are lots of advantages to this, but the one that excites me the most > is that we can move to running tests, especially property tests, at > compile-time. > > The main downside to running tests at compile-time, as seen done with > template-haskell is that you will re-run tests every time the module is > recompiled, making your dev cycle slower. However, if your tests are keyed > upon CAS hashes, then those hashes are only invalidated when individual > declarations actually change. This means the re-running of tests becomes > granular at the declaration-level. When a single test completes, either > successfully or not, you can cache the result and lookup the result next > time, using e.g. the SHA512 of the expression evaluated. > > Therefore you could change a single function in a library and it would > only re-run the tests that are actually affected, rather than running all > the tests in the whole module, and rather than the more typical approach > which is running ALL tests in a test suite just because one thing changed. > > If you can couple tests with code then you can avoid the decoupling of > code from the tests. > > == Implementation approaches == > > There are various ways to implement this with varying degrees of > satisfaction: > > 1. Use TH: reify declarations, inspect the AST, and produce a SHA512. Use > ambient values such as the GHC version, instances in scope, extensions, ghc > options, etc. With TH, I'm confident that you can only achieve an imperfect > hash because I doubt that all information is available to TH. > > Names that come from external packages could be treated as CAS'd at the > scope of the package's installed hash. Ideally, you could have granularity > into other packages. But it's not a necessity if you just want caching for > your current development package. > > 2. Use a source plugin. A source plugin is already capable of accessing > all GHC context information, so this might lead to more of a perfect hash. > > 3. Add it to GHC directly. Exposing a `expressionSHA512 :: Exp -> > ByteString` could be one imaginary way to access this information. With > such a function you could implement caching of fine-grained tests. > > A related discussion is the deterministic builds: > https://gitlab.haskell.org/ghc/ghc/wikis/deterministic-builds > > Anyone else exploring this? > > Cheers, > > Chris > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.zimm at gmail.com Wed Mar 18 18:03:16 2020 From: alan.zimm at gmail.com (Alan & Kim Zimmerman) Date: Wed, 18 Mar 2020 18:03:16 +0000 Subject: [Haskell-cafe] Adding Content-Addressable Storage to GHC In-Reply-To: <38595d16-9c70-49f0-a573-454820bd6d18@www.fastmail.com> References: <38595d16-9c70-49f0-a573-454820bd6d18@www.fastmail.com> Message-ID: I am not exploring, but watching with great interest. And may not be able to resist jumping in if something comes of it. Alan On Wed, 18 Mar 2020 at 11:23, Chris Done wrote: > Hi all, > > Is there any effort or designs ongoing to add CAS (content-addressable > storage) to GHC, as in Unison? < > https://www.unisonweb.org/docs/tour/> > > == The idea == > > The summary of the idea is simply that top-level declarations can be > addressed by a hash of their contents. Recursive definitions are > transformed into the worker/wrapper to eliminate the self-referencing issue > of hashing. > > == Why I want this == > > There are lots of advantages to this, but the one that excites me the most > is that we can move to running tests, especially property tests, at > compile-time. > > The main downside to running tests at compile-time, as seen done with > template-haskell is that you will re-run tests every time the module is > recompiled, making your dev cycle slower. However, if your tests are keyed > upon CAS hashes, then those hashes are only invalidated when individual > declarations actually change. This means the re-running of tests becomes > granular at the declaration-level. When a single test completes, either > successfully or not, you can cache the result and lookup the result next > time, using e.g. the SHA512 of the expression evaluated. > > Therefore you could change a single function in a library and it would > only re-run the tests that are actually affected, rather than running all > the tests in the whole module, and rather than the more typical approach > which is running ALL tests in a test suite just because one thing changed. > > If you can couple tests with code then you can avoid the decoupling of > code from the tests. > > == Implementation approaches == > > There are various ways to implement this with varying degrees of > satisfaction: > > 1. Use TH: reify declarations, inspect the AST, and produce a SHA512. Use > ambient values such as the GHC version, instances in scope, extensions, ghc > options, etc. With TH, I'm confident that you can only achieve an imperfect > hash because I doubt that all information is available to TH. > > Names that come from external packages could be treated as CAS'd at the > scope of the package's installed hash. Ideally, you could have granularity > into other packages. But it's not a necessity if you just want caching for > your current development package. > > 2. Use a source plugin. A source plugin is already capable of accessing > all GHC context information, so this might lead to more of a perfect hash. > > 3. Add it to GHC directly. Exposing a `expressionSHA512 :: Exp -> > ByteString` could be one imaginary way to access this information. With > such a function you could implement caching of fine-grained tests. > > A related discussion is the deterministic builds: > https://gitlab.haskell.org/ghc/ghc/wikis/deterministic-builds > > Anyone else exploring this? > > Cheers, > > Chris > > > > > _______________________________________________ > 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 Wed Mar 18 18:49:55 2020 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 18 Mar 2020 14:49:55 -0400 Subject: [Haskell-cafe] Adding Content-Addressable Storage to GHC In-Reply-To: References: <38595d16-9c70-49f0-a573-454820bd6d18@www.fastmail.com> Message-ID: I slightly feel like we should first upgrade the typeable hashing rep from md5 to sha3-256 or something like that (though i've talked about how finding a compilable pair of collisions would make for a fun april first package ), but I do think theres certainly some really cool things if we think about that sort of direction carefully. I'm not aware of any efforts in this direction atm On Wed, Mar 18, 2020 at 2:05 PM Alan & Kim Zimmerman wrote: > I am not exploring, but watching with great interest. And may not be able > to resist jumping in if something comes of it. > > Alan > > On Wed, 18 Mar 2020 at 11:23, Chris Done > wrote: > >> Hi all, >> >> Is there any effort or designs ongoing to add CAS (content-addressable >> storage) to GHC, as in Unison? < >> https://www.unisonweb.org/docs/tour/> >> >> == The idea == >> >> The summary of the idea is simply that top-level declarations can be >> addressed by a hash of their contents. Recursive definitions are >> transformed into the worker/wrapper to eliminate the self-referencing issue >> of hashing. >> >> == Why I want this == >> >> There are lots of advantages to this, but the one that excites me the >> most is that we can move to running tests, especially property tests, at >> compile-time. >> >> The main downside to running tests at compile-time, as seen done with >> template-haskell is that you will re-run tests every time the module is >> recompiled, making your dev cycle slower. However, if your tests are keyed >> upon CAS hashes, then those hashes are only invalidated when individual >> declarations actually change. This means the re-running of tests becomes >> granular at the declaration-level. When a single test completes, either >> successfully or not, you can cache the result and lookup the result next >> time, using e.g. the SHA512 of the expression evaluated. >> >> Therefore you could change a single function in a library and it would >> only re-run the tests that are actually affected, rather than running all >> the tests in the whole module, and rather than the more typical approach >> which is running ALL tests in a test suite just because one thing changed. >> >> If you can couple tests with code then you can avoid the decoupling of >> code from the tests. >> >> == Implementation approaches == >> >> There are various ways to implement this with varying degrees of >> satisfaction: >> >> 1. Use TH: reify declarations, inspect the AST, and produce a SHA512. Use >> ambient values such as the GHC version, instances in scope, extensions, ghc >> options, etc. With TH, I'm confident that you can only achieve an imperfect >> hash because I doubt that all information is available to TH. >> >> Names that come from external packages could be treated as CAS'd at the >> scope of the package's installed hash. Ideally, you could have granularity >> into other packages. But it's not a necessity if you just want caching for >> your current development package. >> >> 2. Use a source plugin. A source plugin is already capable of accessing >> all GHC context information, so this might lead to more of a perfect hash. >> >> 3. Add it to GHC directly. Exposing a `expressionSHA512 :: Exp -> >> ByteString` could be one imaginary way to access this information. With >> such a function you could implement caching of fine-grained tests. >> >> A related discussion is the deterministic builds: >> https://gitlab.haskell.org/ghc/ghc/wikis/deterministic-builds >> >> Anyone else exploring this? >> >> Cheers, >> >> Chris >> >> >> >> >> _______________________________________________ >> 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 tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Wed Mar 18 21:25:13 2020 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 18 Mar 2020 21:25:13 +0000 Subject: [Haskell-cafe] Adding Content-Addressable Storage to GHC In-Reply-To: <38595d16-9c70-49f0-a573-454820bd6d18@www.fastmail.com> References: <38595d16-9c70-49f0-a573-454820bd6d18@www.fastmail.com> Message-ID: <20200318212513.GA23397@weber> On Wed, Mar 18, 2020 at 11:21:29AM +0000, Chris Done wrote: > Is there any effort or designs ongoing to add CAS (content-addressable > storage) to GHC, as in Unison? < > https://www.unisonweb.org/docs/tour/> > == The idea == > The summary of the idea is simply that top-level declarations can be > addressed by a hash of their contents. Recursive definitions are > transformed into the worker/wrapper to eliminate the self-referencing > issue of hashing. I started wanting this recently, although I can't remember why. As far as I can see there are two distinct things that one might want 1. To be able to come up with a hash for each expression. 2. To be able to look up that hash somewhere to recover the expression. I was only interested in 1. Please correct me if I'm wrong but it seems from your description that your use case only requires 1 too. Anyway, I think this is a great idea. Tom From mgajda at mimuw.edu.pl Thu Mar 19 11:10:12 2020 From: mgajda at mimuw.edu.pl (Michal J Gajda) Date: Thu, 19 Mar 2020 12:10:12 +0100 Subject: [Haskell-cafe] Adding Content-Addressable Storage to GHC In-Reply-To: References: Message-ID: Great idea! We already have syntax for package imports: ``` import "bytestring" Data.ByteString ``` Source plugin could probably pull and build package by CAS: ``` import "CAS_6ffeacff768590" Data.ByteString ``` That would reuse existing syntax without confusion. And without inconvenience of having to import expressions one by one. Or declaring their types. One could even add CAS hashes to Hackage db. Probably the source plugin can add `-package` parameters with GHC_OPTIONS? On the expression side, it seems easy to use Generics to derive hashable for `Exp`, given a *particular compiler version*. Warning is, that one needs to be more careful when the `Exp`ression type changes. -- Cheers Michal From mikehulluk at gmail.com Thu Mar 19 14:40:02 2020 From: mikehulluk at gmail.com (Michael Hull) Date: Thu, 19 Mar 2020 14:40:02 +0000 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> Message-ID: Hi Niklas and Patrick, Thankyou both for the comments -- this is what I am looking for. I have a follow-on question, if I have code like getPages :: IO() getPages = do (page1, page2, page3) <- runConcurrently $ (,,) <$> Concurrently (getURL "url1") <*> Concurrently (getURL "url2") <*> Concurrently (getURL "url3") main :: IO() main = do f <- async getPages cancel f Am I guaranteed the the getURL() calls will definitely have either finished, or cancel? (I looked through the source ( https://hackage.haskell.org/package/async-2.2.2/docs/src/Control.Concurrent.Async.html#Concurrently), and I think so, because runConcurrently is implemented in terms of race, which is implemented using withAsync, but I'm not confident with interpreting Haskell!) Many thanks, Mike On Wed, 18 Mar 2020 at 03:15, Niklas Hambüchen wrote: > I've you're new to async, also check out my recent rework of the docs that > talk about this topic specifically: > > https://github.com/simonmar/async/pull/105/files > > (To be available in the next release of async.) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From branimir.maksimovic at gmail.com Thu Mar 19 18:32:42 2020 From: branimir.maksimovic at gmail.com (Branimir Maksimovic) Date: Thu, 19 Mar 2020 19:32:42 +0100 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> Message-ID: I use my nonblocking library: eg for IRC bot:    let myCallbacks = defaultCallbacks {                                 done_connected = binded,                                 done_reading = response_get tm ref stdgen gsref,                                 done_writing = response_written,                                 done_closed = \pl s -> do                                     putStrLn "peer closed, reconnecting"                                     s <- socket myCallbacks                                     connect pl s "83.140.172.212:6667"                                     return 1,                                 handle_error = \pl s buf len-> do                                     str <- peekCStringLen (buf,fromIntegral len)                                     putStrLn $ "error "++str++", reconnecting"                                     s <- socket myCallbacks                                     connect pl s "83.140.172.212:6667"                                     return 1,                                 tick = binded_tick tm                               }     s <- socket myCallbacks     pl <- epoll 1000     connect pl s "83.140.172.212:6667"     run_loop pl (-1) On 3/19/20 3:40 PM, Michael Hull wrote: > Hi Niklas and Patrick, > > Thankyou both for the comments -- this is what I am looking for. > > I have a follow-on question, if I have code like > > getPages :: IO() > getPages = do (page1, page2, page3) >      <- runConcurrently $ (,,) >      <$> Concurrently (getURL "url1") >      <*> Concurrently (getURL "url2") >      <*> Concurrently (getURL "url3") > > main :: IO() > main = do >     f <- async getPages >     cancel f > > Am I guaranteed the the getURL() calls will definitely have either > finished, or cancel? (I looked through the source > (https://hackage.haskell.org/package/async-2.2.2/docs/src/Control.Concurrent.Async.html#Concurrently), > and I think so, because runConcurrently is implemented in terms of > race, which is implemented using withAsync, but I'm not confident with > interpreting Haskell!) > > > Many thanks, > > Mike > > > > On Wed, 18 Mar 2020 at 03:15, Niklas Hambüchen > wrote: > > I've you're new to async, also check out my recent rework of the > docs that talk about this topic specifically: > > https://github.com/simonmar/async/pull/105/files > > (To be available in the next release of async.) > > > _______________________________________________ > 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 mail at nh2.me Fri Mar 20 01:37:47 2020 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Fri, 20 Mar 2020 02:37:47 +0100 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> Message-ID: <6150a720-7201-0f08-cbec-e768bcd3b981@nh2.me> Hey Mike, > f <- async getPages > cancel f you haven't read the PR I linked carefully enough yet :) It essentially says to never use the `async` function, as that is almost never what you want Full docs, with what you need to read highlighted: https://github.com/nh2/async/blob/1d96dc555b70a4c5aba07f15d0c7895545eb8582/Control/Concurrent/Async.hs#L21-L143 > Am I guaranteed the the getURL() calls will definitely have either finished, or cancel? For do (page1, page2, page3) <- runConcurrently $ (,,) <$> Concurrently (getURL "url1") <*> Concurrently (getURL "url2") <*> Concurrently (getURL "url3") you are guaranteed that when `runConcurrently` returns, all 3 downloads have finished successfully. Only the `instance Alternative Concurrently` (that is, when you use <|>) is implemented in terms of `race`. You are using <*>, as implemented in the `instance Applicative Concurrently`, which uses `concurrently`, which waits for both of two actions. Your code in > main = do > f <- async getPages > cancel f does not make much sense: Here you're starting a thread that would go off do something, but then you immediately cancel that thread, so it won't achieve anything. You do not need to wrap things into additional `async`s. You can directly do, for example: main :: IO () main = do (page1, page2, page3) <- runConcurrently $ (,,) <$> Concurrently (getURL "url1") <*> Concurrently (getURL "url2") <*> Concurrently (getURL "url3") putStrLn "Here are the page contents:" putStrLn page1 putStrLn page2 putStrLn page3 Hope that helps! Niklas From a.pelenitsyn at gmail.com Fri Mar 20 02:43:03 2020 From: a.pelenitsyn at gmail.com (Artem Pelenitsyn) Date: Thu, 19 Mar 2020 22:43:03 -0400 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: <6150a720-7201-0f08-cbec-e768bcd3b981@nh2.me> References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> <6150a720-7201-0f08-cbec-e768bcd3b981@nh2.me> Message-ID: Hey Niklas, Thanks for your explanation -- it was useful to read. Is there a way to get the result of "either of three calls to getUrl" as opposed to "all three calls"? 'Cause that's what Mike seems to want. -- Best regards, Artem On Thu, 19 Mar 2020 at 21:38, Niklas Hambüchen wrote: > Hey Mike, > > > f <- async getPages > > cancel f > > you haven't read the PR I linked carefully enough yet :) > > It essentially says to never use the `async` function, as that is almost > never what you want > > Full docs, with what you need to read highlighted: > > https://github.com/nh2/async/blob/1d96dc555b70a4c5aba07f15d0c7895545eb8582/Control/Concurrent/Async.hs#L21-L143 > > > Am I guaranteed the the getURL() calls will definitely have either > finished, or cancel? > > For > > do > (page1, page2, page3) <- runConcurrently $ > (,,) > <$> Concurrently (getURL "url1") > <*> Concurrently (getURL "url2") > <*> Concurrently (getURL "url3") > > you are guaranteed that when `runConcurrently` returns, all 3 downloads > have finished successfully. > > Only the `instance Alternative Concurrently` (that is, when you use <|>) > is implemented in terms of `race`. > > You are using <*>, as implemented in the `instance Applicative > Concurrently`, which uses `concurrently`, which waits for both of two > actions. > > Your code in > > > main = do > > f <- async getPages > > cancel f > > does not make much sense: > Here you're starting a thread that would go off do something, but then you > immediately cancel that thread, so it won't achieve anything. > > You do not need to wrap things into additional `async`s. You can directly > do, for example: > > main :: IO () > main = do > (page1, page2, page3) <- runConcurrently $ > (,,) > <$> Concurrently (getURL "url1") > <*> Concurrently (getURL "url2") > <*> Concurrently (getURL "url3") > putStrLn "Here are the page contents:" > putStrLn page1 > putStrLn page2 > putStrLn page3 > > Hope that helps! > > Niklas > _______________________________________________ > 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 chpatrick at gmail.com Fri Mar 20 03:01:04 2020 From: chpatrick at gmail.com (Patrick Chilton) Date: Fri, 20 Mar 2020 10:01:04 +0700 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> <6150a720-7201-0f08-cbec-e768bcd3b981@nh2.me> Message-ID: > > Is there a way to get the result of "either of three calls to getUrl" as > opposed to "all three calls"? > 'Cause that's what Mike seems to want. That's what the Alternative instance of Concurrently is for. The result of `doA <|> doB` is the result of the argument that finished first. (<|>) = race. firstResult <- runConcurrently (Concurrently (getURL "url1") <|> Concurrently (getURL "url2") <|> Concurrently (getURL "url3")) or firstResult <- runConcurrently $ asum $ map (Concurrently . getURL) [ "url1", "url2", "url3" ] On Fri, Mar 20, 2020 at 9:44 AM Artem Pelenitsyn wrote: > Hey Niklas, > > Thanks for your explanation -- it was useful to read. > > Is there a way to get the result of "either of three calls to getUrl" as > opposed to "all three calls"? > 'Cause that's what Mike seems to want. > > -- > Best regards, > Artem > > > On Thu, 19 Mar 2020 at 21:38, Niklas Hambüchen wrote: > >> Hey Mike, >> >> > f <- async getPages >> > cancel f >> >> you haven't read the PR I linked carefully enough yet :) >> >> It essentially says to never use the `async` function, as that is almost >> never what you want >> >> Full docs, with what you need to read highlighted: >> >> https://github.com/nh2/async/blob/1d96dc555b70a4c5aba07f15d0c7895545eb8582/Control/Concurrent/Async.hs#L21-L143 >> >> > Am I guaranteed the the getURL() calls will definitely have either >> finished, or cancel? >> >> For >> >> do >> (page1, page2, page3) <- runConcurrently $ >> (,,) >> <$> Concurrently (getURL "url1") >> <*> Concurrently (getURL "url2") >> <*> Concurrently (getURL "url3") >> >> you are guaranteed that when `runConcurrently` returns, all 3 downloads >> have finished successfully. >> >> Only the `instance Alternative Concurrently` (that is, when you use <|>) >> is implemented in terms of `race`. >> >> You are using <*>, as implemented in the `instance Applicative >> Concurrently`, which uses `concurrently`, which waits for both of two >> actions. >> >> Your code in >> >> > main = do >> > f <- async getPages >> > cancel f >> >> does not make much sense: >> Here you're starting a thread that would go off do something, but then >> you immediately cancel that thread, so it won't achieve anything. >> >> You do not need to wrap things into additional `async`s. You can directly >> do, for example: >> >> main :: IO () >> main = do >> (page1, page2, page3) <- runConcurrently $ >> (,,) >> <$> Concurrently (getURL "url1") >> <*> Concurrently (getURL "url2") >> <*> Concurrently (getURL "url3") >> putStrLn "Here are the page contents:" >> putStrLn page1 >> putStrLn page2 >> putStrLn page3 >> >> Hope that helps! >> >> Niklas >> _______________________________________________ >> 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 a.pelenitsyn at gmail.com Fri Mar 20 04:23:13 2020 From: a.pelenitsyn at gmail.com (Artem Pelenitsyn) Date: Fri, 20 Mar 2020 00:23:13 -0400 Subject: [Haskell-cafe] Help with async library and killing child processes In-Reply-To: References: <405c059a-a975-4e0a-894e-d2080a182456@nh2.me> <6150a720-7201-0f08-cbec-e768bcd3b981@nh2.me> Message-ID: That makes sense. Thanks a lot, Patrick! On Thu, Mar 19, 2020, 11:01 PM Patrick Chilton wrote: > Is there a way to get the result of "either of three calls to getUrl" as >> opposed to "all three calls"? >> 'Cause that's what Mike seems to want. > > > That's what the Alternative instance of Concurrently is for. The result of > `doA <|> doB` is the result of the argument that finished first. (<|>) = > race. > > firstResult <- runConcurrently (Concurrently (getURL "url1") <|> > Concurrently (getURL "url2") <|> Concurrently (getURL "url3")) > > or > > firstResult <- runConcurrently $ asum $ map (Concurrently . getURL) [ > "url1", "url2", "url3" ] > > On Fri, Mar 20, 2020 at 9:44 AM Artem Pelenitsyn > wrote: > >> Hey Niklas, >> >> Thanks for your explanation -- it was useful to read. >> >> Is there a way to get the result of "either of three calls to getUrl" as >> opposed to "all three calls"? >> 'Cause that's what Mike seems to want. >> >> -- >> Best regards, >> Artem >> >> >> On Thu, 19 Mar 2020 at 21:38, Niklas Hambüchen wrote: >> >>> Hey Mike, >>> >>> > f <- async getPages >>> > cancel f >>> >>> you haven't read the PR I linked carefully enough yet :) >>> >>> It essentially says to never use the `async` function, as that is almost >>> never what you want >>> >>> Full docs, with what you need to read highlighted: >>> >>> https://github.com/nh2/async/blob/1d96dc555b70a4c5aba07f15d0c7895545eb8582/Control/Concurrent/Async.hs#L21-L143 >>> >>> > Am I guaranteed the the getURL() calls will definitely have either >>> finished, or cancel? >>> >>> For >>> >>> do >>> (page1, page2, page3) <- runConcurrently $ >>> (,,) >>> <$> Concurrently (getURL "url1") >>> <*> Concurrently (getURL "url2") >>> <*> Concurrently (getURL "url3") >>> >>> you are guaranteed that when `runConcurrently` returns, all 3 downloads >>> have finished successfully. >>> >>> Only the `instance Alternative Concurrently` (that is, when you use <|>) >>> is implemented in terms of `race`. >>> >>> You are using <*>, as implemented in the `instance Applicative >>> Concurrently`, which uses `concurrently`, which waits for both of two >>> actions. >>> >>> Your code in >>> >>> > main = do >>> > f <- async getPages >>> > cancel f >>> >>> does not make much sense: >>> Here you're starting a thread that would go off do something, but then >>> you immediately cancel that thread, so it won't achieve anything. >>> >>> You do not need to wrap things into additional `async`s. You can >>> directly do, for example: >>> >>> main :: IO () >>> main = do >>> (page1, page2, page3) <- runConcurrently $ >>> (,,) >>> <$> Concurrently (getURL "url1") >>> <*> Concurrently (getURL "url2") >>> <*> Concurrently (getURL "url3") >>> putStrLn "Here are the page contents:" >>> putStrLn page1 >>> putStrLn page2 >>> putStrLn page3 >>> >>> Hope that helps! >>> >>> Niklas >>> _______________________________________________ >>> 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 brucker at spamfence.net Fri Mar 20 21:49:37 2020 From: brucker at spamfence.net (Achim D. Brucker) Date: Fri, 20 Mar 2020 21:49:37 +0000 Subject: [Haskell-cafe] Open Position: Lecturer in Computer Science (Exeter, Deadline 2020-04-08) Message-ID: <20200320214937.kmsgpsslef2ofuvk@ananogawa.home.brucker.ch> Open Position: Lecturer in Computer Science (Exeter, Deadline 2020-04-08) As part of the expansion of the Department of Computer Science at the University of Exeter [1], we are recruiting for a Lecturer in Cybersecurity. The lecturer will be part of the newly formed Security and Trust of Advanced Systems Group [2]. We are looking for a candidate with an outstanding research record in any area related to cyber security (information security) such as (but not limited to): - access control - usable security - software/application security - formal methods for security - language-based security/privacy - secure programming - information flow - security protocols - network security - security of distributes systems - human aspects of security - hardware security - security economics - security-by-design - applied cryptography - privacy-enhancing technologies - threat hunting, security analytics - threat modelling - forensics, reverse engineering - trustworthy AI/ML - security/penetration testing You will have a PhD or equivalent in Cybersecurity, Computer Science, Mathematics, Engineering or a related area. Please refer to the job description for full details. We understand **security and safety entangled concepts**: in most modern systems one cannot be achieved without the other. Hence, we encourage also candidates working in related domains such as **safety, dependability, resilience, or reliability** to apply. Please apply by 8th of April 2020! See the full announcement and application details at https://jobs.exeter.ac.uk/hrpr_webrecruitment/wrd/run/ETREC107GF.open?VACANCY_ID=803965SHQd&WVID=3817591jNg&LANG=USA We are happy to do online/remote interviews. Feel free to contact me for informal inquiries about the post. Best, Achim [1] https://www.exeter.ac.uk/computer-science/ [2] https://emps.exeter.ac.uk/computer-science/research/cyber-security/ -- Prof. Achim Brucker | https://www.brucker.ch | https://logicalhacking.com/blog *We are hiring:* * Lecturer (Assistant Professor) - Deadline 2020-04-08: https://www.jobs.ac.uk/job/BZH668/lecturer-in-computer-science-education-and-research * Two PhD Studentships (EU/UK Tuition Fees) - Deadline 2020-05-01: http://www.exeter.ac.uk/studying/funding/award/?id=3887 From brucker at spamfence.net Fri Mar 20 22:40:04 2020 From: brucker at spamfence.net (Achim D. Brucker) Date: Fri, 20 Mar 2020 22:40:04 +0000 Subject: [Haskell-cafe] 2 PhD Positions in the Safety and Security of Advanced Systems Group (University of Exeter, UK Deadline 2020-05-01) Message-ID: <20200320224004.xqk3w6dp2mxbrszb@ananogawa.home.brucker.ch> Two fully funded PhD scholarships for EU/UK applicants are available in the Security and Trust of Advanced Systems Group [1] (Prof. Achim Brucker [2] and Dr. Diego Marmsoler [3]) at the Department of Computer Science of the University of Exeter, UK [4]. We are looking for enthusiastic and outstanding Computer Science or Mathematics students with a strong background in some of the following topics: - safety or security of (software) systems, - formal modelling or formal reasoning/verification, - program analysis or program verification, - language-based security - semantics of programming languages, - theorem proving, model checking, - cryptographic protocols, - distributed systems (e.g., blockchain), - specification-based testing, and - design and implementation of security architectures. This award provides annual funding to cover UK/EU tuition fees and a tax-free stipend. For students who pay UK/EU tuition fees the award will cover the tuition fees in full, plus at least £15,009 per year tax-free stipend. The studentship will be awarded on the basis of merit for 3.5 years of full-time study. For more details, please consult the official advertisement: http://www.exeter.ac.uk/studying/funding/award/?id=3887 The closing date for applications is midnight on 1 May 2020. Project-specific queries should be directed to the supervisors, Prof Achim Brucker (A.Brucker at exeter.ac.uk) or Dr Diego Marmsoler (D.Marmsoler at exeter.ac.uk). Best, Achim and Diego [1] http://emps.exeter.ac.uk/computer-science/research/cyber-security/ [2] https://www.brucker.uk/ [3] https://marmsoler.com/ [4] http://emps.exeter.ac.uk/computer-science/ -- Prof. Achim Brucker | https://www.brucker.ch | https://logicalhacking.com/blog *We are hiring:* * Lecturer (Assistant Professor) - Deadline 2020-04-08: https://www.jobs.ac.uk/job/BZH668/lecturer-in-computer-science-education-and-research * Two PhD Studentships (EU/UK Tuition Fees) - Deadline 2020-05-01: http://www.exeter.ac.uk/studying/funding/award/?id=3887 From komendantskaya at gmail.com Sat Mar 21 10:58:47 2020 From: komendantskaya at gmail.com (Ekaterina Komendantskaya) Date: Sat, 21 Mar 2020 10:58:47 +0000 Subject: [Haskell-cafe] Multiple Research Positions (3 Doctoral, 5 Post-doctoral) on AI Verification Message-ID: AI Secure and Explainable by Construction: Multiple Research Positions (3 Doctoral, 5 Post-doctoral) available at Heriot-Watt, Edinburgh and Strathclyde Universities, Scotland, UK. Start date: 1 September 2020; End date: 30 August 2023 Postdoctoral Salary Scale: £31,866 to £40,322 per annum PhD funding: covering PhD fees and stipend for 3.5 years Closing date for Postdoctoral applications: 1 June 2020 We encourage interested applicants to contact us informally ASAP. The project has sufficient flexibility to mitigate the effect of COVID-19, i.e. by accommodating later start date and remote working. The project spans several subjects: type theory, automated and interactive theorem proving, security, AI and machine learning, autonomous systems, natural language processing and generation, legal aspects of AI. It will cover two main application areas: autonomous cars and chatbots, drawing from expertise and infrastructure provided by industrial partners working in these two areas. The project has a significant international span, with 12 partners from Academia and Industry in Europe (France, Germany, Israel, the Netherlands, Norway) and the US. Researchers joining this project will have excellent opportunities to travel to international conferences, organise scientific events, spend time with industrial partners, collaborate with academic leaders in the field, develop their own research profiles as well as gain experience in other AI and CS disciplines. For further information, and instructions how to apply, please visit: http://laiv.uk/index.php/vacancies/ Ekaterina Komendantskaya: http://www.macs.hw.ac.uk/~ek19/ Robert Atkey: https://bentnib.org/ David Aspinall: https://homepages.inf.ed.ac.uk/da/ Burkard Schafer: https://www.law.ed.ac.uk/people/professor-burkhard-schafer Verena Rieser: https://sites.google.com/site/verenateresarieser/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikehulluk at gmail.com Sat Mar 21 14:42:43 2020 From: mikehulluk at gmail.com (Michael Hull) Date: Sat, 21 Mar 2020 14:42:43 +0000 Subject: [Haskell-cafe] Using State monad with lens Message-ID: Hi, I use the State monad in a lot of places, but when I use it with the lens library, I find myself writing code like: myFunc :: StateT MyState ([ResultType]) myFunc = do st <- get case st ^. some_property of True -> do my_value .= "Hello" True -> do my_value .= "Goodbye" I want to do something based on a 'state-variable', but I have to write 'get' -- is there a pattern that allows me to avoid the intermediate 'st' variable? I want to write something like: myFunc = do case (get ^. some_property) of True -> do my_value .= "Hello" True -> do my_value .= "Goodbye" but that won't compile. Best wishes, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Sat Mar 21 14:49:08 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat, 21 Mar 2020 15:49:08 +0100 (CET) Subject: [Haskell-cafe] Using State monad with lens In-Reply-To: References: Message-ID: On Sat, 21 Mar 2020, Michael Hull wrote: > Hi,I use the State monad in a lot of places, but when I use it with the lens library, I find myself writing code > like: > > myFunc :: StateT MyState ([ResultType]) > myFunc = do >    st <- get >    case st ^. some_property of >       True -> do >             my_value .= "Hello" >       True -> do >             my_value .= "Goodbye" >           > I want to do something based on a 'state-variable', but I have to write 'get' -- is there a pattern that allows > me to avoid the intermediate 'st' variable?  gets (^. some_property) But you still need a local variable for the result of 'gets'. > I want to write something like: > > myFunc = do >    case (get ^. some_property) of >       True -> do >             my_value .= "Hello" >       True -> do >             my_value .= "Goodbye" > > but that won't compile. There cannot be an according accessor, because getting the state needs access to the state in the monad. One could at least think of using LambdaCase. From will.yager at gmail.com Sat Mar 21 15:43:26 2020 From: will.yager at gmail.com (William Yager) Date: Sat, 21 Mar 2020 23:43:26 +0800 Subject: [Haskell-cafe] Using State monad with lens In-Reply-To: References: Message-ID: LambdaCase is useful for things like this. On Sat, Mar 21, 2020 at 10:50 PM Henning Thielemann < lemming at henning-thielemann.de> wrote: > > On Sat, 21 Mar 2020, Michael Hull wrote: > > > Hi,I use the State monad in a lot of places, but when I use it with the > lens library, I find myself writing code > > like: > > > > myFunc :: StateT MyState ([ResultType]) > > myFunc = do > > st <- get > > case st ^. some_property of > > True -> do > > my_value .= "Hello" > > True -> do > > my_value .= "Goodbye" > > > > I want to do something based on a 'state-variable', but I have to write > 'get' -- is there a pattern that allows > > me to avoid the intermediate 'st' variable? > > gets (^. some_property) > > But you still need a local variable for the result of 'gets'. > > > > I want to write something like: > > > > myFunc = do > > case (get ^. some_property) of > > True -> do > > my_value .= "Hello" > > True -> do > > my_value .= "Goodbye" > > > > but that won't compile. > > There cannot be an according accessor, because getting the state needs > access to the state in the monad. One could at least think of using > LambdaCase._______________________________________________ > 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 Sat Mar 21 16:33:43 2020 From: emilypi at cohomolo.gy (Emily Pillmore) Date: Sat, 21 Mar 2020 16:33:43 +0000 Subject: [Haskell-cafe] Using State monad with lens In-Reply-To: References: Message-ID: Normally, you'd write `gets` to access entries in your state environment according to some function (e.g. record accessors), but since `some_property` is itself (presumably) a `Lens` or `Getter`, you should be able to use the lensy-State accessor `use`( https://github.com/ekmett/lens/blob/e06c171840bbe86c789b8dff8c8211b88ac9211e/src/Control/Lens/Getter.hs#L347 ). Then, your script becomes:  ``` myFunc :: StateT MyState [ResultType] myFunc = do   p ← use some_property    case p of      True → do my_value .= "Hello"     False → do my_value .= "Goodbye" ``` `use` works in the same sense that `view` does for `MonadReader r m ⇒ m`. It even has an analog to `preview` called `preuse`, which you can use for `Prism`s in your state environment.   Cheers, hope that helps, Emily On Sat, Mar 21, 2020 at 10:42 AM, Michael Hull < mikehulluk at gmail.com > wrote: > > Hi, > I use the State monad in a lot of places, but when I use it with the lens > library, I find myself writing code like: > > > myFunc :: StateT MyState ([ResultType]) > myFunc = do >    st <- get >    case st ^. some_property of >       True -> do >             my_value .= "Hello" >       True -> do >             my_value .= "Goodbye" > >           > I want to do something based on a 'state-variable', but I have to write > 'get' -- is there a pattern that allows me to avoid the intermediate 'st' > variable?  > I want to write something like: > > > myFunc = do >    case (get ^. some_property) of >       True -> do >             my_value .= "Hello" >       True -> do >             my_value .= "Goodbye" > > > > > but that won't compile. > > > Best wishes, > > > Mike > > > > > > > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: http:/ / mail. haskell. > org/ cgi-bin/ mailman/ listinfo/ haskell-cafe ( > 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 halogenandtoast at gmail.com Sat Mar 21 18:51:21 2020 From: halogenandtoast at gmail.com (Matt Mongeau) Date: Sat, 21 Mar 2020 13:51:21 -0500 Subject: [Haskell-cafe] Using State monad with lens In-Reply-To: References: Message-ID: Which as others have mentioned, works well with lambda case, here's an example from a game I am writing: ``` runPhase :: (MonadIO m, MonadState GameState m) => Card -> m () runPhase c at Card {..} = use phase >>= \case HeadlinePhase -> liftIO . putStrLn $ "Drew: " ++ show c EventResolutionPhase -> liftIO . putStrLn $ "Event" ArmyMovementPhase -> traverse_ moveArmy armyMovements ActionPhase -> liftIO . putStrLn $ "Show me your moves!" KaiserschlachtPhase -> pure () NationalWillPhase -> do nw <- nationalWill if nw <= -5 then gameOver else pure () GameOver -> liftIO . putStrLn $ "Game over" ``` On Sat, Mar 21, 2020 at 11:34 AM Emily Pillmore wrote: > Normally, you'd write `gets` to access entries in your state environment > according to some function (e.g. record accessors), but since > `some_property` is itself (presumably) a `Lens` or `Getter`, you should be > able to use the lensy-State accessor `use`( > https://github.com/ekmett/lens/blob/e06c171840bbe86c789b8dff8c8211b88ac9211e/src/Control/Lens/Getter.hs#L347). > Then, your script becomes: > > ``` > myFunc :: StateT MyState [ResultType] > myFunc = do > p ← use some_property > case p of > True → do my_value .= "Hello" > False → do my_value .= "Goodbye" > ``` > > `use` works in the same sense that `view` does for `MonadReader r m ⇒ m`. > It even has an analog to `preview` called `preuse`, which you can use for > `Prism`s in your state environment. > > Cheers, hope that helps, > Emily > > > > On Sat, Mar 21, 2020 at 10:42 AM, Michael Hull > wrote: > >> Hi, >> I use the State monad in a lot of places, but when I use it with the lens >> library, I find myself writing code like: >> >> myFunc :: StateT MyState ([ResultType]) >> myFunc = do >> st <- get >> case st ^. some_property of >> True -> do >> my_value .= "Hello" >> True -> do >> my_value .= "Goodbye" >> >> I want to do something based on a 'state-variable', but I have to write >> 'get' -- is there a pattern that allows me to avoid the intermediate 'st' >> variable? >> I want to write something like: >> >> myFunc = do >> case (get ^. some_property) of >> True -> do >> my_value .= "Hello" >> True -> do >> my_value .= "Goodbye" >> >> but that won't compile. >> >> Best wishes, >> >> Mike >> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only >> members subscribed via the mailman list are allowed to post. >> > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivanperezdominguez at gmail.com Sat Mar 21 18:55:53 2020 From: ivanperezdominguez at gmail.com (Ivan Perez) Date: Sat, 21 Mar 2020 14:55:53 -0400 Subject: [Haskell-cafe] gitlab.haskell.org down? Message-ID: Hi, Is the Haskell gitlab down or has anything changed? https://downforeveryoneorjustme.com/gitlab.haskell.org Cheers, Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.jakobi at googlemail.com Sat Mar 21 19:00:19 2020 From: simon.jakobi at googlemail.com (Simon Jakobi) Date: Sat, 21 Mar 2020 20:00:19 +0100 Subject: [Haskell-cafe] gitlab.haskell.org down? In-Reply-To: References: Message-ID: Ben has run into a problem while performing an upgrade. See https://mail.haskell.org/pipermail/ghc-devs/2020-March/018725.html Am Sa., 21. März 2020 um 19:56 Uhr schrieb Ivan Perez : > > Hi, > > Is the Haskell gitlab down or has anything changed? > > https://downforeveryoneorjustme.com/gitlab.haskell.org > > Cheers, > > Ivan > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From juan.casanova at ed.ac.uk Sat Mar 21 21:11:29 2020 From: juan.casanova at ed.ac.uk (Juan Casanova) Date: Sat, 21 Mar 2020 21:11:29 +0000 Subject: [Haskell-cafe] Using State monad with lens In-Reply-To: References: Message-ID: <20200321211129.12615yypjih4nesk@www.staffmail.ed.ac.uk> I'm surprised noone has mentioned 'zoom' yet. It does not make your original example work directly, but almost. It may be very useful to keep in mind as a way to do whatever you want. http://hackage.haskell.org/package/lens-4.19.1/docs/Control-Lens-Zoom.html#v:zoom The idea of zoom is that you use it like so: zoom my_lens my_monadic_action where my_monadic_action is a monadic action that works on the sub-element (call it 's') of the state, and the entire thing 'zoom my_lens my_monadic_action' is then a monadic action that works on the whole element (call it 't'). my_lens is a lens that focuses on 's' within 't'. So instead of using the lens all the time in the monadic action, you're basically saying: "Put this everywhere that you need to", and then you can do things with the sub-element 's'. Juan. PS: I hope I did not severely misunderstand what you wanted, but it's still a possibility. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From capn.freako at gmail.com Sun Mar 22 23:51:05 2020 From: capn.freako at gmail.com (David Banas) Date: Sun, 22 Mar 2020 16:51:05 -0700 Subject: [Haskell-cafe] Strange error when cabal installing. Message-ID: After installing the *Haskell Platform* on my Windows 10 machine, I attempted to cabal install something and got: cabal.exe: The package has a './configure' script. If you are on Windows, This requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. If you are not on Windows, ensure that an 'sh' command is discoverable in your path. I've confirmed that the following line is in my cabal config file: extra-prog-path: C:\Program Files\Haskell Platform\8.6.5\msys\usr\bin, C:\Users\capnf\AppData\Roaming\cabal\bin and that there *is* a *sh.exe* file in the "C:\Program Files\Haskell Platform\8.6.5\msys\usr\bin" directory. What am I missing? Thanks, -db -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Mon Mar 23 00:02:45 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Mon, 23 Mar 2020 01:02:45 +0100 (CET) Subject: [Haskell-cafe] Strange error when cabal installing. In-Reply-To: References: Message-ID: On Sun, 22 Mar 2020, David Banas wrote: > After installing the Haskell Platform on my Windows 10 machine, I attempted to cabal install something and got: > > cabal.exe: The package has a './configure' script. If you are on Windows, This > requires a Unix compatibility toolchain such as MinGW+MSYS or Cygwin. If you > are not on Windows, ensure that an 'sh' command is discoverable in your path. Is this message related to your package or to a package that you import? From capn.freako at gmail.com Mon Mar 23 02:20:15 2020 From: capn.freako at gmail.com (David Banas) Date: Sun, 22 Mar 2020 19:20:15 -0700 Subject: [Haskell-cafe] Strange error when cabal installing. In-Reply-To: References: Message-ID: To a package that I import. On Sun, Mar 22, 2020 at 5:02 PM Henning Thielemann < lemming at henning-thielemann.de> wrote: > > On Sun, 22 Mar 2020, David Banas wrote: > > > After installing the Haskell Platform on my Windows 10 machine, I > attempted to cabal install something and got: > > > > cabal.exe: The package has a './configure' script. If you are on > Windows, This > > requires a Unix compatibility toolchain such as MinGW+MSYS or > Cygwin. If you > > are not on Windows, ensure that an 'sh' command is discoverable in > your path. > > Is this message related to your package or to a package that you import? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vagarenko at gmail.com Mon Mar 23 05:44:03 2020 From: vagarenko at gmail.com (Alexey Vagarenko) Date: Mon, 23 Mar 2020 10:44:03 +0500 Subject: [Haskell-cafe] Strange error when cabal installing. In-Reply-To: References: Message-ID: This might be an instance of https://github.com/haskell/cabal/issues/3462 Try removing spaces and/or newlines around the comma. пн, 23 мар. 2020 г. в 07:21, David Banas : > To a package that I import. > > > On Sun, Mar 22, 2020 at 5:02 PM Henning Thielemann < > lemming at henning-thielemann.de> wrote: > >> >> On Sun, 22 Mar 2020, David Banas wrote: >> >> > After installing the Haskell Platform on my Windows 10 machine, I >> attempted to cabal install something and got: >> > >> > cabal.exe: The package has a './configure' script. If you are on >> Windows, This >> > requires a Unix compatibility toolchain such as MinGW+MSYS or >> Cygwin. If you >> > are not on Windows, ensure that an 'sh' command is discoverable >> in your path. >> >> Is this message related to your package or to a package that you import? >> > _______________________________________________ > 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 Mar 23 16:44:33 2020 From: leah at vuxu.org (Leah Neukirchen) Date: Mon, 23 Mar 2020 17:44:33 +0100 Subject: [Haskell-cafe] Munich Virtual Haskell Meeting, 2020-03-25 @ 19:30 Message-ID: <871rpjrpfy.fsf@vuxu.org> Dear all, This week, our monthly Munich Haskell Meeting will take place again on Wednesday, March 25. **Due to curfew in Bavaria, this meeting will take place online!** For details see here: http://muenchen.haskell.bayern/dates.html A Google Meet link to join the room will be provided on Wednesday. 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 guillembartrina at gmail.com Wed Mar 25 14:20:45 2020 From: guillembartrina at gmail.com (Guillem Bartrina Moreno) Date: Wed, 25 Mar 2020 15:20:45 +0100 Subject: [Haskell-cafe] GSoC 2020 Message-ID: Hello everybody! My name is Guillem and I'm a 3rd year computer science student from Spain. This semester I'm taking Functional Programming, where we use Haskell as base language, and Compilers courses. I really love Haskell and the functional programming paradigm in general, so when I saw it in the GSoC list I got really excited. The idea that caught my attention, that is related to both Haskell and Compilers, is: - Update stylish-haskell to use ghc-lib-parser I have a medium understanding of Haskell and I would like to know if this idea is suitable for me. I've tried to start reading the source code and I have understood the most part. I will proceed to write my proposal in the next few days if all goes well. All thoughts are welcome! Thanks for your attention, -- Guillem Bartrina Moreno -------------- next part -------------- An HTML attachment was scrubbed... URL: From bernardobruno at gmail.com Thu Mar 26 08:37:53 2020 From: bernardobruno at gmail.com (Bruno Bernardo) Date: Thu, 26 Mar 2020 09:37:53 +0100 Subject: [Haskell-cafe] 2nd Workshop on Formal Methods for Blockchains (FMBC) 2020 - First Call Message-ID: [ Please distribute, apologies for multiple postings. ] ======================================================================== 2nd Workshop on Formal Methods for Blockchains (FMBC) 2020 - First Call https://fmbc.gitlab.io/2020 July 19, 2020, Los Angeles, USA Co-located with the 32nd International Conference on Computer-Aided Verification (CAV 2020) http://i-cav.org/2020/ ------------------------------------------------------------- IMPORTANT DATES -------------------------------- Abstract submission: April 21, 2020 Full paper submission: April 28, 2020 Notification: June 9, 2020 Camera-ready: July 7, 2020 Conference: July 19, 2020 -------------------------------- -------------------------------- TOPICS OF INTEREST -------------------------------- Blockchains are decentralized transactional ledgers that rely on cryptographic hash functions for guaranteeing the integrity of the stored data. Participants on the network reach agreement on what valid transactions are through consensus algorithms. Blockchains may also provide support for Smart Contracts. Smart Contracts are scripts of an ad-hoc programming language that are stored in the Blockchain and that run on the network. They can interact with the ledger’s data and update its state. These scripts can express the logic of possibly complex contracts between users of the Blockchain. Thus, Smart Contracts can facilitate the economic activity of Blockchain participants. With the emergence and increasing popularity of cryptocurrencies such as Bitcoin and Ethereum, it is now of utmost importance to have strong guarantees of the behavior of Blockchain software. These guarantees can be brought by using Formal Methods. Indeed, Blockchain software encompasses many topics of computer science where using Formal Methods techniques and tools are relevant: consensus algorithms to ensure the liveness and the security of the data on the chain, programming languages specifically designed to write Smart Contracts, cryptographic protocols, such as zero-knowledge proofs, used to ensure privacy, etc. This workshop is a forum to identify theoretical and practical approaches of formal methods for Blockchain technology. Topics include, but are not limited to: * Formal models of Blockchain applications or concepts * Formal methods for consensus protocols * Formal methods for Blockchain-specific cryptographic primitives or protocols * Design and implementation of Smart Contract languages * Verification of Smart Contracts -------------------------------- -------------------------------- SUBMISSION -------------------------------- Submit original manuscripts (not published or considered elsewhere) with a maximum of twelve pages (full papers), six pages (short papers), and two pages (extended abstract) describing new and emerging ideas or summarizing existing work). Each paper should include a title and the name and affiliation of each author. Authors of selected extended-abstracts are invited to give a short lightning talk. At least one author of an accepted paper is expected to present the paper at the workshop as a registered participant. Submission link: https://easychair.org/conferences/?conf=fmbc2020 -------------------------------- -------------------------------- PROCEEDINGS -------------------------------- All submissions will be peer-reviewed by at least three members of the program committee for quality and relevance. Accepted regular papers (full and short papers) will be included in the workshop proceedings. -------------------------------- -------------------------------- INVITED SPEAKER -------------------------------- Grigore Rosu, Professor at University of Illinois at Urbana-Champaign, USA and Founder of Runtime Verification http://fsl.cs.illinois.edu/index.php/Grigore_Rosu https://runtimeverification.com/ -------------------------------- -------------------------------- PROGRAM COMMITTEE -------------------------------- PC CO-CHAIRS * Bruno Bernardo (Nomadic Labs, France) (bruno at nomadic-labs.com) * Diego Marmsoler (University of Exeter, UK) (D.Marmsoler at exeter.ac.uk) PC MEMBERS * Wolfgang Ahrendt (Chalmers University of Technology, Sweden) * Lacramioara Astefanoei (Nomadic Labs, France) * Massimo Bartoletti (University of Cagliari, Italy) * Bernhard Beckert (Karlsruhe Institute of Technology, Germany) * Achim Brucker (University of Exeter, UK) * Silvia Crafa (Universita di Padova, Italy) * Zaynah Dargaye (Nomadic Labs, France) * Jérémie Decouchant (University of Luxembourg, Luxembourg) * Ansgar Fehnker (University of Twente, Netherlands) * Georges Gonthier (Inria, France) * Florian Kammueller (Middlesex University London, UK) * Maurice Herlihy (Brown University, USA) * Igor Konnov (Informal, Austria) * Andreas Lochbihler (Digital Asset, Switzerland) * Anastasia Mavridou (NASA Ames, USA) * Simão Melo de Sousa (Universidade da Beira Interior, Portugal) * Karl Palmskog (KTH, Sweden) * Vincent Rahli (University of Birmingham, UK) * Andreas Rossberg (Dfinity Foundation, Germany) * Claudio Russo (Dfinity Foundation, USA) * César Sanchez (Imdea, Spain) * Clara Schneidewind (TU Wien, Austria) * Ilya Sergey (Yale-NUS College/NUS, Singapore) * Bas Spitters (Aarhus University/Concordium, Denmark) * Mark Staples (CSIRO Data61, Australia) * Meng Sun (Peking University, China) * Simon Thompson (University of Kent, UK) * Philip Wadler (University of Edinburgh / IOHK, UK) (Note: Additional PC members may be added in the coming weeks.) From wolfgang-it at jeltsch.info Fri Mar 27 02:06:22 2020 From: wolfgang-it at jeltsch.info (Wolfgang Jeltsch) Date: Fri, 27 Mar 2020 04:06:22 +0200 Subject: [Haskell-cafe] ANN: latex-svg In-Reply-To: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> References: <2cef55c7-05c5-b345-44d2-a0a6410c5d85@iki.fi> Message-ID: <8fc262d40b666c4723c9c62047c27586b51d9ee0.camel@jeltsch.info> Am Freitag, den 06.03.2020, 14:41 +0200 schrieb Oleg Grenrus: > There are three packages on Hackage now: > > - latex-svg-image: render LaTeX formulae to SVG images > - latex-svg-pandoc: render LaTeX formulae in pandoc documents > - latex-svg-hakyll: render LaTeX formulae in hakyll pages Hi, Oleg! Thanks for this great work. > https://oleg.fi/gists/posts/2018-12-12-find-correct-laws.html It seems that baselines of formulas and surrounding text are aligned, which is an important feature, which is missing from several other solutions. However, when looking at the situation in detail, the formulas seem to be slightly too high. Does the conversion mechanism take baselines into account, or is the approximate alignment achieved just by accident? > See the announcement blog post how some examples look like: > https://oleg.fi/gists/posts/2020-03-06-latex-svg.html > > I see a small problem here: The example formula (x = y) ↔ (∀z. (z ≤ x) ↔ (z ≤ y)) has the letters y slightly cut off at the bottom, probably because they extend some automatically computed bounding box. Could this be fixed? All the best, Wolfgang From capn.freako at gmail.com Sat Mar 28 13:13:08 2020 From: capn.freako at gmail.com (David Banas) Date: Sat, 28 Mar 2020 06:13:08 -0700 Subject: [Haskell-cafe] Which option causes 'cabal install' to leave temp. build dirs. in place? Message-ID: Hi all, Which option to a 'cabal install' command will cause the temporary build directories to be left in place, so that I can inspect, for instance, the 'config.log' file of a failed dependency build? Thanks, -db -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Sat Mar 28 13:24:49 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat, 28 Mar 2020 14:24:49 +0100 (CET) Subject: [Haskell-cafe] Which option causes 'cabal install' to leave temp. build dirs. in place? In-Reply-To: References: Message-ID: On Sat, 28 Mar 2020, David Banas wrote: > Which option to a 'cabal install' command will cause the temporary build > directories to be left in place, so that I can inspect, for instance, > the 'config.log' file of a failed dependency build? I don't think cabal deletes its log files automatically. I remember it even tells you the path of the log of a failed build. Is it in ~/.cabal/logs/ ? From capn.freako at gmail.com Sat Mar 28 13:36:49 2020 From: capn.freako at gmail.com (David Banas) Date: Sat, 28 Mar 2020 06:36:49 -0700 Subject: [Haskell-cafe] Why does the Haskell Platform Windows installer suggest a path with spaces?! Message-ID: Why does the Haskell Platform Windows installer suggest a default installation path that contains spaces?! This breaks builds: configure:2365: checking build system type configure:2379: result: x86_64-pc-msys configure:2399: checking host system type configure:2412: result: x86_64-pc-msys configure:2487: checking for gcc configure:2514: result: C:\PROGRA~1\Haskell Platform\8.6.5\lib\../mingw/bin\gcc.exe configure:2743: checking for C compiler version configure:2752: C:\PROGRA~1\Haskell Platform\8.6.5\lib\../mingw/bin\gcc.exe --version >&5 C:\/Users/capnf/Documents/GitHub/gitit/network-3.1.1.1/configure: line 2754: C:\PROGRA~1\Haskell: No such file or directory configure:2763: $? = 127 configure:2752: C:\PROGRA~1\Haskell Platform\8.6.5\lib\../mingw/bin\gcc.exe -v >&5 C:\/Users/capnf/Documents/GitHub/gitit/network-3.1.1.1/configure: line 2754: C:\PROGRA~1\Haskell: No such file or directory -db -------------- next part -------------- An HTML attachment was scrubbed... URL: From lemming at henning-thielemann.de Sat Mar 28 13:41:28 2020 From: lemming at henning-thielemann.de (Henning Thielemann) Date: Sat, 28 Mar 2020 14:41:28 +0100 (CET) Subject: [Haskell-cafe] Why does the Haskell Platform Windows installer suggest a path with spaces?! In-Reply-To: References: Message-ID: On Sat, 28 Mar 2020, David Banas wrote: > Why does the Haskell Platform Windows installer suggest a default > installation path that contains spaces?! Yes, very annoying. I also ran into this problem. From vhaisman at gmail.com Sat Mar 28 15:01:34 2020 From: vhaisman at gmail.com (=?UTF-8?Q?V=c3=a1clav_Haisman?=) Date: Sat, 28 Mar 2020 16:01:34 +0100 Subject: [Haskell-cafe] Why does the Haskell Platform Windows installer suggest a path with spaces?! In-Reply-To: References: Message-ID: On 28. 03. 20 14:36, David Banas wrote: > Why does the Haskell Platform Windows installer suggest a default > installation path that contains spaces?! > This breaks builds: > > configure:2365: checking build system type > configure:2379: result: x86_64-pc-msys > configure:2399: checking host system type > configure:2412: result: x86_64-pc-msys > configure:2487: checking for gcc > configure:2514: result: C:\PROGRA~1\Haskell > Platform\8.6.5\lib\../mingw/bin\gcc.exe > configure:2743: checking for C compiler version > configure:2752: C:\PROGRA~1\Haskell > Platform\8.6.5\lib\../mingw/bin\gcc.exe --version >&5 > C:\/Users/capnf/Documents/GitHub/gitit/network-3.1.1.1/configure: line > 2754: C:\PROGRA~1\Haskell: No such file or directory > configure:2763: $? = 127 > configure:2752: C:\PROGRA~1\Haskell > Platform\8.6.5\lib\../mingw/bin\gcc.exe -v >&5 > C:\/Users/capnf/Documents/GitHub/gitit/network-3.1.1.1/configure: line > 2754: C:\PROGRA~1\Haskell: No such file or directory Someone was lazy and didn't quote his environment variable expansions. Fix the configure script source instead. -- VH -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 228 bytes Desc: OpenPGP digital signature URL: From capn.freako at gmail.com Sat Mar 28 15:25:22 2020 From: capn.freako at gmail.com (David Banas) Date: Sat, 28 Mar 2020 08:25:22 -0700 Subject: [Haskell-cafe] Strange error when cabal installing. Message-ID: Okay, I was able to get the _Haskell Platform_ approach to work, by doing the following: - Uninstall Haskell Platform. - Reinstall Haskell Platform, overriding the default suggested installation path with something _not containing spaces_. - Change my `~\AppData\Roaming\cabal\config` file from this: ``` extra-prog-path: C:\HaskellPlatform\8.6.5\msys\usr\bin, C:\Users\capnf\AppData\Roaming\cabal\bin ``` to this: ``` extra-prog-path: C:\HaskellPlatform\8.6.5\msys\usr\bin extra-prog-path: C:\Users\capnf\AppData\Roaming\cabal\bin ``` -db -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at joachim-breitner.de Sun Mar 29 11:21:53 2020 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sun, 29 Mar 2020 13:21:53 +0200 Subject: [Haskell-cafe] gitlab.haskell.org down? In-Reply-To: References: Message-ID: <7783cf1d78861fe4499bc404f6d143d4d8618d59.camel@joachim-breitner.de> Hi, any news on that front? Ben’s mail is about gitlab.haskell.org, but this affects git.haskell.org. Cheers, Joachim Am Samstag, den 21.03.2020, 20:00 +0100 schrieb Simon Jakobi via Haskell-Cafe: > Ben has run into a problem while performing an upgrade. See > https://mail.haskell.org/pipermail/ghc-devs/2020-March/018725.html > > Am Sa., 21. März 2020 um 19:56 Uhr schrieb Ivan Perez > : > > Hi, > > > > Is the Haskell gitlab down or has anything changed? > > > > https://downforeveryoneorjustme.com/gitlab.haskell.org > > > > Cheers, > > > > Ivan > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > _______________________________________________ > 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. -- Joachim Breitner mail at joachim-breitner.de http://www.joachim-breitner.de/ From c.charukiewicz at gmail.com Sun Mar 29 21:51:08 2020 From: c.charukiewicz at gmail.com (Christian Charukiewicz) Date: Sun, 29 Mar 2020 16:51:08 -0500 Subject: [Haskell-cafe] [ANN] esqueleto-3.3.3.0: Support for UNION, safer joins, and subquery joins! Message-ID: Hi all, My friend Ben Levy and I spent a while writing and documenting Database.Esqueleto.Experimental, a new module in the esqueleto package which adds support for UNION, subqueries, and improves the safety of outer JOINs. We've done a lot of use/testing of this implementation, but it is currently in the Experimental module in order to allow for gathering feedback. It is now live on Hackage as esqueleto-3.3.3.0. The module docs give examples of the new functionality. Feel free to take a take a look here: https://hackage.haskell.org/package/esqueleto-3.3.3.0/docs/Database-Esqueleto-Experimental.html Thanks, Christian -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.castro.dcp at gmail.com Mon Mar 30 11:34:46 2020 From: david.castro.dcp at gmail.com (David Castro) Date: Mon, 30 Mar 2020 11:34:46 +0000 Subject: [Haskell-cafe] Research Assistant/Associate Position (Postdoc) at Imperial College London Message-ID: Hello, We are looking for candidates for this position at Imperial College London. The official text of the advertisement follows: Department of Computing, Imperial College London Research Assistant/Associate Position (Full Time) 35,477 GBP to 47,579 GBP per annum Reference: ENG01270 Fixed-term: 2 years (with a possible 24 month extension) Starting date: as soon as possible (no later than 1st October 2020) Closing Date: 26th April 2020 The Research Assistant will work under the EPSRC Established Career Fellowship Project, POST: Protocols, Observabilities and Session Types. Imperial College London provides a flexible arrangement to be able to start and work remotely until we re-open the campus (this depends on your nationality and current living address). Please contact with Nobuko Yoshida (n.yoshida at imperial.ac.uk), Imperial College London if you would like to apply to the position to have informal discussions. The application deadline is also extendable. ------------------------------------------------------------ The project has particular emphasis on putting theory into practice, by embedding session types in a range of programming languages and applying them to case studies; or developing the links between session types and other areas of theoretical computer science. The research programme includes collaboration with several companies and organisations. Candidates for the post-doc position will need to have expertise in either: 1. programming language design and implementation; or 2. formal semantics, type theory and concurrency theory Different positions will be suitable for different points on the theory/practice spectrum. We are especially interested in candidates with a combination of theoretical and practical skills. For more details, see http://mrg.doc.ic.ac.uk. The focus of Imperial College London Group is theories and applications of (Multiparty) Session Types (JACM,POPL'08) which include: -- Go (POPL'19,ICSE'18,POPL'17,CC'16), Scala (PLDI'19,ECOOP'17,ECOOP'16), F# (CC'18), Erlang (CC'17), Haskell (CC'20,POPL'16), OCaml (SOC), Java (FASE'16,FASE'17), MPI-C (FPL'16,OOPSLA'15,CC'15) and Python (FOAC,LMCS,FMSD); -- session types theories (ESOP'20,POPL'19,ESOP'19,ESOP'16,CONCUR'15), automata theories (CAV'19,CONCUR'19,FoSSaCs'17,TACAS'16,CONCUR'15,POPL'15), game semantics (POPL'19,FoSSaCs'19), Implicit Complexity (LICS'18) and linear logic (ESOP'18,FoSSaCs'18,CONCUR'15); or -- mechanisation of session types meta-theory (Coq, Isabelle, Agda, etc) (TACAS 20) -- other applications such as blockchains (FSE'19) and robotics (ECOOP'19) The contact person is Professor Nobuko Yoshida, Imperial College London (n.yoshida at imperial.ac.uk) The candidate is welcome to contact her. Details: https://www.imperial.ac.uk/jobs/description/ENG01270/research-assistant-research-associate From capn.freako at gmail.com Tue Mar 31 18:01:32 2020 From: capn.freako at gmail.com (David Banas) Date: Tue, 31 Mar 2020 11:01:32 -0700 Subject: [Haskell-cafe] How to make a Hashable instance for (Finite n)? Message-ID: <75B96C94-C80E-48ED-B3CC-D707FF08849F@gmail.com> What is the most expedient way to get around this error? Could not deduce (Hashable (Finite n)) Thanks, -db -------------- next part -------------- An HTML attachment was scrubbed... URL: