From george at wils.online Tue Oct 1 00:26:26 2019 From: george at wils.online (George Wilson) Date: Tue, 1 Oct 2019 10:26:26 +1000 Subject: [Haskell-cafe] hackage issues In-Reply-To: <41A1E33EC96C0E4DB3F34B94E130044253666DAE@HSMSMBX2.hs.local> References: <41A1E33EC96C0E4DB3F34B94E130044253666DAE@HSMSMBX2.hs.local> Message-ID: Hi Richard, I'm one of the hackage trustees. I've emailed you off-list. Cheers, George On Tue, 1 Oct 2019 at 09:12, Richard Senington wrote: > > Hi list, > > I have been trying to set up an account on Hackage to upload a project. I have created the account, but cannot get in contact with trustees to enable uploading. My mail servers (a university server) says that it cannot deliver the messages. Can anyone advise or assist? > > Richard > _______________________________________________ > 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 john at coherentgraphics.co.uk Tue Oct 1 16:53:45 2019 From: john at coherentgraphics.co.uk (John Whitington) Date: Tue, 1 Oct 2019 17:53:45 +0100 Subject: [Haskell-cafe] New book: Haskell from the Very Beginning Message-ID: <7656C4D9-118D-42FE-B260-0FD6C4E4EFE6@coherentgraphics.co.uk> Hello, I've prepared a new book "Haskell from the Very Beginning", which has now been published. A printed copy may be obtained from Amazon for $29.99: https://www.amazon.com/dp/095767113X/ (or your equivalent local Amazon) Alternatively, a PDF copy may be obtained for $19.99 from the book's website: https://www.haskellfromtheverybeginning.com Thanks to all those who have helped in recent weeks with useful comments on an earlier draft. And of course, thank-you for Haskell! Here's the blurb: In Haskell from the Very Beginning John Whitington takes a no-prerequisites approach to teaching the basics of a modern general-purpose programming language. Each small, self-contained chapter introduces a new topic, building until the reader can write quite substantial programs. There are plenty of questions and, crucially, worked answers and hints. Haskell from the Very Beginning will appeal both to new programmers, and to experienced programmers eager to explore functional languages such as Haskell. It is suitable both for formal use within an undergraduate or graduate curriculum, and for the interested amateur. Thanks, -- John Whitington Director, Coherent Graphics Ltd From whosekiteneverfly at gmail.com Wed Oct 2 01:39:09 2019 From: whosekiteneverfly at gmail.com (Yuji Yamamoto) Date: Wed, 2 Oct 2019 10:39:09 +0900 Subject: [Haskell-cafe] Publish slides of talks in HIW 2019 (Or whom to ask about it) Message-ID: Hello Haskellers, I'm not sure where is the best place to ask about this, so please tell me if there is better place. Does anyone know when the slides of HIW 2019 will be published in the web site like the last year's ? I see some of the talks are "File Attached", but most of them are not. In addition, can I attach the URL of my lightning talk slides https://the.igreque.info/slides/2019-08-23-indexed-applicative.html to the web site? According to the last year's page, some of the lightning talks are also "File Attached" or "Media Attached". Thanks in advance! -- 山本悠滋 twitter: https://twitter.com/igrep GitHub: https://github.com/igrep GitLab: https://gitlab.com/igrep Facebook: http://www.facebook.com/igrep -------------- next part -------------- An HTML attachment was scrubbed... URL: From rae at richarde.dev Wed Oct 2 08:59:59 2019 From: rae at richarde.dev (Richard Eisenberg) Date: Wed, 2 Oct 2019 09:59:59 +0100 Subject: [Haskell-cafe] Publish slides of talks in HIW 2019 (Or whom to ask about it) In-Reply-To: References: Message-ID: I have cc'd Niki Vazou, the chair of this year's HIW. She'll have the best answers. Richard > On Oct 2, 2019, at 2:39 AM, Yuji Yamamoto wrote: > > Hello Haskellers, > > I'm not sure where is the best place to ask about this, > so please tell me if there is better place. > > Does anyone know when the slides of HIW 2019 will be published in the web site like the last year's ? > I see some of the talks are "File Attached", but most of them are not. > > In addition, can I attach the URL of my lightning talk slides https://the.igreque.info/slides/2019-08-23-indexed-applicative.html to the web site? > According to the last year's page, some of the lightning talks are also "File Attached" or "Media Attached". > > Thanks in advance! > > -- > 山本悠滋 > twitter: https://twitter.com/igrep > GitHub: https://github.com/igrep > GitLab: https://gitlab.com/igrep > Facebook: http://www.facebook.com/igrep _______________________________________________ > 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 profunctor at pm.me Wed Oct 2 22:19:11 2019 From: profunctor at pm.me (Marcin Szamotulski) Date: Wed, 02 Oct 2019 22:19:11 +0000 Subject: [Haskell-cafe] Parametric polymorphism and promoted types Message-ID: Hello Haskell Cafe, It seems that GHC has a trouble recognising that a variable of type `forall (x :: (a, b))` can be reduced to `forall ((u, v) :: (a, b))`. For example in the following snippet `unsafeCoerce` is unavoidable: ``` data P a = P data Proxy (p :: (a, b)) where Proxy :: P a -> P b -> Proxy '(a, b) both0 :: forall (s :: (a, b)). Proxy s both0 = unsafeCoerce (Proxy P P) ``` A slightly nicer solution can be written with type families: ``` type family Fst (p :: (a, b)) :: a where Fst '(x, y) = x type family Snd (p :: (a, b)) :: b where Snd '(x, y) = y data Dict (a :: k) (b :: k) where Dict :: a ~ b => Dict a b instance Category Dict where id = Dict Dict . Dict = Dict proof :: forall (s :: (a, b)). Dict s '(Fst s, Snd s) proof = unsafeCoerce Dict both1 :: forall (s :: (a, b)). Proxy s both1 = case proof :: Dict s '(Fst s, Snd s) of Dict -> Proxy P P ``` Did I missed how to avoid `unsafeCoerce` all together? 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 a.pelenitsyn at gmail.com Wed Oct 2 22:33:30 2019 From: a.pelenitsyn at gmail.com (Artem Pelenitsyn) Date: Wed, 2 Oct 2019 18:33:30 -0400 Subject: [Haskell-cafe] Parametric polymorphism and promoted types In-Reply-To: References: Message-ID: Hey Marcin, Discussed on the GHC bug tracker https://gitlab.haskell.org/ghc/ghc/issues/17072 -- Best, Artem On Wed, Oct 2, 2019, 6:19 PM Marcin Szamotulski via Haskell-Cafe < haskell-cafe at haskell.org> wrote: > Hello Haskell Cafe, > > It seems that GHC has a trouble recognising that a variable of type > > `forall (x :: (a, b))` can be reduced to `forall ((u, v) :: (a, b))`. > > For example in the following snippet `unsafeCoerce` is unavoidable: > > ``` > data P a = P > > data Proxy (p :: (a, b)) where > Proxy :: P a -> P b -> Proxy '(a, b) > > both0 :: forall (s :: (a, b)). Proxy s > both0 = unsafeCoerce (Proxy P P) > ``` > > > A slightly nicer solution can be written with type families: > > ``` > type family Fst (p :: (a, b)) :: a where > Fst '(x, y) = x > > type family Snd (p :: (a, b)) :: b where > Snd '(x, y) = y > > data Dict (a :: k) (b :: k) where > Dict :: a ~ b => Dict a b > > instance Category Dict where > id = Dict > Dict . Dict = Dict > > proof :: forall (s :: (a, b)). Dict s '(Fst s, Snd s) > proof = unsafeCoerce Dict > > both1 :: forall (s :: (a, b)). Proxy s > both1 = case proof :: Dict s '(Fst s, Snd s) of > Dict -> Proxy P P > ``` > > Did I missed how to avoid `unsafeCoerce` all together? > > Best regards, > Marcin Szamotulski_______________________________________________ > 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 whosekiteneverfly at gmail.com Wed Oct 2 22:45:38 2019 From: whosekiteneverfly at gmail.com (Yuji Yamamoto) Date: Thu, 3 Oct 2019 07:45:38 +0900 Subject: [Haskell-cafe] Publish slides of talks in HIW 2019 (Or whom to ask about it) In-Reply-To: References: Message-ID: Great, thanks! 2019年10月2日(水) 18:00 Richard Eisenberg : > I have cc'd Niki Vazou, the chair of this year's HIW. She'll have the best > answers. > > Richard > > On Oct 2, 2019, at 2:39 AM, Yuji Yamamoto > wrote: > > Hello Haskellers, > > I'm not sure where is the best place to ask about this, > so please tell me if there is better place. > > Does anyone know when the slides of HIW 2019 will be published in the web > site like the last > year's ? > I see some of the talks are "File Attached", but most of them are not. > > In addition, can I attach the URL of my lightning talk slides > https://the.igreque.info/slides/2019-08-23-indexed-applicative.html to > the web site? > According to the last year's page, some of the lightning talks are also > "File Attached" or "Media Attached". > > Thanks in advance! > > -- > 山本悠滋 > twitter: https://twitter.com/igrep > GitHub: https://github.com/igrep > GitLab: https://gitlab.com/igrep > Facebook: http://www.facebook.com/igrep > _______________________________________________ > 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. > > > -- 山本悠滋 twitter: https://twitter.com/igrep GitHub: https://github.com/igrep GitLab: https://gitlab.com/igrep Facebook: http://www.facebook.com/igrep -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at well-typed.com Thu Oct 3 08:11:47 2019 From: adam at well-typed.com (Adam Gundry) Date: Thu, 3 Oct 2019 09:11:47 +0100 Subject: [Haskell-cafe] Parametric polymorphism and promoted types In-Reply-To: References: Message-ID: <01de375e-764a-404d-2b41-9486878e148e@well-typed.com> Hi Marcin, This is a long-standing feature request in GHC (see https://gitlab.haskell.org/ghc/ghc/issues/7259). System FC doesn't have eta-laws for products, i.e. it does not have forall (s :: (a, b)) . s ~ '(Fst s, Snd s) even though in principle it should be sound to add such axioms to the theory. Unfortunately in practice adding such axioms would currently be unsound due to #14420. As you've observed, one can essentially assert such an axiom using unsafeCoerce. There are various different ways to package this up nicely, but they all involve equivalent forms of unsafety, and all are type-unsound in the presence of #14420. Although the unsoundness is unlikely to bite unless you really try... I've attached a module illustrating this. Hope this helps, Adam On 02/10/2019 23:19, Marcin Szamotulski via Haskell-Cafe wrote: > Hello Haskell Cafe, > > It seems that GHC has a trouble recognising that a variable of type > > `forall (x :: (a, b))` can be reduced to `forall ((u, v) :: (a, b))`. > > For example in the following snippet `unsafeCoerce` is unavoidable: > > ``` > data P a = P > > data Proxy (p :: (a, b)) where > Proxy :: P a -> P b -> Proxy '(a, b) > > both0 :: forall (s :: (a, b)). Proxy s > both0 = unsafeCoerce (Proxy P P) > ``` > > > A slightly nicer solution can be written with type families: > > ``` > type family Fst (p :: (a, b)) :: a where > Fst '(x, y) = x > > type family Snd (p :: (a, b)) :: b where > Snd '(x, y) = y > > data Dict (a :: k) (b :: k) where > Dict :: a ~ b => Dict a b > > instance Category Dict where > id = Dict > Dict . Dict = Dict > > proof :: forall (s :: (a, b)). Dict s '(Fst s, Snd s) > proof = unsafeCoerce Dict > > both1 :: forall (s :: (a, b)). Proxy s > both1 = case proof :: Dict s '(Fst s, Snd s) of > Dict -> Proxy P P > ``` > > Did I missed how to avoid `unsafeCoerce` all together? > > Best regards, > Marcin Szamotulski -- Adam Gundry, Haskell Consultant Well-Typed LLP, https://www.well-typed.com/ Registered in England & Wales, OC335890 118 Wymering Mansions, Wymering Road, London W9 2NF, England -------------- next part -------------- A non-text attachment was scrubbed... Name: EtaProducts.hs Type: text/x-haskell Size: 1047 bytes Desc: not available URL: From rae at richarde.dev Thu Oct 3 08:14:36 2019 From: rae at richarde.dev (Richard Eisenberg) Date: Thu, 3 Oct 2019 09:14:36 +0100 Subject: [Haskell-cafe] Parametric polymorphism and promoted types In-Reply-To: References: Message-ID: This *is* on the GHC issue tracker, but I think the ticket Artem has linked to is about a different concern. I think you want #7259 (https://gitlab.haskell.org/ghc/ghc/issues/7259 ). Right now, doing this expansion is potentially unsound, actually, as the type system can be abused to make a (p :: (a, b)) that is not a pair. :( Further research needs to be done before we know how to fix this, sadly. Richard > On Oct 2, 2019, at 11:19 PM, Marcin Szamotulski via Haskell-Cafe wrote: > > Hello Haskell Cafe, > > It seems that GHC has a trouble recognising that a variable of type > > `forall (x :: (a, b))` can be reduced to `forall ((u, v) :: (a, b))`. > > For example in the following snippet `unsafeCoerce` is unavoidable: > > ``` > data P a = P > > data Proxy (p :: (a, b)) where > Proxy :: P a -> P b -> Proxy '(a, b) > > both0 :: forall (s :: (a, b)). Proxy s > both0 = unsafeCoerce (Proxy P P) > ``` > > > A slightly nicer solution can be written with type families: > > ``` > type family Fst (p :: (a, b)) :: a where > Fst '(x, y) = x > > type family Snd (p :: (a, b)) :: b where > Snd '(x, y) = y > > data Dict (a :: k) (b :: k) where > Dict :: a ~ b => Dict a b > > instance Category Dict where > id = Dict > Dict . Dict = Dict > > proof :: forall (s :: (a, b)). Dict s '(Fst s, Snd s) > proof = unsafeCoerce Dict > > both1 :: forall (s :: (a, b)). Proxy s > both1 = case proof :: Dict s '(Fst s, Snd s) of > Dict -> Proxy P P > ``` > > Did I missed how to avoid `unsafeCoerce` all together? > > Best regards, > Marcin Szamotulski_______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From sjcjoosten+haskelcafe at gmail.com Thu Oct 3 20:55:24 2019 From: sjcjoosten+haskelcafe at gmail.com (Sebastiaan Joosten) Date: Thu, 3 Oct 2019 16:55:24 -0400 Subject: [Haskell-cafe] Avoiding code-duplication for what is roughly fmap Message-ID: Hi all, I'm writing a lot of code that looks like this: instance WhiteSpaced ClassItem where removeWS (Method a b c) = Method (removeWS a) (removeWS b) (removeWS c) removeWS (Declaration b) = Declaration (removeWS b) Typically, all the way at the end there's an instance that deviates (sometimes the deviating instances are somewhere in the middle). I need to do this for a lot of functions, and a lot of data types, and all I'm doing here is rewriting the data-type declaration in a different syntax (except that you do not know the types of a, b and c from the above). For the sake of maintainability, I want to avoid this code-duplication and focus only on the deviating instances. How to do better? I don't see how to use generics (in the hope of only writing 'instance WhiteSpaced ClassItem where' instead of the three lines above) for this: the types for a, b and c are all different here. Would this be easier with Template Haskell? (in the hope of only writing $(''something ClassItem) instead of the three lines above) My main concern is maintainability, an ideal solution is either a clear one-liner or a library import (in the same way that aeson allows me to use generics or Template Haskell without needing to know much about them). Other solutions are welcome too. Best, Sebastiaan -------------- next part -------------- An HTML attachment was scrubbed... URL: From whosekiteneverfly at gmail.com Thu Oct 3 22:41:29 2019 From: whosekiteneverfly at gmail.com (Yuji Yamamoto) Date: Fri, 4 Oct 2019 07:41:29 +0900 Subject: [Haskell-cafe] Avoiding code-duplication for what is roughly fmap In-Reply-To: References: Message-ID: Use DeriveGenerics, and higgledy (or some packages supporting higher kinded data) would help you. 2019年10月4日(金) 5:56 Sebastiaan Joosten : > Hi all, > > I'm writing a lot of code that looks like this: > instance WhiteSpaced ClassItem where > removeWS (Method a b c) = Method (removeWS a) (removeWS b) (removeWS c) > removeWS (Declaration b) = Declaration (removeWS b) > > Typically, all the way at the end there's an instance that deviates > (sometimes the deviating instances are somewhere in the middle). I need to > do this for a lot of functions, and a lot of data types, and all I'm doing > here is rewriting the data-type declaration in a different syntax (except > that you do not know the types of a, b and c from the above). For the sake > of maintainability, I want to avoid this code-duplication and focus only on > the deviating instances. > > How to do better? I don't see how to use generics (in the hope of only > writing 'instance WhiteSpaced ClassItem where' instead of the three lines > above) for this: the types for a, b and c are all different here. Would > this be easier with Template Haskell? (in the hope of only writing > $(''something ClassItem) instead of the three lines above) > > My main concern is maintainability, an ideal solution is either a clear > one-liner or a library import (in the same way that aeson allows me to use > generics or Template Haskell without needing to know much about them). > Other solutions are welcome too. > > Best, > > Sebastiaan > _______________________________________________ > 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. -- 山本悠滋 twitter: https://twitter.com/igrep GitHub: https://github.com/igrep GitLab: https://gitlab.com/igrep Facebook: http://www.facebook.com/igrep -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Fri Oct 4 03:23:26 2019 From: david.feuer at gmail.com (David Feuer) Date: Thu, 3 Oct 2019 23:23:26 -0400 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: <87tv91gzk9.fsf@smart-cactus.org> References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> Message-ID: Any news? On Tue, Sep 24, 2019, 5:22 PM Ben Gamari wrote: > Dan Burton writes: > > > Will base-4.13.0.0 (which ships with ghc 8.8) be uploaded to hackage? > > > Yes, although it's currently waiting for someone with maintainer rights > for `base`, et al to push them. I have requested access myself although > haven't yet heard back. > > Cheers, > > - Ben > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at well-typed.com Fri Oct 4 03:30:14 2019 From: ben at well-typed.com (Ben Gamari) Date: Thu, 03 Oct 2019 23:30:14 -0400 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> Message-ID: <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> On October 3, 2019 11:23:26 PM EDT, David Feuer wrote: >Any news? > >On Tue, Sep 24, 2019, 5:22 PM Ben Gamari wrote: > >> Dan Burton writes: >> >> > Will base-4.13.0.0 (which ships with ghc 8.8) be uploaded to >hackage? >> > >> Yes, although it's currently waiting for someone with maintainer >rights >> for `base`, et al to push them. I have requested access myself >although >> haven't yet heard back. >> The issue (#17246) is still blocked on others. One issue is that uploading the 8.8 boot packages first requires that hackage.haskell.org to be upgraded and no Hackage admin has had time to do this yet. Cheers, - Ben _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Fri Oct 4 07:38:33 2019 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 4 Oct 2019 08:38:33 +0100 Subject: [Haskell-cafe] Avoiding code-duplication for what is roughly fmap In-Reply-To: References: Message-ID: <20191004073833.wsqsenamnowlfe22@weber> On Thu, Oct 03, 2019 at 04:55:24PM -0400, Sebastiaan Joosten wrote: > I'm writing a lot of code that looks like this: > instance WhiteSpaced ClassItem where > removeWS (Method a b c) = Method (removeWS a) (removeWS b) (removeWS c) > removeWS (Declaration b) = Declaration (removeWS b) I'll give you an example using product-profunctors, but could you provide the class and data type definitions? I'd like the example to actually reflect the reality of the situation you are dealing with. From seph at codex.scot Fri Oct 4 18:51:18 2019 From: seph at codex.scot (Seph Shewell Brockway) Date: Fri, 4 Oct 2019 19:51:18 +0100 Subject: [Haskell-cafe] LGtk Message-ID: <20191004185118.ebbimp6cuz3bgq2m@leviathan> Does anyone know what happened to the LGtk project? I really like its declarative approach to writing GUIs, but it doesn’t seem to be being actively maintained. -- Seph Shewell Brockway, BSc MSc (Glas.) Pronouns: she/her From profunctor at pm.me Fri Oct 4 20:04:11 2019 From: profunctor at pm.me (Marcin Szamotulski) Date: Fri, 04 Oct 2019 20:04:11 +0000 Subject: [Haskell-cafe] Parametric polymorphism and promoted types In-Reply-To: References: Message-ID: Thanks Artem, Adam and Richard for the code, explanation and links, it's makes the problem clear. Best regards, Marcin ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐ On Thursday, 3 October 2019 08:14, Richard Eisenberg wrote: > This *is* on the GHC issue tracker, but I think the ticket Artem has linked to is about a different concern. I think you want #7259 (https://gitlab.haskell.org/ghc/ghc/issues/7259). Right now, doing this expansion is potentially unsound, actually, as the type system can be abused to make a (p :: (a, b)) that is not a pair. :( > > Further research needs to be done before we know how to fix this, sadly. > > Richard > > > On Oct 2, 2019, at 11:19 PM, Marcin Szamotulski via Haskell-Cafe wrote: > > > > Hello Haskell Cafe, > > > > It seems that GHC has a trouble recognising that a variable of type > > > > `forall (x :: (a, b))` can be reduced to `forall ((u, v) :: (a, b))`. > > > > For example in the following snippet `unsafeCoerce` is unavoidable: > > > > ``` > > data P a = P > > > > data Proxy (p :: (a, b)) where > >    Proxy :: P a -> P b -> Proxy '(a, b) > > > > both0 :: forall (s :: (a, b)).  Proxy s > > both0 = unsafeCoerce (Proxy P P) > > ``` > > > > A slightly nicer solution can be written with type families: > > > > ``` > > type family Fst (p :: (a, b)) :: a where > >  Fst '(x, y) = x > > > > type family Snd (p :: (a, b)) :: b where > >  Snd '(x, y) = y > > > > data Dict (a :: k) (b :: k) where > >    Dict :: a ~ b => Dict a b > > > > instance Category Dict where > >    id = Dict > >    Dict . Dict = Dict > > > > proof :: forall (s :: (a, b)). Dict s '(Fst s, Snd s) > > proof = unsafeCoerce Dict > > > > both1 :: forall (s :: (a, b)).  Proxy s > > both1 = case proof :: Dict s '(Fst s, Snd s) of > >    Dict -> Proxy P P > > ``` > > > > Did I missed how to avoid `unsafeCoerce` all together? > > > > Best regards, > > Marcin Szamotulski_______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 477 bytes Desc: OpenPGP digital signature URL: From sjcjoosten+haskelcafe at gmail.com Fri Oct 4 20:06:54 2019 From: sjcjoosten+haskelcafe at gmail.com (Sebastiaan Joosten) Date: Fri, 4 Oct 2019 16:06:54 -0400 Subject: [Haskell-cafe] Avoiding code-duplication for what is roughly fmap In-Reply-To: References: Message-ID: Using generics and default worked brilliantly, thanks! I didn't use higgledy, so let me know if I missed an opportunity for something. I just wanted to post my solution here. My only questions would be: isn't there a library on hackage that already does this? However, anyone reading who just want to learn how to use generics, I recommend reading http://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming, as that's basically all I needed to learn how to do this. (Nathan's link pointed me there, again: thanks!) For getting everything to work, I added {-# LANGUAGE TypeOperators, DefaultSignatures #-} (GHC is great at telling me what to enable). I was able to write a generic version for removing whitespace, which essentially is an fmap. To derive an instance, I can indeed just write: instance WhiteSpaced ClassItem where The most straightforward thing to do, is to write a generic GWhiteSpaced class and then the WhiteSpaced class. Here is what I wrote: class GWhiteSpaced f where gremoveWS :: f a -> f a -- generic version of removeWS instance GWhiteSpaced U1 where gremoveWS U1 = U1 instance (GWhiteSpaced a, GWhiteSpaced b) => GWhiteSpaced (a :*: b) where gremoveWS (x :*: y) = gremoveWS x :*: gremoveWS y instance (GWhiteSpaced a, GWhiteSpaced b) => GWhiteSpaced (a :+: b) where gremoveWS (L1 x) = L1 $ gremoveWS x gremoveWS (R1 x) = R1 $ gremoveWS x instance (GWhiteSpaced a) => GWhiteSpaced (M1 i c a) where gremoveWS (M1 x) = M1 $ gremoveWS x instance (WhiteSpaced a) => GWhiteSpaced (K1 i a) where gremoveWS (K1 x) = K1 $ removeWS x class WhiteSpaced a where removeWS :: a -> a -- remove as much whitespace as possible without changing semantics default removeWS :: (GWhiteSpaced (Rep a), Generic a) => a -> a removeWS = GHC.Generics.to . gremoveWS . from This really helps generalize things in those cases where the data-structure changes, but the WhiteSpaced class is not the only class that follows this pattern. Naturally, I would like to: - avoid repeating the generic class for each fmap-like class (renaming method-names, simplifying expressions, etc, are all very similar functions). - and ideally remove the circular dependency, so I can put the generic classes into separate modules without getting orphaned instances for the specific ones. I managed to do both with a single solution. First of all, I will use a phantom type to keep track of which instance to use. If you haven't seen a phantom type: it's just a convenient way of binding type variables and passing those around. I'd love to use the default one in the Prelude / RIO, but I can never find it and getting an extra dependency is not worth it, so I always end up defining one: data Phantom k = Phantom I'll use this phantom type later when I create an empty datatype (as empty as they get) whose only purpose is to denote that I'm using the whitespace function. Using Phantom types, I can unambiguously define: class FmapLike k f where gmap :: Phantom k -> f a -> f a class FmapInstance k a where gmapinstance :: Phantom k -> a -> a Note that the *only* purpose of the type variable k here, is to enable reuse: by filling in different values for k, I can instantiate whitespaces and other fmap-like functions in the same way. Otherwise, FmapLike and FmapInstance just mimick GWhiteSpaced and WhiteSpaced respectively. My generic FmapLike function is nearly the same as my generic whitespace function, the only thing I add is passing the type variable around: instance FmapLike x U1 where gmap _ U1 = U1 instance (FmapLike x a, FmapLike x b) => FmapLike x (a :*: b) where gmap f (x :*: y) = gmap f x :*: gmap f y instance (FmapLike x a, FmapLike x b) => FmapLike x (a :+: b) where gmap f (L1 x) = L1 $ gmap f x gmap f (R1 x) = R1 $ gmap f x instance (FmapLike x a) => FmapLike x (M1 i c a) where gmap f (M1 x) = M1 $ gmap f x instance FmapInstance x a => FmapLike x (K1 i a) where gmap f (K1 x) = K1 $ gmapinstance f x Now to define the WhiteSpace class as before, I just need six lines. Furthermore, these six lines can be in a separate file without creating orphaned instances: data WS class WhiteSpaced a where removeWS :: a -> a -- remove as much whitespace as possible without changing semantics default removeWS :: (FmapLike WS (Rep a), Generic a) => a -> a removeWS = GHC.Generics.to . gmap (Phantom::Phantom WS) . from instance WhiteSpaced a => FmapInstance WS a where gmapinstance _ = removeWS (The instance is not an orphan because WS is defined here) Note that instead of WS, I could use any other datatype token, it doesn't have to be an empty datatype. I'm just defining it as an empty datatype to make it absolutely clear that it's not storing any data. It also provides a good place to document what WS is actually intended for. As a final touch, I'm defining: gmapGeneric = (\x -> GHC.Generics.to . gmap x . from) (this shortens removeWS a little) So final question: is there any library that implements gmapGeneric or gmap? Also a big thanks to everyone who helped put Generics in Haskell. I've seen helpful error messages and good documentation all the way through! Best, Sebastiaan On Thu, Oct 3, 2019 at 6:41 PM Yuji Yamamoto wrote: > Use DeriveGenerics, and higgledy > (or some packages supporting higher kinded data) would help you. > > 2019年10月4日(金) 5:56 Sebastiaan Joosten : > >> Hi all, >> >> I'm writing a lot of code that looks like this: >> instance WhiteSpaced ClassItem where >> removeWS (Method a b c) = Method (removeWS a) (removeWS b) (removeWS c) >> removeWS (Declaration b) = Declaration (removeWS b) >> >> Typically, all the way at the end there's an instance that deviates >> (sometimes the deviating instances are somewhere in the middle). I need to >> do this for a lot of functions, and a lot of data types, and all I'm doing >> here is rewriting the data-type declaration in a different syntax (except >> that you do not know the types of a, b and c from the above). For the sake >> of maintainability, I want to avoid this code-duplication and focus only on >> the deviating instances. >> >> How to do better? I don't see how to use generics (in the hope of only >> writing 'instance WhiteSpaced ClassItem where' instead of the three lines >> above) for this: the types for a, b and c are all different here. Would >> this be easier with Template Haskell? (in the hope of only writing >> $(''something ClassItem) instead of the three lines above) >> >> My main concern is maintainability, an ideal solution is either a clear >> one-liner or a library import (in the same way that aeson allows me to use >> generics or Template Haskell without needing to know much about them). >> Other solutions are welcome too. >> >> Best, >> >> Sebastiaan >> _______________________________________________ >> 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. > > > > -- > 山本悠滋 > twitter: https://twitter.com/igrep > GitHub: https://github.com/igrep > GitLab: https://gitlab.com/igrep > Facebook: http://www.facebook.com/igrep > -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.casanova at ed.ac.uk Fri Oct 4 21:08:32 2019 From: juan.casanova at ed.ac.uk (Juan Casanova) Date: Fri, 04 Oct 2019 22:08:32 +0100 Subject: [Haskell-cafe] Optional "Default" instances of classes in certain subcases (but too broad) Message-ID: <20191004220832.58192rk5cwleglwk@www.staffmail.ed.ac.uk> Hello again, Before my question, I notice I am using this list quite a bit. I hope I am no abusing or misusing it by doing so, though. Sometimes I wonder what's the line between what I should ask here and what I should ask in StackOverflow, if that line even exists. If anyone feels I may be abusing or misusing, please let me know (in public or in private). Very simple question: Would it make sense, or does it already exist, a way to implement *optional* default instances of classes that can be used more directly than currently. I am *not* talking about providing a default implementation of a class when declaring it. I know you can do this. I am talking about when you know you can provide a generic instance of a class for a wide range of situations *which depends on some constraints*. For example: instance Bifunctor f => Functor (f a) where fmap = bimap id Of course, this is a terrible idea, because the constraints are not checked when verifying overlap and the like, and so this is very likely to break your program. What I tend to do nowadays is to add a function: fmapFromBiMap :: Bifunctor f => (b -> c) -> (f a b) -> (f a c) fmapFromBiMap = bimap id and then use it each time (the following is obviously a silly example): instance Functor (Either a) where fmap = fmapFromBiMap The only problem I see with this is that I need to remember (specially with my own type classes): 1. That I provided this "default" implementation. 2. Its name. I know these are fairly small things to complain about, but once again when you do it 100 times it becomes annoying, specially for a person who absolutely does not like doing things that I know would be able to explain how to automate. So, what I would expect is for it to be something like declaring the default instance but only use it for the types that explicitly ask for it. E.g.: optional instance Bifunctor f => Functor (f a) where fmap = bimap id instance Functor (Either a) using optional The main important point here is that I expect this to check the constraints in compile time for the class that I am giving (and if it contains type variables, only use those that are guaranteed to be complied, of course). This means that if I did: instance Functor (f a) using optional I *do not* expect it to be okay with it and automatically add the constraint Bifunctor f => to the instance. I expect it to give me a compile error: "No matching optional instance found". Of course, there could be several optional instances that overlap when using optional. But then, GHC would give me the error indicating what the options are *and I would know that it's because I put optional* and I could just replace it with the specific one to use. Maybe by giving them names? optional instance fmapFromBiMap Bifunctor f => Functor (f a) where fmap = bimap id instance Functor (Either a) using optional -- If this does not work because it overlaps with other optionals, then GHC tells me, indicates the options, and I replace with: instance Functor (Either a) using fmapFromBiMap This avoids the problem of defining the instance in general (that it will overlap with basically anything), should be easy to type check and prevents having to keep an index in your mind about useful functions that you implemented or didn't. I wonder if the "deriving" family of functionalities have anything like this, but my search has not been fruitful. Maybe using Generics? Maybe I just need good autocomplete so that I can find the function easily... it still feels like this would make sense. Juan. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From lexi.lambda at gmail.com Sat Oct 5 01:21:22 2019 From: lexi.lambda at gmail.com (Alexis King) Date: Fri, 4 Oct 2019 20:21:22 -0500 Subject: [Haskell-cafe] Optional "Default" instances of classes in certain subcases (but too broad) In-Reply-To: <20191004220832.58192rk5cwleglwk@www.staffmail.ed.ac.uk> References: <20191004220832.58192rk5cwleglwk@www.staffmail.ed.ac.uk> Message-ID: <61B56567-3BA5-436E-8F19-B724AC04F577@gmail.com> Hello, The recent DerivingVia language extension is, in many ways, designed to accommodate the use cases you describe. Instead of defining “optional” instances, you attach instances to a relevant newtype, then use that newtype with DerivingVia to reuse instances. So, for example, you could define a WrappedBifunctor newtype: newtype WrappedBifunctor f a b = WrappedBifunctor { unWrappedBifunctor :: f a b } deriving newtype (Bifunctor) …then declare the following instance: instance Bifunctor f => Functor (WrappedBifunctor f a) where fmap = bimap id Then if you have a type with an explicit Bifunctor instance, you can write: data F a b = ... deriving (Functor) via WrappedBifunctor F …or, with StandaloneDeriving: deriving via (WrappedBifunctor F) instance Functor (F a) Does that accommodate the use cases you’re looking for? Alexis > On Oct 4, 2019, at 16:08, Juan Casanova wrote: > > Hello again, > > Before my question, I notice I am using this list quite a bit. I hope I am no abusing or misusing it by doing so, though. Sometimes I wonder what's the line between what I should ask here and what I should ask in StackOverflow, if that line even exists. If anyone feels I may be abusing or misusing, please let me know (in public or in private). > > Very simple question: Would it make sense, or does it already exist, a way to implement *optional* default instances of classes that can be used more directly than currently. > > I am *not* talking about providing a default implementation of a class when declaring it. I know you can do this. > > I am talking about when you know you can provide a generic instance of a class for a wide range of situations *which depends on some constraints*. For example: > > instance Bifunctor f => Functor (f a) where > fmap = bimap id > > Of course, this is a terrible idea, because the constraints are not checked when verifying overlap and the like, and so this is very likely to break your program. What I tend to do nowadays is to add a function: > > fmapFromBiMap :: Bifunctor f => (b -> c) -> (f a b) -> (f a c) > fmapFromBiMap = bimap id > > and then use it each time (the following is obviously a silly example): > > instance Functor (Either a) where > fmap = fmapFromBiMap > > The only problem I see with this is that I need to remember (specially with my own type classes): 1. That I provided this "default" implementation. 2. Its name. I know these are fairly small things to complain about, but once again when you do it 100 times it becomes annoying, specially for a person who absolutely does not like doing things that I know would be able to explain how to automate. > > So, what I would expect is for it to be something like declaring the default instance but only use it for the types that explicitly ask for it. E.g.: > > optional instance Bifunctor f => Functor (f a) where > fmap = bimap id > > instance Functor (Either a) using optional > > The main important point here is that I expect this to check the constraints in compile time for the class that I am giving (and if it contains type variables, only use those that are guaranteed to be complied, of course). This means that if I did: > > instance Functor (f a) using optional > > I *do not* expect it to be okay with it and automatically add the constraint Bifunctor f => to the instance. I expect it to give me a compile error: "No matching optional instance found". > > Of course, there could be several optional instances that overlap when using optional. But then, GHC would give me the error indicating what the options are *and I would know that it's because I put optional* and I could just replace it with the specific one to use. Maybe by giving them names? > > optional instance fmapFromBiMap Bifunctor f => Functor (f a) where > fmap = bimap id > > instance Functor (Either a) using optional -- If this does not work because it overlaps with other optionals, then GHC tells me, indicates the options, and I replace with: > > instance Functor (Either a) using fmapFromBiMap > > This avoids the problem of defining the instance in general (that it will overlap with basically anything), should be easy to type check and prevents having to keep an index in your mind about useful functions that you implemented or didn't. > > I wonder if the "deriving" family of functionalities have anything like this, but my search has not been fruitful. Maybe using Generics? > > Maybe I just need good autocomplete so that I can find the function easily... it still feels like this would make sense. > > Juan. > > -- > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. > > > _______________________________________________ > 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 marc at lamarciana.com Sat Oct 5 13:35:04 2019 From: marc at lamarciana.com (=?ISO-8859-15?Q?Marc_Busqu=E9?=) Date: Sat, 5 Oct 2019 15:35:04 +0200 (CEST) Subject: [Haskell-cafe] hie + neovim + coc.nvim on NixOS Message-ID: Hi Cafe, this is an adapted version of a question I already posted on NixOS discussion forum, so far with no luck [1]: I’m trying to replicate the configuration from an article on a NixOS machine [2]. That’s, I’m trying to use hie on neovim, through coc.nvim, with NixOS as operating system. For now, I want it to work for a project which uses GHC 8.6.5 through Stack. So far I’ve been able to: - Install hie version for GHC 8.6.5: ``` let all-hies = import (fetchTarball "https://github.com/infinisil/all-hies/tarball/master") {}; in { environment.systemPackages = with pkgs; [ (all-hies.selection { selector = p: { inherit (p) ghc865; }; }) ]; ``` - Install neovim 4.x to have floating window feauture, which is only available in master, as far as I know: ``` let nixPkgsMaster = import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/master") {}; in { environment.systemPackages = with pkgs; [ nixPkgsMaster.neovim ]; } ``` - I configured coc.nvim [3] to use hie, together with `haskell-vim` plugin. I'm using Plug for this: ``` Plug 'neoclide/coc.nvim', { 'do': 'yarn install --frozen-lockfile' } Plug 'neovimhaskell/haskell-vim' ``` And I have configured coc.nvim as its documentation suggests [4]. - I found that having hie for GHC 8.6.5 was not enough and that I had to install manually the compiler for 8.6.5. I think it is needed in NixOS. If I’m wrong, please, tell me. So, I added `haskell.compiler.ghc865` in `environment.systemPackages`. - Besides, I have following haskell tools: `haskellPackages.hlint`, `haskellPackages.apply-refact` and `haskellPackages.hindent`. With all of that, hie is somehow working on neovim, but there are a lot of things missing. For example, one thing that is working is `:call CocAction('format')`. It also points me to some hlint warnings underlying their lines. However, there are a lot of functionalities missing. - Autocompletion is anything but intellisense. - I can’t quickfix hlint warnings. It says `[coc.nvim] No quickfix action available` - Trying to rename returns `[coc.nvim] Error on 'rename': rename: "HaRe: file not loaded for refactoring"` - It gives me no type information when I press K on a word (being K mapped as coc.nvim suggests) I think that my NixOS configuration is the culprit here, because I’m not too experienced with it and I see it needs to be very specific when configuring haskell. I’m wondering if I’m missing some extra haskell package. I tried with `haskell.packages.ghc865.hoogle` hoping it would make a difference in showing me types or documentation, but no luck here. Thanks for any insight you can give me. - [1] https://discourse.nixos.org/t/configuration-needed-for-haskell-ide-environment/4240 - [2] http://marco-lopes.com/articles/Vim-and-Haskell-in-2019/ - [3] https://github.com/neoclide/coc.nvim - [4] https://github.com/neoclide/coc.nvim#example-vim-configuration Marc Busqué http://waiting-for-dev.github.io/about/ From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Sat Oct 5 14:40:55 2019 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Sat, 5 Oct 2019 15:40:55 +0100 Subject: [Haskell-cafe] Avoiding code-duplication for what is roughly fmap In-Reply-To: <20191004073833.wsqsenamnowlfe22@weber> References: <20191004073833.wsqsenamnowlfe22@weber> Message-ID: <20191005144055.3cbe2tn53nzbuuqe@weber> On Fri, Oct 04, 2019 at 08:38:33AM +0100, Tom Ellis wrote: > On Thu, Oct 03, 2019 at 04:55:24PM -0400, Sebastiaan Joosten wrote: > > I'm writing a lot of code that looks like this: > > instance WhiteSpaced ClassItem where > > removeWS (Method a b c) = Method (removeWS a) (removeWS b) (removeWS c) > > removeWS (Declaration b) = Declaration (removeWS b) > > I'll give you an example using product-profunctors, but could you provide > the class and data type definitions? I'd like the example to actually > reflect the reality of the situation you are dealing with. It sounds like you've already got a satisfactory implementation using generics. I'll give a sketch of the product-profunctors version. It is, itself, a sort of generics library. {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE UndecidableInstances #-} import Data.Profunctor (Profunctor, dimap) import Data.Profunctor.Product (ProductProfunctor, SumProfunctor, empty, (***!), defaultEmpty, defaultProfunctorProduct) import Data.Profunctor.Product.Default (Default, def) -- The thing we're trying to generate newtype WhiteSpaced a b = WhiteSpaced { removeWSExplicit :: a -> b } -- Some data types whose implementation we won't bother giving data Contract data MethodHeader data DefinitionExpr data Balanced -- A data type to which we're interested in giving a default -- "WhiteSpaced" instance of some sort data ClassItem = Method Contract MethodHeader DefinitionExpr | Declaration Balanced -- The typeclass polymorphic function we're interested in removeWS :: Default WhiteSpaced a a => a -> a removeWS = removeWSExplicit def -- Boilerplate instance. Generally derived by TH or generics, but -- that's not implemented for sum types yet ... instance ( SumProfunctor p , ProductProfunctor p , Default p Contract Contract , Default p MethodHeader MethodHeader , Default p DefinitionExpr DefinitionExpr , Default p Balanced Balanced ) => Default p ClassItem ClassItem where def = error "To be filled in -- by hand, TH, or generics" -- Boilerplate instances. I believe they can be derived via "deriving -- via newtype". instance Functor (WhiteSpaced a) where fmap f = WhiteSpaced . fmap f . removeWSExplicit instance Applicative (WhiteSpaced a) where pure = WhiteSpaced . pure f <*> x = WhiteSpaced (removeWSExplicit f <*> removeWSExplicit x) instance Profunctor WhiteSpaced where dimap f g = WhiteSpaced . dimap f g . removeWSExplicit instance ProductProfunctor WhiteSpaced where empty = defaultEmpty (***!) = defaultProfunctorProduct From ietf-dane at dukhovni.org Sun Oct 6 06:36:19 2019 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Sun, 6 Oct 2019 02:36:19 -0400 Subject: [Haskell-cafe] Problematic fixed "stack ghci" temporary script (parent) directory Message-ID: <9B98E614-4887-40B5-8CCD-A6A3C33AC45E@dukhovni.org> When I run "stack ghci", an attempt is made to create a temporary directory named: /tmp/haskell-stack-ghci/ in which various temporary artefacts are stored. The parent directory is created with permissions (0777 & ~umask). Security issues aside, this can't work reliably on a multi-user system. Does anyone know whether this is something peculiar to my FreeBSD setup, or a systemic issue with "stack ghci"? I don't see the same behaviour with "stack script", though if I create a script to run in "/tmp", then ghc is, somewhat unexpectely, executed with "-i/tmp/", which also has security implications... -- Viktor. From vamchale at gmail.com Sun Oct 6 16:24:50 2019 From: vamchale at gmail.com (Vanessa McHale) Date: Sun, 6 Oct 2019 11:24:50 -0500 Subject: [Haskell-cafe] Problematic fixed "stack ghci" temporary script (parent) directory In-Reply-To: <9B98E614-4887-40B5-8CCD-A6A3C33AC45E@dukhovni.org> References: <9B98E614-4887-40B5-8CCD-A6A3C33AC45E@dukhovni.org> Message-ID: <15230c8b-0610-a0fc-f8d4-ca67e0b912d3@gmail.com> Does cabal repl work? On 10/6/19 1:36 AM, Viktor Dukhovni wrote: > When I run "stack ghci", an attempt is made to create a temporary > directory named: > > /tmp/haskell-stack-ghci/ > > in which various temporary artefacts are stored. The parent > directory is created with permissions (0777 & ~umask). > > Security issues aside, this can't work reliably on a multi-user > system. Does anyone know whether this is something peculiar > to my FreeBSD setup, or a systemic issue with "stack ghci"? > > I don't see the same behaviour with "stack script", though > if I create a script to run in "/tmp", then ghc is, somewhat > unexpectely, executed with "-i/tmp/", which also has security > implications... > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: OpenPGP digital signature URL: From mgsloan at gmail.com Sun Oct 6 17:06:26 2019 From: mgsloan at gmail.com (Michael Sloan) Date: Sun, 6 Oct 2019 11:06:26 -0600 Subject: [Haskell-cafe] Problematic fixed "stack ghci" temporary script (parent) directory In-Reply-To: <9B98E614-4887-40B5-8CCD-A6A3C33AC45E@dukhovni.org> References: <9B98E614-4887-40B5-8CCD-A6A3C33AC45E@dukhovni.org> Message-ID: You can override the temporary directory by setting the TMPDIR environment variable. To have this apply to all of your stack invocations, consider putting an alias in your .bashrc, something like: $ alias stack="TMPDIR=~/.local/tmp ~/.local/bin/stack" Note that you might also need to $ mkdir ~/.local/tmp -Michael On Sun, Oct 6, 2019 at 12:36 AM Viktor Dukhovni wrote: > > When I run "stack ghci", an attempt is made to create a temporary > directory named: > > /tmp/haskell-stack-ghci/ > > in which various temporary artefacts are stored. The parent > directory is created with permissions (0777 & ~umask). > > Security issues aside, this can't work reliably on a multi-user > system. Does anyone know whether this is something peculiar > to my FreeBSD setup, or a systemic issue with "stack ghci"? > > I don't see the same behaviour with "stack script", though > if I create a script to run in "/tmp", then ghc is, somewhat > unexpectely, executed with "-i/tmp/", which also has security > implications... > > -- > Viktor. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.casanova at ed.ac.uk Sun Oct 6 17:35:33 2019 From: juan.casanova at ed.ac.uk (Juan Casanova) Date: Sun, 06 Oct 2019 18:35:33 +0100 Subject: [Haskell-cafe] Optional "Default" instances of classes in certain subcases (but too broad) In-Reply-To: <61B56567-3BA5-436E-8F19-B724AC04F577@gmail.com> References: <20191004220832.58192rk5cwleglwk@www.staffmail.ed.ac.uk> <61B56567-3BA5-436E-8F19-B724AC04F577@gmail.com> Message-ID: <20191006183533.13310a5aupflco2o@www.staffmail.ed.ac.uk> > Does that accommodate the use cases you’re looking for? It probably does, to be honest. I need to try it, but from your example I gather that the newtype is only defined so that the deriving can be used, but I do not ever need to explicitly use the newtype that I declared in order to be able to derive the functor instance. It is essentially what I said, except it uses the newtype as a "carrier" for the optional instance. Thanks. If I find out any use case where it's not enough I'll come back here, but it does look like it's enough. Juan. -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From ietf-dane at dukhovni.org Sun Oct 6 19:40:28 2019 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Sun, 6 Oct 2019 15:40:28 -0400 Subject: [Haskell-cafe] Problematic fixed "stack ghci" temporary script (parent) directory In-Reply-To: References: <9B98E614-4887-40B5-8CCD-A6A3C33AC45E@dukhovni.org> Message-ID: <20191006194028.GI21772@straasha.imrryr.org> On Sun, Oct 06, 2019 at 11:06:26AM -0600, Michael Sloan wrote: > You can override the temporary directory by setting the TMPDIR environment > variable. > > To have this apply to all of your stack invocations, consider putting an > alias in your .bashrc, something like: > > $ alias stack="TMPDIR=~/.local/tmp ~/.local/bin/stack" Thanks, though I am inclined for the fancier[1]: stack() { ( dir=$(mktemp -d /tmp/stack.XXXXXX) || exit 1 trap '/bin/rm -rf $dir; exit' EXIT HUP INT QUIT TERM TMPDIR=$dir $HOME/.local/bin/stack "$@" ); } [1] Note mktemp(1) is not covered by the Single Unix Specification, so portability is not assured, the below should work on at least BSD Systems and Linux. > > I don't see the same behaviour with "stack script", though > > if I create a script to run in "/tmp", then ghc is, somewhat > > unexpectely, executed with "-i/tmp/", which also has security > > implications... But I probably still need to take care to avoid building single-use throw-away scripts for "stack script" in /tmp: $ script=$(mktemp /tmp/script.XXXXXX) $ ... generate content of $script ... $ stack script "$script" since it seems that the above will search /tmp for dependencies. -- Viktor. From ietf-dane at dukhovni.org Sun Oct 6 20:21:56 2019 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Sun, 6 Oct 2019 16:21:56 -0400 Subject: [Haskell-cafe] Problematic fixed "stack ghci" temporary script (parent) directory In-Reply-To: <15230c8b-0610-a0fc-f8d4-ca67e0b912d3@gmail.com> References: <9B98E614-4887-40B5-8CCD-A6A3C33AC45E@dukhovni.org> <15230c8b-0610-a0fc-f8d4-ca67e0b912d3@gmail.com> Message-ID: <20191006202156.GJ21772@straasha.imrryr.org> On Sun, Oct 06, 2019 at 11:24:50AM -0500, Vanessa McHale wrote: > Does "cabal repl" work? With "cabal new-repl" I see the unique directory created directly under /tmp, with no fixed intermediate ancestor: drwx------ 3 viktor wheel 128 Oct 6 15:58 cabal-repl.-30676 this looks reasonably safe and should work fine on multi-user systems. A system-call trace (with names for some predicted pids pre-created) shows that the mkdir(2) starts at the process id, and retries on failure with ++pid: 30989: getpid() = 30989 (0x790d) 30989: mkdir("/tmp/cabal-repl.-30989",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30990",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30991",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30992",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30993",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30994",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30995",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30996",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30997",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30998",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-30999",0700) ERR#17 'File exists' 30989: mkdir("/tmp/cabal-repl.-31000",0700) = 0 (0x0) So this can be DoSed by a determined hostile user, but if, as is typical, there are no per-user quotas in /tmp, one can also just consume all the available free space in /tmp, ... Adding a second less predictable name component to the pid, (say microsecond time, or a random number) is perhaps better, but not very compelling. With "cabal v1-repl", I did't see any temp files created right away, but after loading a module, I see: 31288: mkdir("/tmp/ghc31288_0",0777) ERR#17 'File exists' 31288: mkdir("/tmp/ghc31288_1",0777) ERR#17 'File exists' 31288: mkdir("/tmp/ghc31288_2",0777) ERR#17 'File exists' 31288: mkdir("/tmp/ghc31288_3",0777) ERR#17 'File exists' 31288: mkdir("/tmp/ghc31288_4",0777) = 0 (0x0) which is somewhat better than incrementing the pid. -- Viktor. From whosekiteneverfly at gmail.com Mon Oct 7 23:10:48 2019 From: whosekiteneverfly at gmail.com (Yuji Yamamoto) Date: Tue, 8 Oct 2019 08:10:48 +0900 Subject: [Haskell-cafe] Publish slides of talks in HIW 2019 (Or whom to ask about it) In-Reply-To: <291674d14299e4f37b3db5d94c5493f1@imdea.org> References: <291674d14299e4f37b3db5d94c5493f1@imdea.org> Message-ID: Confirmed my profile and the link to the slides. Thanks! 2019年10月7日(月) 19:10 niki.vazou : > Hi Yuji, Richard, > > Yuji, I added the link to your lightning talk here: > https://icfp19.sigplan.org/home/hiw-2019#event-overview > > I did not collect links for the slides this year, but if more speakers > want to share their slides, will be happy to upload them. > > Best, > Niki > > > On 02.10.2019 10:59, Richard Eisenberg wrote: > > I have cc'd Niki Vazou, the chair of this year's HIW. She'll have the > > best answers. > > > > Richard > > > >> On Oct 2, 2019, at 2:39 AM, Yuji Yamamoto > >> wrote: > >> > >> Hello Haskellers, > >> > >> I'm not sure where is the best place to ask about this, > >> so please tell me if there is better place. > >> > >> Does anyone know when the slides of HIW 2019 will be published in > >> the web site [1] like the last year's [2]? > >> I see some of the talks are "File Attached", but most of them are > >> not. > >> > >> In addition, can I attach the URL of my lightning talk slides > >> https://the.igreque.info/slides/2019-08-23-indexed-applicative.html > >> to the web site? > >> > >> According to the last year's page, some of the lightning talks are > >> also "File Attached" or "Media Attached". > >> > >> Thanks in advance! > >> > >> -- > >> > >> 山本悠滋 > >> twitter: https://twitter.com/igrep > >> GitHub: https://github.com/igrep > >> GitLab: https://gitlab.com/igrep > >> Facebook: http://www.facebook.com/igrep > >> _______________________________________________ > >> 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. > > > > > > > > Links: > > ------ > > [1] https://icfp19.sigplan.org/home/hiw-2019#program > > [2] https://icfp18.sigplan.org/track/hiw-2018-papers#event-overview > -- 山本悠滋 twitter: https://twitter.com/igrep GitHub: https://github.com/igrep GitLab: https://gitlab.com/igrep Facebook: http://www.facebook.com/igrep -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.pelenitsyn at gmail.com Mon Oct 7 23:15:04 2019 From: a.pelenitsyn at gmail.com (Artem Pelenitsyn) Date: Mon, 7 Oct 2019 19:15:04 -0400 Subject: [Haskell-cafe] Publish slides of talks in HIW 2019 (Or whom to ask about it) In-Reply-To: References: <291674d14299e4f37b3db5d94c5493f1@imdea.org> Message-ID: Hey Yuji! I just wanted to thank you for making it to publish the slides on the website! Hopefully, more authors from HIW '19 will follow you! -- Best, Artem On Mon, Oct 7, 2019, 7:11 PM Yuji Yamamoto wrote: > Confirmed my profile and the link to the slides. > Thanks! > > 2019年10月7日(月) 19:10 niki.vazou : > >> Hi Yuji, Richard, >> >> Yuji, I added the link to your lightning talk here: >> https://icfp19.sigplan.org/home/hiw-2019#event-overview >> >> I did not collect links for the slides this year, but if more speakers >> want to share their slides, will be happy to upload them. >> >> Best, >> Niki >> >> >> On 02.10.2019 10:59, Richard Eisenberg wrote: >> > I have cc'd Niki Vazou, the chair of this year's HIW. She'll have the >> > best answers. >> > >> > Richard >> > >> >> On Oct 2, 2019, at 2:39 AM, Yuji Yamamoto >> >> wrote: >> >> >> >> Hello Haskellers, >> >> >> >> I'm not sure where is the best place to ask about this, >> >> so please tell me if there is better place. >> >> >> >> Does anyone know when the slides of HIW 2019 will be published in >> >> the web site [1] like the last year's [2]? >> >> I see some of the talks are "File Attached", but most of them are >> >> not. >> >> >> >> In addition, can I attach the URL of my lightning talk slides >> >> https://the.igreque.info/slides/2019-08-23-indexed-applicative.html >> >> to the web site? >> >> >> >> According to the last year's page, some of the lightning talks are >> >> also "File Attached" or "Media Attached". >> >> >> >> Thanks in advance! >> >> >> >> -- >> >> >> >> 山本悠滋 >> >> twitter: https://twitter.com/igrep >> >> GitHub: https://github.com/igrep >> >> GitLab: https://gitlab.com/igrep >> >> Facebook: http://www.facebook.com/igrep >> >> _______________________________________________ >> >> 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. >> > >> > >> > >> > Links: >> > ------ >> > [1] https://icfp19.sigplan.org/home/hiw-2019#program >> > [2] https://icfp18.sigplan.org/track/hiw-2018-papers#event-overview >> > > > -- > 山本悠滋 > twitter: https://twitter.com/igrep > GitHub: https://github.com/igrep > GitLab: https://gitlab.com/igrep > Facebook: http://www.facebook.com/igrep > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Thu Oct 10 13:57:47 2019 From: magnus at therning.org (Magnus Therning) Date: Thu, 10 Oct 2019 15:57:47 +0200 Subject: [Haskell-cafe] Hedgehog: returning a list from `commandExecute` and getting to the items in an update function In-Reply-To: <87pnjhwnv9.fsf@therning.org> References: <87pnjhwnv9.fsf@therning.org> Message-ID: <87d0f4zorz.fsf@therning.org> I found an open issue for what I've run into (I think): https://github.com/hedgehogqa/haskell-hedgehog/issues/113 /M Magnus Therning writes: > Hello, > > I'm trying to use Hedgehog to test a web app at work. Yesterday I ran > into an issue with getting to the value returned from my > `commandExecute` in an `Update` `Callback`. > > Basically my model looks like this > > ~~~ > newtype State (v :: * -> *) = State (M.Map (Var UUID v) DataPerItem) > deriving (Eq, Show) > ~~~ > > and I have an action, `Command gen exec [Update update]` where > > ~~~ > exec :: action -> m [UUID] > ~~~ > > which results in > > ~~~ > update :: State v -> action -> Var [UUID] v -> State v > ~~~ > > AFAICS I need to, in order to actually update my model, turn that `Var > [UUID] v` into `[Var UUID v]`. I've been staring at the functions in > Hedgehog for a while now but nothing jumps out... or am I, once again, > thinking about it all wrong? :) > > /M > > I also asked at stackoverflow: > https://stackoverflow.com/questions/58157292/returning-a-list-and-getting-to-the-items-in-hedgehog-state-machine > This is just to widen the net a bit... -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus at therning.org twitter: magthe http://magnus.therning.org/ Action is the foundational key to all success. — Pablo Picasso From magnus at therning.org Thu Oct 10 14:00:42 2019 From: magnus at therning.org (Magnus Therning) Date: Thu, 10 Oct 2019 16:00:42 +0200 Subject: [Haskell-cafe] Hedgehog: returning a list from `commandExecute` and getting to the items in an update function In-Reply-To: <87d0f4zorz.fsf@therning.org> References: <87pnjhwnv9.fsf@therning.org> <87d0f4zorz.fsf@therning.org> Message-ID: <87a7a8zomt.fsf@therning.org> Magnus Therning writes: > I found an open issue for what I've run into (I think): > https://github.com/hedgehogqa/haskell-hedgehog/issues/113 My copy-pasting skills need work! The issue is this: https://github.com/hedgehogqa/haskell-hedgehog/issues/126 /M > Magnus Therning writes: > >> Hello, >> >> I'm trying to use Hedgehog to test a web app at work. Yesterday I ran >> into an issue with getting to the value returned from my >> `commandExecute` in an `Update` `Callback`. >> >> Basically my model looks like this >> >> ~~~ >> newtype State (v :: * -> *) = State (M.Map (Var UUID v) DataPerItem) >> deriving (Eq, Show) >> ~~~ >> >> and I have an action, `Command gen exec [Update update]` where >> >> ~~~ >> exec :: action -> m [UUID] >> ~~~ >> >> which results in >> >> ~~~ >> update :: State v -> action -> Var [UUID] v -> State v >> ~~~ >> >> AFAICS I need to, in order to actually update my model, turn that `Var >> [UUID] v` into `[Var UUID v]`. I've been staring at the functions in >> Hedgehog for a while now but nothing jumps out... or am I, once again, >> thinking about it all wrong? :) >> >> /M >> >> I also asked at stackoverflow: >> https://stackoverflow.com/questions/58157292/returning-a-list-and-getting-to-the-items-in-hedgehog-state-machine >> This is just to widen the net a bit... -- Magnus Therning OpenPGP: 0x927912051716CE39 email: magnus at therning.org twitter: magthe http://magnus.therning.org/ Every act of creation is first an act of destruction. — Pablo Picasso From alex at functionalworks.com Thu Oct 10 14:32:04 2019 From: alex at functionalworks.com (Alex Mesropians) Date: Thu, 10 Oct 2019 15:32:04 +0100 Subject: [Haskell-cafe] Hiring Using Opensource? - Haskell Community Message-ID: Hey All, I wanted to grab your thoughts on hiring using opensource! I wanted to talk open source! Open Source issues is a new feature we have just launched on our platform Workshub and it’s going to make hiring even easier!Our one click GitHub integration allows you to share your companies open source issues,alongside your jobs and company profile. Once your issue are posted you can start to build a network of candidates that have a specific interest in your code base. You can also add a $ incentive to any or all of your issues if you want to reward Engineers for completing the work! Here are just a few of the benefits:- - 89% of Engineers on our site would prefer to join a company with active open source software: - Get contributions to real problems your tech team are trying to solve - Streamline the recruitment process and get to know how each candidate really works - Candidates are more likely to apply to roles at a company where they have already contributed to their code base - We will recommend your OS issues directly to our community You can find our more here! You can also see an example of how we are building our own OS community with contributions to our the WorksHub code base here ! Look forward to hearing your thoughts! thanks, -- [image: Functional Works] Alex Mesropians +447949853457 Founder [image: GitHub] [image: LinkedIn] [image: Twitter] -------------- next part -------------- An HTML attachment was scrubbed... URL: From P.Achten at cs.ru.nl Fri Oct 11 12:38:42 2019 From: P.Achten at cs.ru.nl (Peter Achten) Date: Fri, 11 Oct 2019 14:38:42 +0200 Subject: [Haskell-cafe] [TFP'20] one month left for pre-symposium submissions for Trends in Functional Programming 2020, 13-14 February, Krakow, Poland Message-ID: <91cf49a7-0797-3629-587d-d5791d0e6113@cs.ru.nl> -------------------------------------------------------------------------                     Second call for papers         21st Symposium on Trends in Functional Programming                           tfp2020.org ------------------------------------------------------------------------- The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions. * TFP is moving to new winter dates, to provide an FP forum in between the   annual ICFP events. * TFP offers a supportive reviewing process designed to help less experienced   authors succeed, with two rounds of review, both before and after the   symposium itself. Authors have an opportunity to address reviewers' concerns   before final decisions on publication in the proceedings. * TFP offers two "best paper" awards, the John McCarthy award for best paper,   and the David Turner award for best student paper. * This year we are particularly excited to co-locate with Lambda Days in   beautiful Krakow. Lambda Days is a vibrant developer conference with hundreds   of attendees and a lively programme of talks on functional programming in   practice. TFP will be held in the same venue, and participants will be able   to session-hop between the two events. Important Dates --------------- Submission deadline for pre-symposium review:   15th November, 2019 Submission deadline for draft papers:           10th January, 2020 Symposium dates:                                13-14th February, 2020 Visit tfp2020.org for more information. From corentin.dupont at gmail.com Sat Oct 12 12:53:40 2019 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sat, 12 Oct 2019 14:53:40 +0200 Subject: [Haskell-cafe] Twitter-conduit author not responding Message-ID: Hi community, I have a small problem with the "Twitter-conduit" package: https://github.com/himura/twitter-conduit Their are several opened issues and pull requests, in particular the Twitter API changed so the package is relatively broken. I mailed the author some month ago, without response. What is the recommended course of action? Regards Corentin -------------- next part -------------- An HTML attachment was scrubbed... URL: From whosekiteneverfly at gmail.com Sat Oct 12 13:15:33 2019 From: whosekiteneverfly at gmail.com (Yuji Yamamoto) Date: Sat, 12 Oct 2019 22:15:33 +0900 Subject: [Haskell-cafe] Twitter-conduit author not responding In-Reply-To: References: Message-ID: Generally speaking, you should consider taking over the maintenership of the package. See https://wiki.haskell.org/Taking_over_a_package for details. But I'll try to contact him too because I personally know him. 2019年10月12日(土) 21:54 Corentin Dupont : > Hi community, > I have a small problem with the "Twitter-conduit" package: > https://github.com/himura/twitter-conduit > > Their are several opened issues and pull requests, in particular the > Twitter API changed so the package is relatively broken. > I mailed the author some month ago, without response. > What is the recommended course of action? > > Regards > Corentin > _______________________________________________ > 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 corentin.dupont at gmail.com Sat Oct 12 13:22:04 2019 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sat, 12 Oct 2019 15:22:04 +0200 Subject: [Haskell-cafe] Twitter-conduit author not responding In-Reply-To: References: Message-ID: Yes, I volunteer to take maintenance, or co-maintenance of the package (with permission). Thanks for contacting him! On Sat, Oct 12, 2019 at 3:15 PM Yuji Yamamoto wrote: > Generally speaking, you should consider taking over the maintenership of > the package. > See https://wiki.haskell.org/Taking_over_a_package for details. > > But I'll try to contact him too because I personally know him. > > > 2019年10月12日(土) 21:54 Corentin Dupont : > >> Hi community, >> I have a small problem with the "Twitter-conduit" package: >> https://github.com/himura/twitter-conduit >> >> Their are several opened issues and pull requests, in particular the >> Twitter API changed so the package is relatively broken. >> I mailed the author some month ago, without response. >> What is the recommended course of action? >> >> Regards >> Corentin >> _______________________________________________ >> 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 c.thulehansen at live.com Mon Oct 14 11:23:35 2019 From: c.thulehansen at live.com (Casper Thule Hansen) Date: Mon, 14 Oct 2019 11:23:35 +0000 Subject: [Haskell-cafe] Feedback First Application Message-ID: Hi. I have created my first application that I expect will go live within the next couple of months and I would like to have some feedback. The application is here: https://github.com/into-cps-association/utilities_backend and will be a project that I keep updating as I learn new stuff. I consider myself somewhat a haskell beginner, and my goal is to learn more about Haskell's features, packages and similar. So I hope that someone can point me to some places in my code that can be written in a better fashion, concepts that can be applied or similar. Of course - please try to keep it within my reach 🙂 The application is not critical in any fashion. It is not necessary with optimal performance, extensive testing and similar. Currently, I am not particularly interested in testing, I will save that for later. I hope someone can give me a few pointers! Cheers, Casper Thule -------------- next part -------------- An HTML attachment was scrubbed... URL: From juan.casanova at ed.ac.uk Mon Oct 14 18:28:25 2019 From: juan.casanova at ed.ac.uk (Juan Casanova) Date: Mon, 14 Oct 2019 19:28:25 +0100 Subject: [Haskell-cafe] Optional "Default" instances of classes in certain subcases (but too broad) In-Reply-To: <61B56567-3BA5-436E-8F19-B724AC04F577@gmail.com> References: <20191004220832.58192rk5cwleglwk@www.staffmail.ed.ac.uk> <61B56567-3BA5-436E-8F19-B724AC04F577@gmail.com> Message-ID: <20191014192825.64616fue1dgskds8@www.staffmail.ed.ac.uk> A follow-up from this discussion. It would seem that this is not currently usable for multi-parameter type classes when we want to derive more than the last parameter. Is this right? I have found this paper that seems to say so, and leave it as an open problem: https://www.kosmikus.org/DerivingVia/deriving-via-paper.pdf As I see it, it is only a syntax issue, whereby we need a way of telling GHC which arguments should be derived. Are there any other reasons why this is not implemented yet? I don't think designing a syntax to specify this should be that difficult. A quick idea that comes to mind is indicating in the "via" clause a tuple of instances so that GHC knows which one to use for each of the last parameters, for example: class Class1 a b c | a b -> c where fun1 :: a -> b -> c newtype NT1 = NT1 Int newtype NT2 = NT2 Int -- Two actually different instances that could be applicable. instance Class1 NT1 NT1 NT1 where fun1 (NT1 x) (NT1 y) = NT1 (x + y) instance Class1 NT1 NT2 NT2 where fun1 (NT1 x) (NT2 y) = NT2 (x - y) -- The following instances are, of course, incompatible between them; but each of them should be valid on their own, doing different things. -- The following would only derive the last parameter deriving via (NT1) instance Class1 NT1 NT1 Int -- The following would only derive the last parameter, but using NT2 instead deriving via (NT2) instance Class1 NT1 NT1 Int -- The following would derive the last two parameters, using the first instance above. deriving via (NT1,NT1) instance Class1 NT1 Int Int -- The following would derive the last two parameters, using the second instance above. deriving via (NT2,NT2) instance Class1 NT1 Int Int -- The following would derive all three parameters, using the first instance above. deriving via (NT1,NT1,NT1) instance Class1 Int Int Int -- The following would derive all three parameters, using the second instance above. deriving via (NT1,NT2,NT2) instance Class1 Int Int Int -- The following would not work, because there is no instance for Class1 NT2 NT2 NT2. deriving via (NT2,NT2,NT2) instance Class1 Int Int Int Any reason why this should not be posted as a ticket to GHC? Juan. Quoting Alexis King on Fri, 4 Oct 2019 20:21:22 -0500: > Hello, > > The recent DerivingVia language extension is, in many ways, designed > to accommodate the use cases you describe. Instead of defining > “optional” instances, you attach instances to a relevant newtype, > then use that newtype with DerivingVia to reuse instances. > > So, for example, you could define a WrappedBifunctor newtype: > > newtype WrappedBifunctor f a b = WrappedBifunctor { > unWrappedBifunctor :: f a b } > deriving newtype (Bifunctor) > > …then declare the following instance: > > instance Bifunctor f => Functor (WrappedBifunctor f a) where > fmap = bimap id > > Then if you have a type with an explicit Bifunctor instance, you can write: > > data F a b = ... > deriving (Functor) via WrappedBifunctor F > > …or, with StandaloneDeriving: > > deriving via (WrappedBifunctor F) instance Functor (F a) > > Does that accommodate the use cases you’re looking for? > > Alexis > >> On Oct 4, 2019, at 16:08, Juan Casanova wrote: >> >> Hello again, >> >> Before my question, I notice I am using this list quite a bit. I >> hope I am no abusing or misusing it by doing so, though. Sometimes >> I wonder what's the line between what I should ask here and what I >> should ask in StackOverflow, if that line even exists. If anyone >> feels I may be abusing or misusing, please let me know (in public >> or in private). >> >> Very simple question: Would it make sense, or does it already >> exist, a way to implement *optional* default instances of classes >> that can be used more directly than currently. >> >> I am *not* talking about providing a default implementation of a >> class when declaring it. I know you can do this. >> >> I am talking about when you know you can provide a generic instance >> of a class for a wide range of situations *which depends on some >> constraints*. For example: >> >> instance Bifunctor f => Functor (f a) where >> fmap = bimap id >> >> Of course, this is a terrible idea, because the constraints are not >> checked when verifying overlap and the like, and so this is very >> likely to break your program. What I tend to do nowadays is to add >> a function: >> >> fmapFromBiMap :: Bifunctor f => (b -> c) -> (f a b) -> (f a c) >> fmapFromBiMap = bimap id >> >> and then use it each time (the following is obviously a silly example): >> >> instance Functor (Either a) where >> fmap = fmapFromBiMap >> >> The only problem I see with this is that I need to remember >> (specially with my own type classes): 1. That I provided this >> "default" implementation. 2. Its name. I know these are fairly >> small things to complain about, but once again when you do it 100 >> times it becomes annoying, specially for a person who absolutely >> does not like doing things that I know would be able to explain how >> to automate. >> >> So, what I would expect is for it to be something like declaring >> the default instance but only use it for the types that explicitly >> ask for it. E.g.: >> >> optional instance Bifunctor f => Functor (f a) where >> fmap = bimap id >> >> instance Functor (Either a) using optional >> >> The main important point here is that I expect this to check the >> constraints in compile time for the class that I am giving (and if >> it contains type variables, only use those that are guaranteed to >> be complied, of course). This means that if I did: >> >> instance Functor (f a) using optional >> >> I *do not* expect it to be okay with it and automatically add the >> constraint Bifunctor f => to the instance. I expect it to give me a >> compile error: "No matching optional instance found". >> >> Of course, there could be several optional instances that overlap >> when using optional. But then, GHC would give me the error >> indicating what the options are *and I would know that it's because >> I put optional* and I could just replace it with the specific one >> to use. Maybe by giving them names? >> >> optional instance fmapFromBiMap Bifunctor f => Functor (f a) where >> fmap = bimap id >> >> instance Functor (Either a) using optional -- If this does not work >> because it overlaps with other optionals, then GHC tells me, >> indicates the options, and I replace with: >> >> instance Functor (Either a) using fmapFromBiMap >> >> This avoids the problem of defining the instance in general (that >> it will overlap with basically anything), should be easy to type >> check and prevents having to keep an index in your mind about >> useful functions that you implemented or didn't. >> >> I wonder if the "deriving" family of functionalities have anything >> like this, but my search has not been fruitful. Maybe using Generics? >> >> Maybe I just need good autocomplete so that I can find the function >> easily... it still feels like this would make sense. >> >> Juan. >> >> -- >> The University of Edinburgh is a charitable body, registered in >> Scotland, with registration number SC005336. >> >> >> _______________________________________________ >> 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 juan.casanova at ed.ac.uk Mon Oct 14 18:39:02 2019 From: juan.casanova at ed.ac.uk (Juan Casanova) Date: Mon, 14 Oct 2019 19:39:02 +0100 Subject: [Haskell-cafe] Optional "Default" instances of classes in certain subcases (but too broad) In-Reply-To: <20191014192825.64616fue1dgskds8@www.staffmail.ed.ac.uk> References: <20191004220832.58192rk5cwleglwk@www.staffmail.ed.ac.uk> <61B56567-3BA5-436E-8F19-B724AC04F577@gmail.com> <20191014192825.64616fue1dgskds8@www.staffmail.ed.ac.uk> Message-ID: <20191014193902.5276375wyiyq5vk0@www.staffmail.ed.ac.uk> Correction to my last email: -- The following would not work because there is no instance Class1 NT1 NT1 NT2 deriving via (NT2) instance Class1 NT1 NT1 Int -- But this would work deriving via (NT2) instance Class1 NT1 NT2 Int -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. From thomas.dubuisson at gmail.com Mon Oct 14 22:29:04 2019 From: thomas.dubuisson at gmail.com (Thomas DuBuisson) Date: Mon, 14 Oct 2019 15:29:04 -0700 Subject: [Haskell-cafe] [Job] Muse Dev, a Galois spin-out, is hiring Message-ID: Muse Dev is a Galois spin-out working to put the rest of Galois out of business by automating their jobs away [1]. By discovering "the right issues at the right time" and presenting to the developer, Muse seeks to bring static code analysis to the world as early in the development cycle as possible. We're currently working with early adopters to flesh-out the interface and add final must-haves. Oh, and we are hiring. If you like all-Haskell backends, have SaaS-related experience, and love build systems then please apply. We're interested in people with experience and enthusiasm in some of: * Haskell development * Static analysis * Build system interpretation * Kubernetes cluster deployment * AWS such as EC2, IAM, EKS * REST APIs * Enterprise system deployment, packaging, and support Location: Galois offices in Portland, Oregon or Arlington, Virginia. Resumes can be sent to careers at muse.dev See Also https://muse.dev https://lifeatgalois.com - We have inherited some culture from Galois but are a separate company. [1] Well, anything that can be automated about program analysis. Don't tell Galois. They'll kick us out of this nice, comfy, office. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ruben.astud at gmail.com Mon Oct 14 23:36:27 2019 From: ruben.astud at gmail.com (Ruben Astudillo) Date: Mon, 14 Oct 2019 20:36:27 -0300 Subject: [Haskell-cafe] Is join useful for every monad? In-Reply-To: References: Message-ID: On 14-10-19 16:45, Carter Schonwald wrote: > And while join is not at the moment in the Monad typeclass because of > newtype stuff Could you expand a bit on this? I remember this being on a Applicative-Monad proposal but I couldn't understand why it wasn't technically possible. -- -- Ruben -- PGP: 4EE9 28F7 932E F4AD From lysxia at gmail.com Mon Oct 14 23:57:05 2019 From: lysxia at gmail.com (Li-yao Xia) Date: Mon, 14 Oct 2019 19:57:05 -0400 Subject: [Haskell-cafe] Is join useful for every monad? In-Reply-To: References: Message-ID: The following blog post may be of help: https://ryanglscott.github.io/2018/03/04/how-quantifiedconstraints-can-let-us-put-join-back-in-monad/ On 10/14/19 7:36 PM, Ruben Astudillo wrote: > On 14-10-19 16:45, Carter Schonwald wrote: >> And while join is not at the moment in the Monad typeclass because of >> newtype stuff > > Could you expand a bit on this? I remember this being on a > Applicative-Monad proposal but I couldn't understand why it wasn't > technically possible. > From ietf-dane at dukhovni.org Tue Oct 15 07:47:46 2019 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Tue, 15 Oct 2019 03:47:46 -0400 Subject: [Haskell-cafe] Windows, doctest and auxiliary FFI wrappers? Message-ID: <20191015074746.GJ34850@straasha.imrryr.org> The Network.DNS library contains a bit of helper C-code for determining the default DNS servers on Windows. This code is linked in by Cabal, when building object code for the library on Windows. The library also has 140 "doctest" examples in the haddock comments, which I'd like to test on Windows via AppVeyor. I'm not having much luck making the dependency on the cbits visible to the GHCi invocations executed by "Test.Doctest". Does anyone have some experience getting this sort of thing to work? What I've tried: 1. Add "-liphlpapi" into the "doctest" command argument list, this proved necessary, but not sufficient. 2. Build a separate internal library (supported in Cabal 2.0 and later), which is a dependency of the main library and links in the C glue code, but this proved to be a significant rabbit hole... In fact approach 2 seems like the more promising one, but it runs into a substantial obstacles: a. Building internal libraries requires a "Simple" Cabal build, but the cabal-doctest package which automates compiling doctests, requires a "Custom" build type. :-( b. A Simple build, means abandoning cabal-doctest, and using "doctest" directly, but the new sandbox builds place package artefacts in locations that the command-line invoked by "Test.DocTest.doctest" does not know how to find. It appears that the "Custom" build from cabal-doctest is there for a good reason: it hooks into Cabal's build process, and has access to enough metatata, to generate wrapper code that invokes doctest with an argument list of the form: -XCPP -i -i/build///-/build/autogen -i/build///-/build -i -package-env=- -hide-all-packages -no-user-package-db -package-db=//package.db -package-db=/packagedb/ -package-db=/build///-/package.conf.inplace -optP-include -optP/build///-/build/autogen/cabal_macros.h ...visible packages... ...modules to doctest... which are needed for the extracted doctest fragments to find their dependencies. Hard-coding such arguments into the "Simple" build seems to work, but is hardly maintainable. I've not yet found an interface in the Cabal library that would divulge these magic strings as a function of the "pkg.cabal" file, something of the shape: cabalMagicGhcArgs :: FilePath -> IO [String] would make it possible to compute the arguments at runtime (rather than build-time) in a Simple build, without having to use a Custom build to machine-generate wrapper code. Other than the above, I'm out of ideas for now, any help much appreciated. -- Viktor. From mblazevic at stilo.com Tue Oct 15 14:48:20 2019 From: mblazevic at stilo.com (=?UTF-8?Q?Mario_Bla=c5=beevi=c4=87?=) Date: Tue, 15 Oct 2019 10:48:20 -0400 Subject: [Haskell-cafe] Avoiding code-duplication for what is roughly fmap In-Reply-To: References: Message-ID: On 2019-10-04 4:06 p.m., Sebastiaan Joosten wrote: > Using generics and default worked brilliantly, thanks! I didn't use > higgledy, so let me know if I missed an opportunity for something. I > just wanted to post my solution here. My only questions would be: isn't > there a library on hackage that already does this? There's rank2classes (http://hackage.haskell.org/package/rank2classes) but it leans on Template Haskell rather than generics. > However, anyone reading who just want to learn how to use generics, I > recommend reading > http://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#generic-programming, > as that's basically all I needed to learn how to do this. (Nathan's link > pointed me there, again: thanks!) > > For getting everything to work, I added {-# > LANGUAGE TypeOperators, DefaultSignatures #-} (GHC is great at telling > me what to enable). > > I was able to write a generic version for removing whitespace, which > essentially is an fmap. To derive an instance, I can indeed just write: > instance WhiteSpaced ClassItem where > > The most straightforward thing to do, is to write a generic GWhiteSpaced > class and then the WhiteSpaced class. Here is what I wrote: > class GWhiteSpaced f where > gremoveWS :: f a -> f a -- generic version of removeWS > > instance GWhiteSpaced U1 where >   gremoveWS U1 = U1 > instance (GWhiteSpaced a, GWhiteSpaced b) => GWhiteSpaced (a :*: b) where >   gremoveWS (x :*: y) = gremoveWS x :*: gremoveWS y > instance (GWhiteSpaced a, GWhiteSpaced b) => GWhiteSpaced (a :+: b) where >   gremoveWS (L1 x) = L1 $ gremoveWS x >   gremoveWS (R1 x) = R1 $ gremoveWS x > instance (GWhiteSpaced a) => GWhiteSpaced (M1 i c a) where >   gremoveWS (M1 x) = M1 $ gremoveWS x > instance (WhiteSpaced a) => GWhiteSpaced (K1 i a) where >   gremoveWS (K1 x) = K1 $ removeWS x > > class WhiteSpaced a where > removeWS :: a -> a > -- remove as much whitespace as possible without changing semantics > default removeWS :: (GWhiteSpaced (Rep a), Generic a) => a -> a >   removeWS = GHC.Generics.to . gremoveWS . from > > > This really helps generalize things in those cases where the > data-structure changes, but the WhiteSpaced class is not the only class > that follows this pattern. Naturally, I would like to: > - avoid repeating the generic class for each fmap-like class (renaming > method-names, simplifying expressions, etc, are all very similar functions). > - and ideally remove the circular dependency, so I can put the generic > classes into separate modules without getting orphaned instances for the > specific ones. > > I managed to do both with a single solution. First of all, I will use a > phantom type to keep track of which instance to use. If you haven't seen > a phantom type: it's just a convenient way of binding type variables and > passing those around. I'd love to use the default one in the Prelude / > RIO, but I can never find it and getting an extra dependency is not > worth it, so I always end up defining one: > data Phantom k = Phantom > I'll use this phantom type later when I create an empty datatype (as > empty as they get) whose only purpose is to denote that I'm using the > whitespace function. Using Phantom types, I can unambiguously define: > class FmapLike k f where > gmap :: Phantom k -> f a -> f a > class FmapInstance k a where > gmapinstance :: Phantom k -> a -> a > Note that the *only* purpose of the type variable k here, is to enable > reuse: by filling in different values for k, I can instantiate > whitespaces and other fmap-like functions in the same way. Otherwise, > FmapLike and FmapInstance just mimick GWhiteSpaced and WhiteSpaced > respectively. > > My generic FmapLike function is nearly the same as my generic whitespace > function, the only thing I add is passing the type variable around: > instance FmapLike x U1 where >   gmap _ U1 = U1 > instance (FmapLike x a, FmapLike x b) => FmapLike x (a :*: b) where >   gmap f (x :*: y) = gmap f x :*: gmap f y > instance (FmapLike x a, FmapLike x b) => FmapLike x (a :+: b) where >   gmap f (L1 x) = L1 $ gmap f x >   gmap f (R1 x) = R1 $ gmap f x > instance (FmapLike x a) => FmapLike x (M1 i c a) where >   gmap f (M1 x) = M1 $ gmap f x > instance FmapInstance x a => FmapLike x (K1 i a) where >   gmap f (K1 x) = K1 $ gmapinstance f x > > Now to define the WhiteSpace class as before, I just need six lines. > Furthermore, these six lines can be in a separate file without creating > orphaned instances: > data WS > class WhiteSpaced a where > removeWS :: a -> a > -- remove as much whitespace as possible without changing semantics > default removeWS :: (FmapLike WS (Rep a), Generic a) => a -> a >   removeWS = GHC.Generics.to . gmap (Phantom::Phantom WS) . from > instance WhiteSpaced a => FmapInstance WS a where >   gmapinstance _ = removeWS > (The instance is not an orphan because WS is defined here) > > Note that instead of WS, I could use any other datatype token, it > doesn't have to be an empty datatype. I'm just defining it as an empty > datatype to make it absolutely clear that it's not storing any data. It > also provides a good place to document what WS is actually intended for. > As a final touch, I'm defining: > gmapGeneric = (\x -> GHC.Generics.to . gmap x . from) > (this shortens removeWS a little) > > So final question: is there any library that implements gmapGeneric or gmap? > > Also a big thanks to everyone who helped put Generics in Haskell. I've > seen helpful error messages and good documentation all the way through! > > Best, > > Sebastiaan > > > On Thu, Oct 3, 2019 at 6:41 PM Yuji Yamamoto > > wrote: > > Use DeriveGenerics, and higgledy > (or some packages supporting > higher kinded data) would help you. > > 2019年10月4日(金) 5:56 Sebastiaan Joosten > >: > > Hi all, > > I'm writing a lot of code that looks like this: > instance WhiteSpaced ClassItem where >   removeWS (Method a b c) > = Method (removeWS a) (removeWS b) (removeWS c) >   removeWS (Declaration b) = Declaration (removeWS b) > > Typically, all the way at the end there's an instance that > deviates (sometimes the deviating instances are somewhere in the > middle). I need to do this for a lot of functions, and a lot of > data types, and all I'm doing here is rewriting the data-type > declaration in a different syntax (except that you do not know > the types of a, b and c from the above). For the sake of > maintainability, I want to avoid this code-duplication and focus > only on the deviating instances. > > How to do better? I don't see how to use generics (in the hope > of only writing 'instance WhiteSpaced ClassItem where' instead > of the three lines above) for this: the types for a, b and c are > all different here. Would this be easier with Template Haskell? > (in the hope of only writing $(''something ClassItem) instead of > the three lines above) > > My main concern is maintainability, an ideal solution is either > a clear one-liner or a library import (in the same way that > aeson allows me to use generics or Template Haskell without > needing to know much about them). Other solutions are welcome too. > > Best, > > Sebastiaan > _______________________________________________ > 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. > > > > -- > 山本悠滋 > twitter: https://twitter.com/igrep > GitHub: https://github.com/igrep > GitLab: https://gitlab.com/igrep > Facebook: http://www.facebook.com/igrep > > > _______________________________________________ > 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 benjamin.redelings at gmail.com Tue Oct 15 14:59:09 2019 From: benjamin.redelings at gmail.com (Benjamin Redelings) Date: Tue, 15 Oct 2019 10:59:09 -0400 Subject: [Haskell-cafe] Explicit approach to lazy effects For probability monad? Message-ID: <00929421-4b00-69ef-a8c1-3c133f132230@gmail.com> Hi, I'm wondering if people could point me to some background on explicitly representing lazy effects in Haskell?  The only effect I am concerned about at this point is `seq`.  If there is a way to do this with monads, that would be great.  (I know that a lot of people hate lazy effects.  However, I think this is an orthogonal issue to the question of how to *represent* lazy effects explicitly.) As background, I'm using a lazy probability monad where random sampling is done with unsafeInterleaveST/IO (or something similar), so that random variables are only sampled if they are actually used: model = do x <- sample $ normal 0 1 -- the interpreter does `unsafeInterleaveIO` to implement 'sample' cond <- sample $ bernoulli 0.5 let y = if cond == 1 then x else 0 return y Here, x is only sampled if cond==1.  This has a lot of benefits in procedures like Markov chain Monte Carlo. I initially thought that I could model lazy effects by mapping a -> (a,state) as in the ST monad.  However, it seems  like lazy effects basically require allowing forked state threads to join CONDITIONALLY on if a value is used/forced, and I don't see how to do that without a source-to-source transformation of functions. It seems like lazy effects require tracking state within each closure, and not globally within the monad interpreter. It kind of seems like this can't work if >>= has type 'm a -> (a -> m b) -> mb', assuming m a = (a,state).  The second argument needs to have type (m a -> m b) instead of (a -> m b), since the computation needs to have access to the state produced by the first "m a" computation, in order to (optionally) depend on the state thread for first computation. Does this make any sense?  I don't know the literature in this area. Q1. Is there a nice way of representing lazy effects that someone could point me to? Q2. Alternatively, is there a proof that either   (i) there is not a monadic way to represent lazy effects, or   (ii) fmap f requires a source-to-source transformation (for example to explicitly join state threads on strict operations like ($) and case). -BenRI P.S. As even more background, I'm using a probability monad that allows you to e.g. generate an infinite list of random variables, and only instantiate the ones that are looked at: model = do n <- sample $ geometric 0.5   ys <- sample $ list (repeat $ normal 0.0 1.0) zs <- take n ys return (sum zs) Here the number of random variables (n) can change over time, and I ultimately want effects to happen when they are instantiated. There is a brief overview at http://www.bali-phy.org/models.php -------------- next part -------------- An HTML attachment was scrubbed... URL: From ichistmeinname at web.de Tue Oct 15 15:10:14 2019 From: ichistmeinname at web.de (Sandra Dylus) Date: Tue, 15 Oct 2019 17:10:14 +0200 Subject: [Haskell-cafe] Explicit approach to lazy effects For probability monad? In-Reply-To: <00929421-4b00-69ef-a8c1-3c133f132230@gmail.com> References: <00929421-4b00-69ef-a8c1-3c133f132230@gmail.com> Message-ID: <19EB8AB6-D6DB-4A6E-9C19-0C453F81B0B9@web.de> Hi, On 15. Oct 2019, at 16:59, Benjamin Redelings wrote: > I'm wondering if people could point me to some background on explicitly representing lazy effects in Haskell? The only effect I am concerned about at this point is `seq`. If there is a way to do this with monads, that would be great. (I know that a lot of people hate lazy effects. However, I think this is an orthogonal issue to the question of how to *represent* lazy effects explicitly.) if you’re explicitly interested in sharing computations (rather than only modelling non-strictness) then the following approach by Fisher, Kiselyov and Shan might be of interest. http://homes.sice.indiana.edu/ccshan/rational/S0956796811000189a.pdf (Purely functional lazy nondeterministic programming) The are modelling the functional logic language Curry, but have also some remarks about modelling a lazy probabilistic language with their approach. If you’re not interested in the sharing part of laziness, the paper might be a good first starting point nonetheless. They use a deep monadic embedding that you can use to model non-strictness. Other papers that use such an encoding are the following. http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.192.7153&rep=rep1&type=pdf#page=8 (Transforming Functional Logic Programs into Monadic Functional Programs) http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.134.9706&rep=rep1&type=pdf (Verifying Haskell Programs Using Constructive Type Theory) Best regards Sandra From ruben.astud at gmail.com Wed Oct 16 03:13:20 2019 From: ruben.astud at gmail.com (Ruben Astudillo) Date: Wed, 16 Oct 2019 00:13:20 -0300 Subject: [Haskell-cafe] Using GHCJS on firebase functions Message-ID: <5045c80a-2adb-201a-ec1c-aedc34f20d1f@gmail.com> Dear list Has anyone used GHCJS on Firebase functions? How has it been your experience? Would you recommend it or offer al alternative?. -- -- Ruben -- PGP: 4EE9 28F7 932E F4AD From ietf-dane at dukhovni.org Wed Oct 16 07:52:48 2019 From: ietf-dane at dukhovni.org (Viktor Dukhovni) Date: Wed, 16 Oct 2019 03:52:48 -0400 Subject: [Haskell-cafe] Windows, doctest and auxiliary FFI wrappers? In-Reply-To: <20191015074746.GJ34850@straasha.imrryr.org> References: <20191015074746.GJ34850@straasha.imrryr.org> Message-ID: <20191016075248.GM34850@straasha.imrryr.org> On Tue, Oct 15, 2019 at 03:47:46AM -0400, Viktor Dukhovni wrote: > What I've tried: > > 2. Build a separate internal library (supported in Cabal > 2.0 and later), which is a dependency of the main library > and links in the C glue code, but this proved to be a > significant rabbit hole... Following up on my own post, for the record I should note that in fact the second approach work out with GHC 8.[468].x and Cabal 2.x through the magic of .ghc.environment.* files. With Cabal 3.0, these are no longer written by default, but it suffices to create a cabal.project file containing just: packages: . write-ghc-environment-files: always The crux of my issue seems to be that this does not work with older GHC releases (e.g. 8.0.2 and 8.2.2) and perhaps the flag was not set by the Cabal used in AppVeyor on Windows or some other nit got in the way. I now have doctests compiling and running with GHC 8.[468] on Linux and so far just 8.6.5 on Windows. The custom C-code dependency was, as hoped for, satisfied by the addition of the internal library package to the doctest command arguments, I only had to hardcode the format of the "inplace" package-id. https://github.com/kazu-yamamoto/dns/blob/master/test2/doctests.hs Sadly, on Windows the doctests mostly end up hanging and timing out after an hour, but that's a separate issue, perhaps -- Viktor. From olf at aatal-apotheke.de Wed Oct 16 13:57:25 2019 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Wed, 16 Oct 2019 15:57:25 +0200 (CEST) Subject: [Haskell-cafe] stack: pandoc fails to build as dependency Message-ID: <138031038.250609.1571234245904@webmail.strato.de> Dear cafe, I am baffled to learn that stack does not provide builds as reproducible as advertised. I have a project that depends on pandoc. It builds fine on my Debian 9 machine. Then I check out the project on a Debian 8 machine. Downloading and building pandoc-2.7.3 with the latest stack-2.1.3 on the Debian 8 machine runs fine. Now I create a new project, using the same stack.yaml as in the pandoc-2.7.3 package, except now pandoc-2.7.3 is an extra-dep. The project's only module contains nothing but: module Test where import Text.Pandoc Building this project with the same stack results in a linker error: pandoc > Preprocessing executable 'pandoc' for pandoc-2.7.3.. pandoc > Building executable 'pandoc' for pandoc-2.7.3.. pandoc > [1 of 2] Compiling Main pandoc > [2 of 2] Compiling Paths_pandoc pandoc > Linking .stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/pandoc/pandoc ... pandoc > collect2: error: ld returned 1 exit status pandoc > `gcc' failed in phase `Linker'. (Exit code: 1) This seems to be independent of the LTS version (the stack.yaml in pandoc-2.7.3 says lts-13.17 although lts-13.17 contains pandoc-2.5 and pandoc-2.7.3 is available only in 14.9). Can somebody hint what I am doing wrong? Should I file a bug report? Thanks Olaf From neil_mayhew at users.sourceforge.net Wed Oct 16 14:22:12 2019 From: neil_mayhew at users.sourceforge.net (Neil Mayhew) Date: Wed, 16 Oct 2019 08:22:12 -0600 Subject: [Haskell-cafe] stack: pandoc fails to build as dependency In-Reply-To: <138031038.250609.1571234245904@webmail.strato.de> References: <138031038.250609.1571234245904@webmail.strato.de> Message-ID: <535d93c1-3025-fb5f-e139-23042e1ed34d@users.sourceforge.net> On 2019-10-16 7:57 a.m., Olaf Klinke wrote: > pandoc > collect2: error: ld returned 1 exit status > pandoc > `gcc' failed in phase `Linker'. (Exit code: 1) Building with Stack still has to use some system libraries, and I assume a difference between Debian 8 and Debian 9 is tripping this up. Can you get more info about what the linker error is? You should be able to see more in the log files. -------------- next part -------------- An HTML attachment was scrubbed... URL: From frederic-emmanuel.picca at synchrotron-soleil.fr Wed Oct 16 19:40:26 2019 From: frederic-emmanuel.picca at synchrotron-soleil.fr (PICCA Frederic-Emmanuel) Date: Wed, 16 Oct 2019 19:40:26 +0000 Subject: [Haskell-cafe] problem with servant and type constrains Message-ID: Hello, I have a type for my APi like this type SubscribeAPI a = "upload" :> ReqBody '[JSON] (JobSpecSub a) :> Post '[JSON] () type HomepageAPI = "homepage" :> QueryParam "id" Int :> Get '[HTML] Homepage type XdsMeAPI a = "xdsme" :> ReqBody '[FormUrlEncoded] XdsMeRequest :> Post '[JSON] (JobSpecSub a) type LogsAPI = "logs" :> ReqBody '[FormUrlEncoded] LogsRequest :> Post '[HTML] Html type ResumXdsAPI = "resumxds" :> ReqBody '[FormUrlEncoded] ResumXdsRequest :> Post '[HTML] Html type SessionIdAPI = "sessionid" :> ReqBody '[FormUrlEncoded] SessionIdRequest :> Post '[HTML] Html type MyApi a = SubscribeAPI a :<|> HomepageAPI :<|> XdsMeAPI a :<|> LogsAPI :<|> ResumXdsAPI :<|> SessionIdAPI myApi :: Job a => Proxy (MyApi a) myApi = Proxy When I try to write the handler for this API, I have this error message for the next code myAPIServer :: Job a => Beamline -> JobQueue a -> Server (MyApi a) myAPIServer beam jobQueue = handleJobSpec :<|> handleHomepage :<|> handleXdsMe :<|> handleLogs :<|> handleResumXds :<|> handleSessionId where handleJobSpec :: Job b => JobSpecSub b -> Handler () handleJobSpec jobSpec = liftIO $ enqueue jobSpec jobQueue • Couldn't match type ‘a’ with ‘b’ ‘a’ is a rigid type variable bound by the type signature for: myAPIServer :: forall a. Job a => Beamline -> JobQueue a -> Server (MyApi a) at src/Web.hs:235:1-66 ‘b’ is a rigid type variable bound by the type signature for: handleJobSpec :: forall b. Job b => JobSpecSub b -> Handler () at src/Web.hs:238:5-56 Expected type: JobQueue b Actual type: JobQueue a • In the second argument of ‘enqueue’, namely ‘jobQueue’ In the second argument of ‘($)’, namely ‘enqueue jobSpec jobQueue’ In the expression: liftIO $ enqueue jobSpec jobQueue • Relevant bindings include jobSpec :: JobSpecSub b (bound at src/Web.hs:239:19) handleJobSpec :: JobSpecSub b -> Handler () (bound at src/Web.hs:239:5) jobQueue :: JobQueue a (bound at src/Web.hs:236:18) myAPIServer :: Beamline -> JobQueue a -> Server (MyApi a) (bound at src/Web.hs:236:1) | 239 | handleJobSpec jobSpec = liftIO $ enqueue jobSpec jobQueue | ^^^^^^^^ I understand that I need to explain haskell that a ~ b. So my question is how can I do this :) thanks for your help Frederic From mail at nh2.me Wed Oct 16 23:41:36 2019 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Thu, 17 Oct 2019 01:41:36 +0200 Subject: [Haskell-cafe] stack: pandoc fails to build as dependency In-Reply-To: <535d93c1-3025-fb5f-e139-23042e1ed34d@users.sourceforge.net> References: <138031038.250609.1571234245904@webmail.strato.de> <535d93c1-3025-fb5f-e139-23042e1ed34d@users.sourceforge.net> Message-ID: <5bf510ef-4a27-0614-fdd0-6069bde7c704@nh2.me> On 16/10/2019 16:22, Neil Mayhew wrote: > On 2019-10-16 7:57 a.m., Olaf Klinke wrote: >> pandoc > collect2: error: ld returned 1 exit status >> pandoc > `gcc' failed in phase `Linker'. (Exit code: 1) > > [...] Can you get more info about what the linker error is? Indeed, the linker exiting with status 1 without any stderr message sounds like your linker is crashing. Consider `stack build --cabal-verbose`, and if that doesn't provide the necessary level of detail yet, take the last `ghc` invocation it makes, run that directly and add `-v` to that to get GHC's verbose output, which will show you the full linker invocation (which you may then, again, run directly, thus drilling down to the tool that exits with an error unexpectedly). Alternatively, you may use `strace -fy` on the top-level to get a full understanding of all IO that any process involved does, but it will be verbose. From olf at aatal-apotheke.de Thu Oct 17 13:23:06 2019 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Thu, 17 Oct 2019 15:23:06 +0200 (CEST) Subject: [Haskell-cafe] stack: pandoc fails to build as dependency Message-ID: <211309430.313854.1571318586343@webmail.strato.de> >> [...] Can you get more info about what the linker error is? > Indeed, the linker exiting with status 1 without any stderr > message sounds like your linker is crashing. > take the last `ghc` invocation it makes, run that directly and add `-v` to that to get GHC's verbose output, which will show you the full linker invocation I don't know yet what causes the linker to crash, but I found a work-around: If I download any pandoc version, extract it and run `stack build` inside that directory, it is fine. So I created a symlink to that local pandoc dir inside my package root and made pandoc a part of my own package. Then everything builds all right. Hence there must be something going wrong when stack downloads and builds pandoc somewhere inside .stack-work/. It seems difficult to just run the last sub-command as Niklas suggests, because after the crash all the temporary files of the failed build are gone. But I'll keep investigating, thanks for the suggestions! Olaf From mail at nh2.me Thu Oct 17 13:44:01 2019 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Thu, 17 Oct 2019 15:44:01 +0200 Subject: [Haskell-cafe] stack: pandoc fails to build as dependency In-Reply-To: <211309430.313854.1571318586343@webmail.strato.de> References: <211309430.313854.1571318586343@webmail.strato.de> Message-ID: <0b744f1e-882d-4768-703a-14e4c3ace496@nh2.me> Hey Olaf, > It seems difficult to just run the last sub-command as Niklas suggests, because after the crash all the temporary files of the failed build are gone. But I'll keep investigating, thanks for the suggestions! Both `stack` and `ghc` have a flag `--keep-tmp-files` that may be useful here. From vandijk.roel at gmail.com Thu Oct 17 13:54:18 2019 From: vandijk.roel at gmail.com (Roel van Dijk) Date: Thu, 17 Oct 2019 15:54:18 +0200 Subject: [Haskell-cafe] problem with servant and type constrains In-Reply-To: References: Message-ID: You could try and enable the {-# ScopedTypeVariables #-} language extension [1]. Then you can write an explicit forall so that the type variable a scopes over the where clause: myAPIServer :: forall a. Job a => Beamline -> JobQueue a -> Server (MyApi a) myAPIServer beam jobQueue = handleJobSpec :<|> handleHomepage :<|> handleXdsMe :<|> handleLogs :<|> handleResumXds :<|> handleSessionId where handleJobSpec :: JobSpecSub a -> Handler () handleJobSpec jobSpec = liftIO $ enqueue jobSpec jobQueue You could also do this without the language extension by explicitly passing the type variable via some proxy, but I recommend using the ScopedTypeVariables language extension. 1 - https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#lexically-scoped-type-variables Op wo 16 okt. 2019 om 21:40 schreef PICCA Frederic-Emmanuel < frederic-emmanuel.picca at synchrotron-soleil.fr>: > Hello, I have a type for my APi like this > > type SubscribeAPI a = "upload" :> ReqBody '[JSON] (JobSpecSub a) :> Post > '[JSON] () > type HomepageAPI = "homepage" :> QueryParam "id" Int :> Get '[HTML] > Homepage > type XdsMeAPI a = "xdsme" :> ReqBody '[FormUrlEncoded] XdsMeRequest :> > Post '[JSON] (JobSpecSub a) > type LogsAPI = "logs" :> ReqBody '[FormUrlEncoded] LogsRequest :> Post > '[HTML] Html > type ResumXdsAPI = "resumxds" :> ReqBody '[FormUrlEncoded] ResumXdsRequest > :> Post '[HTML] Html > type SessionIdAPI = "sessionid" :> ReqBody '[FormUrlEncoded] > SessionIdRequest :> Post '[HTML] Html > > type MyApi a = SubscribeAPI a :<|> HomepageAPI :<|> XdsMeAPI a :<|> > LogsAPI :<|> ResumXdsAPI :<|> SessionIdAPI > > myApi :: Job a => Proxy (MyApi a) > myApi = Proxy > > When I try to write the handler for this API, I have this error message > for the next code > > myAPIServer :: Job a => Beamline -> JobQueue a -> Server (MyApi a) > myAPIServer beam jobQueue = handleJobSpec :<|> handleHomepage :<|> > handleXdsMe :<|> handleLogs :<|> handleResumXds :<|> handleSessionId > where > handleJobSpec :: Job b => JobSpecSub b -> Handler () > handleJobSpec jobSpec = liftIO $ enqueue jobSpec jobQueue > > > • Couldn't match type ‘a’ with ‘b’ > ‘a’ is a rigid type variable bound by > the type signature for: > myAPIServer :: forall a. > Job a => > Beamline -> JobQueue a -> Server (MyApi a) > at src/Web.hs:235:1-66 > ‘b’ is a rigid type variable bound by > the type signature for: > handleJobSpec :: forall b. Job b => JobSpecSub b -> Handler () > at src/Web.hs:238:5-56 > Expected type: JobQueue b > Actual type: JobQueue a > • In the second argument of ‘enqueue’, namely ‘jobQueue’ > In the second argument of ‘($)’, namely ‘enqueue jobSpec jobQueue’ > In the expression: liftIO $ enqueue jobSpec jobQueue > • Relevant bindings include > jobSpec :: JobSpecSub b (bound at src/Web.hs:239:19) > handleJobSpec :: JobSpecSub b -> Handler () > (bound at src/Web.hs:239:5) > jobQueue :: JobQueue a (bound at src/Web.hs:236:18) > myAPIServer :: Beamline -> JobQueue a -> Server (MyApi a) > (bound at src/Web.hs:236:1) > | > 239 | handleJobSpec jobSpec = liftIO $ enqueue jobSpec jobQueue > | ^^^^^^^^ > > > I understand that I need to explain haskell that a ~ b. > > So my question is how can I do this :) > > thanks for your help > > Frederic > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From olf at aatal-apotheke.de Thu Oct 17 20:03:39 2019 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Thu, 17 Oct 2019 22:03:39 +0200 Subject: [Haskell-cafe] Explicit approach to lazy effects For probability monad? Message-ID: Hi Benjamin, Your example code seems to deal with two distinct types: The do-notation is about the effects monad (on the random number generator?) and the `sample` function pulls whatever representation you have for an actual probability distribution into this effect monad. In my mental model, the argument to `sample` represents a function Double -> x that interprets a number coming out of the standard random number generator as an element of type x. I suggest to consider the following two properties of the mathematical probability monad (a.k.a. the Giry monad), which I will use as syntactic re-write rules in your modeling language. The first property is Fubini's Theorem. In Haskell terms it says that for all f, a :: m x and b :: m y the two terms do {x <- a; y <- b; f x y} do {y <- b; x <- a; f x y} are semantically equivalent. (For state monads, this fails.) Monads where this holds are said to be commutative. If you have two urns, then drawing from the left and then drawing from the right is the same as first drawing from the right and then drawing from the left. Using Fubini, we can swap the first two lines in your example: model = do cond <- bernoulli 0.5 x <- normal 0 1 return (if cond == 1 then x else 0) This desugars to bernoulli 0.5 >>= (\cond -> normal 0 1 >>= (\x -> return (if cond == 1 then x else return 0))) bernoulli 0.5 >>= (\cond -> fmap (\x -> if cond == 1 then x else 0) (normal 0 1)) The second property is a kind of lazyness, namely fmap (const x) and return are semantically equivalent. which holds for mathematical distributions (but not for state monads). Now one could argue that in case cond == 0 the innermost function is constant in x, in which case the whole thing does not depend on the argument (normal 0 1). The Lemma we need here is semantic equivalence of the following two lambda terms. \cond -> \x -> if cond == 1 then x else 0 \cond -> if cond == 1 then id else const 0 If the above is admissible then the following syntactic transformation is allowed: model = do cond <- bernoulli 0.5 if cond == 1 then normal 0 1 else return 0 which makes it obvious that the normal distribution is only sampled when needed. But I don't know whether you would regard this as the same model. Notice that I disregarded your `sample` function. That is, my monadic language is the monad of probabilites, not the monad of state transformations of a random number generator. Maybe you can delay using the random number generator until the very end? I don't know the complete set of operations your modeling language sports. If that delay is possible, then maybe you can use a monad that has the above two properties (e.g. a reader monad) and only feed the random numbers to the final model. As proof of concept, consider the following. type Model = Reader Double model :: Model Int model = do x <- reader (\r -> last [1..round (recip r)]) cond <- reader (\r -> r > 0.5) return (if cond then x else 0) runReader model is fast for very small inputs, which would not be the case when the first line was always evaluated. Cheers, Olaf From olf at aatal-apotheke.de Sun Oct 20 20:45:38 2019 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Sun, 20 Oct 2019 22:45:38 +0200 Subject: [Haskell-cafe] Explicit approach to lazy effects For probability monad? Message-ID: > It kind of seems like this can't work if >>= has type 'm a -> (a -> m b) > -> mb', assuming m a = (a,state). The second argument needs to have > type (m a -> m b) instead of (a -> m b), since the computation needs to > have access to the state produced by the first "m a" computation, in > order to (optionally) depend on the state thread for first computation. My earlier suggestion of using the pure reader monad is not useful for two reasons: (1) A single random number is shared among all sub-computations, which destroys statistical independence. (2) Multi-dimensional distributions arguably require more than a single floating point number to parametrize. Maybe the following two monads hint at a better way, although none of them exhibits the two desirable properties I suggested in my first reply. It seems that both exhibit the sequential nature that you want to avoid, if the underlying monad m is sequential (i.e. stateful). (a) The free monad over the reader functor. type Distribution a = Free ((->) Double) a = Pure a | Impure (r -> Free ((->) Double) a) This is a reader monad of functions (Double,Double,...,Double) -> a where the tuple length may be any finite number. -- @choose p@ chooses the first distribution with probability @p at . choose :: Double -> Distribution a -> Distribution a -> Distribution a choose p x y = Impure (\r -> if r <= p then x else y) -- Feed a random number generator into a distribution. -- You get to decide which monad that is. sample :: Monad m => m r -> Free ((->) r) a -> m a sample _ (Pure a) = pure a sample gen (Impure f) = (sample gen) =<< (fmap f gen) (b) A reader monad which passes copies of the random number generator around, not the generator state. Again, you get to choose which monad the random number generator lives in. type DistrT m a = ReaderT (m Double) m a ~ m Double -> m a -- 'chooseT' queries the random number generator once -- and then passes it down to either of the two choices. chooseT :: Monad m => Double -> DistrT m a -> DistrT m a -> DistrT m a chooseT p x y = ReaderT (\gen -> gen >>= (\r -> if r <= p then runReaderT x gen else runReaderT y gen)) sampleT = runReaderT :: DistrT m a -> m Double -> m a Apologies that I can not be any more helpful at the moment. But the topic really interests me, please do post any progress on haskell-cafe. Olaf From matthewtpickering at gmail.com Mon Oct 21 11:45:39 2019 From: matthewtpickering at gmail.com (Matthew Pickering) Date: Mon, 21 Oct 2019 12:45:39 +0100 Subject: [Haskell-cafe] Bristol Haskell Hackathon 2020 Message-ID: I have decided to organise an informal hackathon in Bristol at the start of next year. When 25th-26th January 2020 Where Merchant Venturers Building - University of Bristol Time 09:00 - 17:00 Anyone interested in Haskell is welcome to attend. Whether you are a beginner or an expert it would be great to meet you in Bristol. It is a no-frills hackathon, we’ll provide a room for hacking and wifi but expect little else! There will be no t-shirts, food, talks or other perks. The focus will be 100% on hacking and meeting other Haskell programmers. For further information about the event and how to register please refer to the dedicated page. https://mpickering.github.io/bristol2020.html Cheers, Matt From gabriel.rodriguez at udc.es Wed Oct 23 08:09:22 2019 From: gabriel.rodriguez at udc.es (=?Windows-1252?Q?Gabriel_Rodr=EDguez_=C1lvarez?=) Date: Wed, 23 Oct 2019 08:09:22 +0000 Subject: [Haskell-cafe] [CC2020] Paper registration deadline *extended*. Last CFP for the ACM SIGPLAN 2020 International Conference on Compiler Construction In-Reply-To: References: , , , , , , , , Message-ID: ACM SIGPLAN 2020 International Conference on Compiler Construction (CC'20) co-located with CGO, PPoPP and HPCA San Diego, CA, USA February 22 - 23, 2020 https://conf.researchr.org/home/CC-2020 The ACM SIGPLAN 2020 International Conference on Compiler Construction (CC 2020) is interested in work on processing programs in the most general sense: analyzing, transforming or executing input programs that describe how a system operates, including traditional compiler construction as a special case. Original contributions are solicited on the topics of interest which include, but are not limited to: - Compilation and interpretation techniques, including program representation, analysis, and transformation; code generation, optimization, and synthesis; the verification thereof - Run-time techniques, including memory management, virtual machines, and dynamic and just-in-time compilation - Programming tools, including refactoring editors, checkers, verifiers, compilers, debuggers, and profilers - Techniques for specific domains, such as secure, parallel, distributed, embedded or mobile environments - Design and implementation of novel language constructs, programming models, and domain-specific languages CC 2020 is the 29th edition of the conference. From this year onwards, CC is an ACM SIGPLAN conference and will implement guidelines and procedures recommended by SIGPLAN https://www.sigplan.org. ============================================================================================== To subscribe to the CC announce mailing list, see cc_conference_announce at googlegroups.com To subscribe to the CC announce Twitter account, see @cc2020conf (https://twitter.com/cc2020conf) ============================================================================================== IMPORTANT DATES Abstract Submission: 25 October 2019 ***** EXTENDED ***** Paper Submission : 30 October 2019 Rebuttal : 4-6 December 2019 Artifact Submission: 13 December 2019 Author Notification: 24 December 2019 Final papers due : 15 January 2020 Conference : 22–23 February 2020 All submissions must be made electronically through the conference web site and include an abstract (100–400 words), author contact information, the full list of authors and their affiliations. Full paper submissions must be in PDF formatted printable on both A4 and US letter size paper. All papers must be prepared in ACM Conference Format using the 2-column acmart format. Papers should contain a maximum of 10 pages of text (in a typeface no smaller than 10 point) or figures, NOT INCLUDING references. There is no page limit for references and they must include the name of all authors (not {et al.}). Appendices are not allowed, but the authors may submit supplementary material, such as proofs or source code; all supplementary material must be in PDF or ZIP format. Looking at supplementary material is at the discretion of the reviewers. Submission is double blind and authors will need to identify any potential conflicts of interest with PC, as defined here: http://www.sigplan.org/Resources/Policies/Review/ (ACM SIGPLAN policy). Authors are encouraged to submit their artifacts for the Artifact Evaluation (AE). The Artifact Evaluation process is run by a separate committee whose task is to assess how the artifacts support the work described in the papers. To ease the organization of the AE committee, we kindly ask authors to submit their artifact at the latest 10 days after the rebuttal. Papers that go through the Artifact Evaluation process successfully will receive a seal of approval printed on the papers themselves. Additional information will be made available on the CC AE web page. Deadlines expire at midnight anywhere on earth. ORGANIZERS General Chair Louis-Noel Pouchet Colorado State University Program Chair Alexandra Jimborean Uppsala University Artifact Evaluation Chairs Michel Steuwer University of Glasgow Martin Kong University of Oklahoma Publicity Chair Gabriel Rodriguez University of A Coruna Web Chair Mihail Popov Uppsala University Steering Committee Bjorn Franke University of Edinburgh Sebastian Hack Saarland University Manuel Hermenegildo IMDEA SW Institute and Technical U. of Madrid Peng Wu Huawei America Research Lab Ayal Zaks Intel and Technion, Israel Jingling Xue University of New South Wales, Australia Christophe Dubach University of Edinburgh Nelson J. Amaral University of Alberta Milind Kulkarni Purdue University Program Committee Apan Qasem AMD/Texas State University Bernhard Scholz University of Sydney Bettina Heim Microsoft Bilha Mendelson Optitura Brian Demsky UC Irvine Changhee Jung Purdue University Christian Schulte KTH EJ Park Los Alamos National Laboratory Delphine Demange Inria Dongyoon Lee Stony Brook University Fernando Magno Quintao Pereira UFMG Brazil Haowei Wu Google Manuel Hermenegildo IMDEA and T.U. Madrid Matin Hashemi Sharif University of Technology Michel Steuwer University of Glasgow Mila Dalla Preda University of Verona Nelson J. Amaral University of Alberta Philippe Clauss University of Strasbourg Pavlos Petoumenos University of Edinburgh Rumyana Neykova Brunel London Santosh Nagarakatte Rutgers University Sebastian Hack University of Saarland Tomofumi Yuki Inria Xu Liu College of William and Mary -------------- next part -------------- An HTML attachment was scrubbed... URL: From kazuki.okamoto at kakkun61.com Thu Oct 24 06:00:12 2019 From: kazuki.okamoto at kakkun61.com (=?UTF-8?B?5bKh5pys5ZKM5qi5?=) Date: Thu, 24 Oct 2019 15:00:12 +0900 Subject: [Haskell-cafe] postgresql-pure released Message-ID: Hello. I published a library “postgresql-pure”, which is a PostgreSQL driver written in pure Haskell, a few days ago. This library is developed to aim: - to increase the performance on multi CPU core environments - to run on multi platform - to build it easier especially on Windows to remove the dependency on libpq, which is made by C - there is postgres-wire which is a fast implementation but it doesn't support Windows I confirmed that: - the performance was proportional to the number of cores - the performance on 12 cores were 28% better than postgres-wire, 300% better than postgresql-simple Both test cases are simple constant value queries like “SELECT 2147483647 :: int4, …” to decrease server's load. I'm writing a report about this development and I will send email again. Please try this and feel free to report issues. Best, Kazuki Okamoto Hackage: http://hackage.haskell.org/package/postgresql-pure GitHub: https://github.com/iij-ii/postgresql-pure From stefan.wehr at gmail.com Thu Oct 24 14:55:53 2019 From: stefan.wehr at gmail.com (Stefan Wehr) Date: Thu, 24 Oct 2019 16:55:53 +0200 Subject: [Haskell-cafe] 2nd Call for Contributions: BOB 2020 [Feb 28, Deadline Nov 8] Message-ID: BOB Conference 2020 "What happens when we use what's best for a change?" http://bobkonf.de/2020/cfc.html Berlin, February 28 Call for Contributions Deadline: November 8, 2019 You are actively engaged in advanced software engineering methods, implement ambitious architectures and are open to cutting-edge innovation? Attend this conference, meet people that share your goals, and get to know the best software tools and technologies available today. We strive to offer a day full of new experiences and impressions that you can use to immediately improve your daily life as a software developer. If you share our vision and want to contribute, submit a proposal for a talk or tutorial! NOTE: The conference fee will be waived for presenters. Travel expenses will not be covered (for exceptions see "Speaker Grants"). Speaker Grants -------------- BOB has Speaker Grants available to support speakers from groups under-represented in technology. We specifically seek women speakers and speakers who are not be able to attend the conference for financial reasons. Shepherding ----------- The program committee offers shepherding to all speakers. Shepherding provides speakers assistance with preparing their sessions, as well as a review of the talk slides. Topics ------ We are looking for talks about best-of-breed software technology, e.g.: - functional programming - persistent data structures and database - event-based modelling and architectures - types - formal methods for correctness and robustness - abstractions for concurrency and parallelism - metaprogramming - probabilistic programming - math and programming - controlled side effects - beyond REST and SOAP - effective abstractions for data analytics - ... everything really that isn’t mainstream, but you think should be. Presenters should provide the audience with information that is practically useful for software developers. We're especially interested in experience reports. Other topics are also relevant, e.g.: - introductory talks on technical background - overviews of a given field - demos and how-tos Requirements ------------- We accept proposals for presentations of 45 minutes (40 minutes talk + 5 minutes questions), as well as 90 minute tutorials for beginners. The language of presentation should be either English or German. Your proposal should include (in your presentation language of choice): - An abstract of max. 1500 characters. - A short bio/cv - Contact information (including at least email address) - A list of 3-5 concrete ideas of how your work can be applied in a developer's daily life - additional material (websites, blogs, slides, videos of past presentations, …) Submit here: https://bobcfc.active-group.de/en/bob2020/cfp Organisation ------------ - Direct questions to contact at bobkonf dot de - Proposal deadline: November 8, 2019 - Notification: November 22, 2019 - Program: December 6, 2019 Program Committee ----------------- (more information here: https://bobkonf.de/2020/programmkomitee.html) - Matthias Fischmann, Wire - Matthias Neubauer, SICK AG - Nicole Rauch, Softwareentwicklung und Entwicklungscoaching - Michael Sperber, Active Group - Stefan Wehr, factis research Scientific Advisory Board - Annette Bieniusa, TU Kaiserslautern - Torsten Grust, Uni Tübingen - Peter Thiemann, Uni Freiburg -------------- next part -------------- An HTML attachment was scrubbed... URL: From aramis at systemli.org Sat Oct 26 08:27:30 2019 From: aramis at systemli.org (=?utf-8?B?QXJhbcOtcyBDb25jZXBjacOzbiBEdXLDoW4=?=) Date: Sat, 26 Oct 2019 10:27:30 +0200 Subject: [Haskell-cafe] reading from a unix pipe and then from the user Message-ID: <20191026082730.GA6806@eee.fritz.box> Hello, I'm trying to write a program that first reads input from a pipe and then reads keyboard input from the user (like fzf, the fuzzy finder). Under different circumstances I could open a handle to `/dev/tty` and use the `hGet...` functions from `System.IO` to get the user's keyboard input, but I'm constructing the text user interface with the brick library, which doesn't seem to give my any way to sneak in alternative handles through its application entry point functions. So, what I'm looking for is a function which takes an `IO ()` function like the usual `main` and a `Handle` and turns it into an `IO ()` function that reads from the provided handle instead of `stdin`. Does that make sense? I might be looking for something that doesn't exist. Or I'm lacking the language to get results from a search engine. To illustrate the problem further, here is a condensed brick application: import qualified Brick.Main as Main import qualified Brick.Types as Types import qualified Graphics.Vty as Vty import Brick.AttrMap ( attrMap ) import Brick.Widgets.Core ( str ) type Event = Types.EventM () ( Types.Next () ) main = let app = Main.App { Main.appChooseCursor = Main.neverShowCursor , Main.appHandleEvent = \ _ _ -> Main.halt () :: Event , Main.appStartEvent = pure , Main.appAttrMap = \ _ -> attrMap Vty.currentAttr [] , Main.appDraw = \ _ -> [ str Hit any key to exit. ] } in Main.defaultMain app () How do I get this `main` function to read from a custom handle intead of stdin? From allbery.b at gmail.com Sat Oct 26 13:34:49 2019 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 26 Oct 2019 09:34:49 -0400 Subject: [Haskell-cafe] reading from a unix pipe and then from the user In-Reply-To: <20191026082730.GA6806@eee.fritz.box> References: <20191026082730.GA6806@eee.fritz.box> Message-ID: If brick really doesn't provide a way to override the input handle, your best bet is to use System.Posix.IO.dup to "copy" the original stdInput pipe to a new file descriptor, fdClose stdInput, openFd /dev/tty, dupTo the handle to stdInput (== 0) if necessary (POSIX says it is, actual Unixes will have opened /dev/tty on to fd 0 already if you closed it first), then use fdToHandle to get a handle for the new pipe. Don't do any IO on the pipe before doing this, or there will be no safe way to synchronize the existing Handle with its new fd. The mappings between the things in System.Posix.IO and the underlying Unix / POSIX syscalls is fairly obvious if you already know the latter; the only new ones are fdToHandle and handleToFd which correspond to C stdio's openfd() and fileno(). On Sat, Oct 26, 2019 at 9:17 AM Aramís Concepción Durán wrote: > Hello, > > I'm trying to write a program that first reads input from > a pipe and then reads keyboard input from the user (like > fzf, the fuzzy finder). > > Under different circumstances I could open a handle to > `/dev/tty` and use the `hGet...` functions from `System.IO` > to get the user's keyboard input, but I'm constructing the > text user interface with the brick library, which doesn't > seem to give my any way to sneak in alternative handles > through its application entry point functions. > > So, what I'm looking for is a function which takes an > `IO ()` function like the usual `main` and a `Handle` > and turns it into an `IO ()` function that reads from the > provided handle instead of `stdin`. > > Does that make sense? I might be looking for something > that doesn't exist. Or I'm lacking the language to get > results from a search engine. > > To illustrate the problem further, here is a condensed > brick application: > > import qualified Brick.Main as Main > import qualified Brick.Types as Types > import qualified Graphics.Vty as Vty > > import Brick.AttrMap ( attrMap ) > import Brick.Widgets.Core ( str ) > > type Event = Types.EventM () ( Types.Next () ) > > main = > let > app = > Main.App > { Main.appChooseCursor = Main.neverShowCursor > , Main.appHandleEvent = \ _ _ -> Main.halt () :: Event > , Main.appStartEvent = pure > , Main.appAttrMap = \ _ -> attrMap Vty.currentAttr [] > , Main.appDraw = \ _ -> [ str Hit any key to exit. ] > } > in > Main.defaultMain app () > > How do I get this `main` function to read from a custom > handle intead of stdin? > _______________________________________________ > 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 aramis at systemli.org Sun Oct 27 08:03:52 2019 From: aramis at systemli.org (=?utf-8?B?QXJhbcOtcyBDb25jZXBjacOzbiBEdXLDoW4=?=) Date: Sun, 27 Oct 2019 09:03:52 +0100 Subject: [Haskell-cafe] reading from a unix pipe and then from the user In-Reply-To: References: <20191026082730.GA6806@eee.fritz.box> Message-ID: <20191027080352.GA24849@eee.fritz.box> That works and solves my problem. Thank you! From leah at vuxu.org Sun Oct 27 12:15:07 2019 From: leah at vuxu.org (Leah Neukirchen) Date: Sun, 27 Oct 2019 13:15:07 +0100 Subject: [Haskell-cafe] Munich Haskell Meeting, 2019-10-29 @ 19:30 Message-ID: <87sgnegzas.fsf@vuxu.org> Dear all, Next week, our monthly Munich Haskell Meeting will take place again on Tuesday, October 29 at Augustiner-Gaststätte Rumpler at 19h30. For details see here: http://muenchen.haskell.bayern/dates.html If you plan to join, please add yourself to this dudle so we can reserve enough seats! It is OK to add yourself to the dudle anonymously or pseudonymously. https://dudle.inf.tu-dresden.de/haskell-munich-oct-2019/ Everybody is welcome! cu, -- Leah Neukirchen https://leahneukirchen.org/ From neil_mayhew at users.sourceforge.net Sun Oct 27 13:30:55 2019 From: neil_mayhew at users.sourceforge.net (Neil Mayhew) Date: Sun, 27 Oct 2019 07:30:55 -0600 Subject: [Haskell-cafe] reading from a unix pipe and then from the user In-Reply-To: <20191026082730.GA6806@eee.fritz.box> References: <20191026082730.GA6806@eee.fritz.box> Message-ID: On 2019-10-26 2:27 a.m., Aramís Concepción Durán wrote: > I could open a handle to `/dev/tty` It's also worth noting that many similar programs use stderr instead of /dev/tty. Each approach has its advocates. vim -i uses stderr, for example, and sudo uses /dev/tty. -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Sun Oct 27 17:11:32 2019 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 27 Oct 2019 13:11:32 -0400 Subject: [Haskell-cafe] reading from a unix pipe and then from the user In-Reply-To: References: <20191026082730.GA6806@eee.fritz.box> Message-ID: It depends on what you're doing, to. For passwords, /dev/tty is almost always best. If you have reason to expect that someone might want to redirect the user's input for some reason, stderr would be a better choice. But also consider that someone might want to capture a fatal error from stderr (not all programs are well behaved, and in particular ghc's runtime panics would still go to stderr ignoring brick; also consider any FFI callouts to C that might assume stderr is a dedicated error channel) which would again suggest /dev/tty. There's no one right answer here, in short. On Sun, Oct 27, 2019 at 9:31 AM Neil Mayhew < neil_mayhew at users.sourceforge.net> wrote: > On 2019-10-26 2:27 a.m., Aramís Concepción Durán wrote: > > I could open a handle to `/dev/tty` > > It's also worth noting that many similar programs use stderr instead of > /dev/tty. Each approach has its advocates. vim -i uses stderr, for example, > and sudo uses /dev/tty. > _______________________________________________ > 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 john at yourdigitalvoice.net Mon Oct 28 17:35:16 2019 From: john at yourdigitalvoice.net (John Sinclair) Date: Mon, 28 Oct 2019 23:05:16 +0530 Subject: [Haskell-cafe] Functional Conference 2019 with Edward Kmett keynote | Bengaluru, 13-17 November Message-ID: Hi haskell-cafe! If you're in India, you'll be interested in Functional Conference 2019. It's an opportunity to meet up with other functional programmers and Haskell users. You'll learn from Edward Kmett who is chairman of the Haskell Core Libraries Committee. He'll be delivering a keynote, a workshop and more. https://confng.in/Kmg8m-Tx Michael Snoyman from Israel will be giving an Applied Haskell workshop. https://confng.in/24haPWyw All up their are 15 sessions covering Haskell to broaden your horizons and deepen your knowledge. Functional Conf is the premiere event for Functional programmers in India. Our goal is to support the community with access to high quality speakers, who are innovating in this field. Learn more about the conference here: https://confng.in/wAQ41Z4q To get 10% off when you register, use the code: FnConf19Dis$ https://twitter.com/FnConf https://www.linkedin.com/showcase/functional-conf -------------- next part -------------- An HTML attachment was scrubbed... URL: From fumiexcel at gmail.com Tue Oct 29 05:03:02 2019 From: fumiexcel at gmail.com (Fumiaki Kinoshita) Date: Tue, 29 Oct 2019 14:03:02 +0900 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> Message-ID: Any updates? It's a crisis that the standard library is unavailable on Hackage... 2019年10月4日(金) 12:30 Ben Gamari : > > > On October 3, 2019 11:23:26 PM EDT, David Feuer > wrote: > >Any news? > > > >On Tue, Sep 24, 2019, 5:22 PM Ben Gamari wrote: > > > >> Dan Burton writes: > >> > >> > Will base-4.13.0.0 (which ships with ghc 8.8) be uploaded to > >hackage? > >> > > >> Yes, although it's currently waiting for someone with maintainer > >rights > >> for `base`, et al to push them. I have requested access myself > >although > >> haven't yet heard back. > >> > The issue (#17246) is still blocked on others. One issue is that uploading > the 8.8 boot packages first requires that hackage.haskell.org to be > upgraded and no Hackage admin has had time to do this yet. > > Cheers, > > - Ben > _______________________________________________ > >> Haskell-Cafe mailing list > >> To (un)subscribe, modify options or view archives go to: > >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > >> Only members subscribed via the mailman list are allowed to post. > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > _______________________________________________ > 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 jack at jackkelly.name Tue Oct 29 07:13:27 2019 From: jack at jackkelly.name (Jack Kelly) Date: Tue, 29 Oct 2019 17:13:27 +1000 Subject: [Haskell-cafe] ANN: reflex-basic-host-0.2.0.1, reflex-backend-socket-0.2.0.0 Message-ID: <87ftjcqb1k.fsf@jackkelly.name> I have just pushed two packages to hackage: 1. reflex-basic-host-0.2.0.1[1], a reflex host library for backend work, and 2. reflex-backend-socket-0.2.0.0[2] a reflex-flavoured wrapper around TCP sockets. The most important changes to reflex-basic-host are: * Hosts no longer needlessly fork a thread, meaning that it is safe to call native code which expects all library calls to come from a common thread; and * Each host runs in a separate Reflex timeline, which makes it possible to run multiple Reflex hosts in parallel. There is an example[3] on GitHub demonstrating two hosts passing messages to each other. I hope people find it useful. GitHub issues and PRs welcome[4, 5]. Best, -- Jack [1] https://hackage.haskell.org/package/reflex-basic-host-0.2.0.1 [2] https://hackage.haskell.org/package/reflex-backend-socket-0.2.0.0 [3] https://github.com/qfpl/reflex-basic-host/blob/master/example/Multithread.hs [4] https://github.com/qfpl/reflex-basic-host [5] https://github.com/qfpl/reflex-backend-socket From defigueiredo at ucdavis.edu Tue Oct 29 15:27:43 2019 From: defigueiredo at ucdavis.edu (Dimitri DeFigueiredo) Date: Tue, 29 Oct 2019 08:27:43 -0700 Subject: [Haskell-cafe] A Haskell meetup in San Francisco today Message-ID: After a long wait, there's a haskell meetup in San Francisco today. https://www.meetup.com/Bay-Area-Haskell-Users-Group/events/265110367/ Exciting! :-) Dimitri -- 2E45 D376 A744 C671 5100 A261 210B 8461 0FB0 CA1F From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Tue Oct 29 21:05:41 2019 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Tue, 29 Oct 2019 21:05:41 +0000 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> Message-ID: <20191029210541.kda57sey3z4ew7py@weber> Do you mean because you want to read the documentation, or is there some other reason that base ought to be on Hackage? It's not installable from there, as far as I know. On Tue, Oct 29, 2019 at 02:03:02PM +0900, Fumiaki Kinoshita wrote: > Any updates? It's a crisis that the standard library is unavailable on > Hackage... > > 2019年10月4日(金) 12:30 Ben Gamari : > > > > > > > On October 3, 2019 11:23:26 PM EDT, David Feuer > > wrote: > > >Any news? > > > > > >On Tue, Sep 24, 2019, 5:22 PM Ben Gamari wrote: > > > > > >> Dan Burton writes: > > >> > > >> > Will base-4.13.0.0 (which ships with ghc 8.8) be uploaded to > > >hackage? > > >> > > > >> Yes, although it's currently waiting for someone with maintainer > > >rights > > >> for `base`, et al to push them. I have requested access myself > > >although > > >> haven't yet heard back. > > >> > > The issue (#17246) is still blocked on others. One issue is that uploading > > the 8.8 boot packages first requires that hackage.haskell.org to be > > upgraded and no Hackage admin has had time to do this yet. From allbery.b at gmail.com Tue Oct 29 21:10:12 2019 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 29 Oct 2019 17:10:12 -0400 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: <20191029210541.kda57sey3z4ew7py@weber> References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> <20191029210541.kda57sey3z4ew7py@weber> Message-ID: Documentation is helpful, yes. On Tue, Oct 29, 2019 at 5:06 PM Tom Ellis < tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote: > Do you mean because you want to read the documentation, or is there some > other reason that base ought to be on Hackage? It's not installable from > there, as far as I know. > > On Tue, Oct 29, 2019 at 02:03:02PM +0900, Fumiaki Kinoshita wrote: > > Any updates? It's a crisis that the standard library is unavailable on > > Hackage... > > > > 2019年10月4日(金) 12:30 Ben Gamari : > > > > > > > > > > > On October 3, 2019 11:23:26 PM EDT, David Feuer > > > > wrote: > > > >Any news? > > > > > > > >On Tue, Sep 24, 2019, 5:22 PM Ben Gamari wrote: > > > > > > > >> Dan Burton writes: > > > >> > > > >> > Will base-4.13.0.0 (which ships with ghc 8.8) be uploaded to > > > >hackage? > > > >> > > > > >> Yes, although it's currently waiting for someone with maintainer > > > >rights > > > >> for `base`, et al to push them. I have requested access myself > > > >although > > > >> haven't yet heard back. > > > >> > > > The issue (#17246) is still blocked on others. One issue is that > uploading > > > the 8.8 boot packages first requires that hackage.haskell.org to be > > > upgraded and no Hackage admin has had time to do this yet. > _______________________________________________ > 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 a.pelenitsyn at gmail.com Tue Oct 29 22:03:58 2019 From: a.pelenitsyn at gmail.com (Artem Pelenitsyn) Date: Tue, 29 Oct 2019 18:03:58 -0400 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> <20191029210541.kda57sey3z4ew7py@weber> Message-ID: There is also no ghc package entry for 8.8.1, unfortunately. -- Best, Artem On Tue, 29 Oct 2019 at 17:10, Brandon Allbery wrote: > Documentation is helpful, yes. > > On Tue, Oct 29, 2019 at 5:06 PM Tom Ellis < > tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote: > >> Do you mean because you want to read the documentation, or is there some >> other reason that base ought to be on Hackage? It's not installable from >> there, as far as I know. >> >> On Tue, Oct 29, 2019 at 02:03:02PM +0900, Fumiaki Kinoshita wrote: >> > Any updates? It's a crisis that the standard library is unavailable on >> > Hackage... >> > >> > 2019年10月4日(金) 12:30 Ben Gamari : >> > >> > > >> > > >> > > On October 3, 2019 11:23:26 PM EDT, David Feuer < >> david.feuer at gmail.com> >> > > wrote: >> > > >Any news? >> > > > >> > > >On Tue, Sep 24, 2019, 5:22 PM Ben Gamari wrote: >> > > > >> > > >> Dan Burton writes: >> > > >> >> > > >> > Will base-4.13.0.0 (which ships with ghc 8.8) be uploaded to >> > > >hackage? >> > > >> > >> > > >> Yes, although it's currently waiting for someone with maintainer >> > > >rights >> > > >> for `base`, et al to push them. I have requested access myself >> > > >although >> > > >> haven't yet heard back. >> > > >> >> > > The issue (#17246) is still blocked on others. One issue is that >> uploading >> > > the 8.8 boot packages first requires that hackage.haskell.org to be >> > > upgraded and no Hackage admin has had time to do this yet. >> _______________________________________________ >> 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 > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at well-typed.com Wed Oct 30 03:11:04 2019 From: ben at well-typed.com (Ben Gamari) Date: Tue, 29 Oct 2019 23:11:04 -0400 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> Message-ID: <87eeyvrkqk.fsf@smart-cactus.org> Fumiaki Kinoshita writes: > Any updates? It's a crisis that the standard library is unavailable on > Hackage... > I agree; having a release out for two months without full representation on Hackage is quite suboptimal. Unfortunately, the Hackage trustees have quite a bit on their plate. I have spoken to Herbert, who usually handles the boot library uploads, several times about this and I have gleaned that the situation is as follows: * hackage-server needs to be updated to Cabal-3, tested, and the deployment updated before the remaining boot packages can be uploaded (admittedly I'm not familiar with the technical reasons for this dependency, but this is what I have been told) This is an area where a dedicated volunteer could help enormously. hackage-server is just another Haskell program (albeit one lacking contributors); all that updating it would require is time. * Herbert has said that he also wants to take a careful look through the packages before uploading them to ensure that no serious mistakes are committed permanently to the Hackage cache For what it is worth, I have asked several times whether I can help with the upload process but have been turned down repeatedly. I can't claim that I fully understand the reasoning behind this, but I can nevertheless respect the decision. I also am reluctant to make demands on the time of others. In particular, the trustees are all volunteers with lives and jobs who carry out often quite thankless work. We all owe them an enormous debt of gratitude for maintaining the infrastructure that we rely on every day, usually without thinking twice. I wish I could offer a clever idea for accelerating this process; sadly, the problem seems to be an unfortunate combination of technical dependencies (e.g. the boot library upload requiring a hackage-server update), a lack of contributors to help resolve this dependency, and a small but very busy set of core contributors. It seems to me that it would be best if we could grow the set of people who are regularly involved in Hackage administration to avoid this happening in the future. However, this will require that people who don't mind doing a bit of less-than-thrilling work (e.g. updating hackage-server) pitch in. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 487 bytes Desc: not available URL: From fumiexcel at gmail.com Wed Oct 30 05:25:12 2019 From: fumiexcel at gmail.com (Fumiaki Kinoshita) Date: Wed, 30 Oct 2019 14:25:12 +0900 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: <87eeyvrkqk.fsf@smart-cactus.org> References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> <87eeyvrkqk.fsf@smart-cactus.org> Message-ID: Thank you for clarifying the situation. I'm not sure if I understand the reasoning behind the dependency either, but I'll see if I can help with hackage-server. 2019年10月30日(水) 12:11 Ben Gamari : > Fumiaki Kinoshita writes: > > > Any updates? It's a crisis that the standard library is unavailable on > > Hackage... > > > I agree; having a release out for two months without full representation > on Hackage is quite suboptimal. Unfortunately, the Hackage trustees have > quite a bit on their plate. I have spoken to Herbert, who usually > handles the boot library uploads, several times about this and I have > gleaned that the situation is as follows: > > * hackage-server needs to be updated to Cabal-3, tested, and the > deployment updated before the remaining boot packages can be uploaded > (admittedly I'm not familiar with the technical reasons for this > dependency, but this is what I have been told) > > This is an area where a dedicated volunteer could help enormously. > hackage-server is just another Haskell program (albeit one lacking > contributors); all that updating it would require is time. > > * Herbert has said that he also wants to take a careful look through > the packages before uploading them to ensure that no serious mistakes > are committed permanently to the Hackage cache > > For what it is worth, I have asked several times whether I can help with > the upload process but have been turned down repeatedly. I can't > claim that I fully understand the reasoning behind this, but I can > nevertheless respect the decision. > > I also am reluctant to make demands on the time of others. In particular, > the trustees are all volunteers with lives and jobs who carry out often > quite thankless work. We all owe them an enormous debt of gratitude for > maintaining the infrastructure that we rely on every day, usually > without thinking twice. > > I wish I could offer a clever idea for accelerating this process; sadly, > the problem seems to be an unfortunate combination of technical > dependencies (e.g. the boot library upload requiring a hackage-server > update), a lack of contributors to help resolve this dependency, and > a small but very busy set of core contributors. > > It seems to me that it would be best if we could grow the set of people > who are regularly involved in Hackage administration to avoid this > happening in the future. However, this will require that people who > don't mind doing a bit of less-than-thrilling work (e.g. updating > hackage-server) pitch in. > > Cheers, > > - Ben > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity at googlemail.com Wed Oct 30 13:49:23 2019 From: icfp.publicity at googlemail.com (Sam Tobin-Hochstadt) Date: Wed, 30 Oct 2019 09:49:23 -0400 Subject: [Haskell-cafe] Call for Workshop Proposals: ICFP 2020 Message-ID: <5db994e312064_2a3d2af7799bc5bc366@homer.mail> CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS ICFP 2020 25th ACM SIGPLAN International Conference on Functional Programming August 23 - 28, 2020 Jersey City, NJ, US https://icfp19.sigplan.org/ The 25th ACM SIGPLAN International Conference on Functional Programming will be held in Jersey City, New Jersey on August 23-28, 2020. ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. Proposals are invited for workshops (and other co-located events, such as symposiums) to be affiliated with ICFP 2020 and sponsored by SIGPLAN. These events should be less formal and more focused than ICFP itself, include sessions that enable interaction among the attendees, and foster the exchange of new ideas. The preference is for one-day events, but other schedules can also be considered. The workshops are scheduled to occur on August 23rd (the day before ICFP) and 27-28th of August (the two days after ICFP). ---------------------------------------------------------------------- Submission details Deadline for submission: November 15, 2019 Notification of acceptance: December 13, 2019 Prospective organizers of workshops or other co-located events are invited to submit a completed workshop proposal form in plain text format to the ICFP 2020 workshop co-chairs (Jennifer Hackett and Leonidas Lampropoulos) via email to icfp-workshops-2020 at googlegroups.com by November 15, 2019. (For proposals of co-located events other than workshops, please fill in the workshop proposal form and just leave blank any sections that do not apply.) Please note that this is a firm deadline. Organizers will be notified if their event proposal is accepted by December 13, 2019, and if successful, depending on the event, they will be asked to produce a final report after the event has taken place that is suitable for publication in SIGPLAN Notices. The proposal form is available at: http://www.icfpconference.org/icfp2020-files/icfp20-workshops-form.txt Further information about SIGPLAN sponsorship is available at: http://www.sigplan.org/Resources/Proposals/Sponsored/ ---------------------------------------------------------------------- Selection committee The proposals will be evaluated by a committee comprising the following members of the ICFP 2020 organizing committee, together with the members of the SIGPLAN executive committee. Workshop Co-Chair: Jennifer Hackett (University of Nottingham) Workshop Co-Chair: Leonidas Lampropoulos (University of Maryland) General Chair: Stephanie Weirich (University of Pennsylvania) Program Chair: Adam Chlipala (MIT) ---------------------------------------------------------------------- Further information Any queries should be addressed to the workshop co-chairs (Jennifer Hackett and Leonidas Lampropoulos), via email to icfp-workshops-2020 at googlegroups.com. From tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk Wed Oct 30 14:29:51 2019 From: tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 30 Oct 2019 14:29:51 +0000 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: <87eeyvrkqk.fsf@smart-cactus.org> References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> <87eeyvrkqk.fsf@smart-cactus.org> Message-ID: <20191030142951.z7byvbomfeu3avtp@weber> On Tue, Oct 29, 2019 at 11:11:04PM -0400, Ben Gamari wrote: > * hackage-server needs to be updated to Cabal-3, tested, and the > deployment updated before the remaining boot packages can be uploaded > (admittedly I'm not familiar with the technical reasons for this > dependency, but this is what I have been told) Perhaps Herbert could pitch in with an explanation because I think a lot of people will be feeling quite puzzled at this point. From danburton.email at gmail.com Wed Oct 30 21:39:21 2019 From: danburton.email at gmail.com (Dan Burton) Date: Wed, 30 Oct 2019 14:39:21 -0700 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: <20191030142951.z7byvbomfeu3avtp@weber> References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> <87eeyvrkqk.fsf@smart-cactus.org> <20191030142951.z7byvbomfeu3avtp@weber> Message-ID: My questions at this point are: * What are the reasons that hackage-server must be upgraded to Cabal 3? * What are the reasons that make this upgrade difficult? * Can publishing to hackage be considered a proper part of the ghc release process in the future? On Wed, Oct 30, 2019, 07:30 Tom Ellis < tom-lists-haskell-cafe-2017 at jaguarpaw.co.uk> wrote: > On Tue, Oct 29, 2019 at 11:11:04PM -0400, Ben Gamari wrote: > > * hackage-server needs to be updated to Cabal-3, tested, and the > > deployment updated before the remaining boot packages can be uploaded > > (admittedly I'm not familiar with the technical reasons for this > > dependency, but this is what I have been told) > > Perhaps Herbert could pitch in with an explanation because I think a lot of > people will be feeling quite puzzled at this point. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at well-typed.com Wed Oct 30 23:00:47 2019 From: ben at well-typed.com (Ben Gamari) Date: Wed, 30 Oct 2019 19:00:47 -0400 Subject: [Haskell-cafe] [ANNOUNCE] GHC 8.8.1 is now available In-Reply-To: References: <87zhjwl1mx.fsf@smart-cactus.org> <87tv91gzk9.fsf@smart-cactus.org> <37C7FFFB-7EBE-4FAA-91AD-DFD570A8C296@well-typed.com> <87eeyvrkqk.fsf@smart-cactus.org> <20191030142951.z7byvbomfeu3avtp@weber> Message-ID: <87tv7prg86.fsf@smart-cactus.org> Dan Burton writes: > My questions at this point are: > > * What are the reasons that hackage-server must be upgraded to Cabal 3? I'll leave this to Herbert as I am also not clear on this point. None of the 8.8.1 boot packages should be relying on Cabal 3 syntax in their .cabal files so I'm not sure what specifically gives rise to this dependency. > * What are the reasons that make this upgrade difficult? Cabal 3 does change quite a bit. In response to the number of requests to get this un-stuck I put in some work [1] this week and last to start the upgrade. Indeed the process is non-trivial and requires touching a lot of code. Nearly all of this churn is due to the removal of the Text typeclass in favor of the Parsec and Pretty typeclasses. These changes are generally quite mechanical but do take time. > * Can publishing to hackage be considered a proper part of the ghc release > process in the future? > I am quite willing to handle the uploads as part of the release process if this is the direction we decide to take. Cheers, - Ben [1] https://github.com/bgamari/hackage-server/tree/cabal-3 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 487 bytes Desc: not available URL: From jho.xray at gmail.com Thu Oct 31 13:34:45 2019 From: jho.xray at gmail.com (J Ho) Date: Thu, 31 Oct 2019 14:34:45 +0100 Subject: [Haskell-cafe] How to build a horse with Haskell (comic extension) Message-ID: <581A8792-9A2A-469F-ABDF-3BAB64B5D3D1@gmail.com> There was this comics “how to build a horse” with different languages. I’ve always felt Haskell was missing. Found this on Quora - https://www.quora.com/How-do-you-build-a-horse-with-the-Haskell-programming-language/answer/Anton-Antich How to build a horse with Haskell. Building just a horse is boring, so you generalize it to a spherical horse in vacuum that can represent other animals sufficiently well. It takes 5 years, 43 research papers and only 3 people in the world can ride it (including SPJ). You build a horse. It’s fast, but lazy. You build a beautiful, friendly horse. You call it Monadic Quadro-pedo-functorial Transporter. People are afraid to touch it and it dies of loneliness. You build something that is Maybe a horse. All your horses come in boxes with bottom. You were a java programmer so you build a horse factory. It gives you Either a horse or a terrible runtime abomination. You build an existential horse. You can’t see or access its hoofs, tail, back, anything. It just sort of sits there and stares at you. You build an infinitely large horse. You can still ride it, because it’s lazy (it just sits there, just like the existential, and you crawl on its back slowly). You tease Java programmers who can’t possibly ride infinite horses. You build an even faster horse that is unboxed. You notice it is eager. You build a higher-kinded Horsificator. It turns anything else into horses. data Horsificator a = Horse a | Abomination You want to ride a rhino, but they normally would kill you. You build a horse typeclass. You make rhinos an instance of Horse. Polymorphic domestication! -------------- next part -------------- An HTML attachment was scrubbed... URL: