From corentin.dupont at gmail.com Wed Oct 1 08:55:28 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Wed, 1 Oct 2014 10:55:28 +0200 Subject: [Haskell-cafe] ANN: Nomyx 0.7 beta, the only game where you can change the rules Message-ID: Hi again, we started the game, please join, don't be shy :) Some interresting rules have already been proposed by players: - we now have a list of friends. - we have bank accounts in a currency called the "Bling". - we'll soon have planets, and maybe spaceships. A lot of things can happen now (what friends allow to do? How to win money? how to trade with planets? etc.). www.nomyx.net Cheers! C On Tue, Sep 30, 2014 at 12:31 PM, Corentin Dupont wrote: > > Hello everybody! > I released Nomyx V0.7, the only game where You can > change the rules! > Here is the website: www.nomyx.net > Here is a video introduction of the game: http://vimeo.com/58265498 > I created a tutorial to learn how to play: > http://www.corentindupont.info/blog/posts/2014-09-23-first-Nomyx-tutorial.html > > Let's start a new game! I propose to call it "The Space Merchants". Dear > rulers, this part of the Galaxy is yours... > Please login to the game here: www.nomyx.net:8000/Nomyx. > The corresponding forum thread is here: > http://www.nomyx.net/forum/viewtopic.php?f=4&t=1525&p=1739 > Please also register on the mailing list to follow the game: > nomyx-game at googlegroups.com > > Some background: this is an implementation of a Nomic [1] game in Haskell > (I believe the first complete implementation of a Nomic game on a > computer). In a Nomyx game you can change the rules of the game itself > while playing it. The players can submit new rules or modify existing ones, > thus completely changing the behaviour of the game through time. The rules > are managed and interpreted by the computer. They must be written in the > Nomyx language , which > is a subset of Haskell. > > At the beginning, the initial rules are describing: > - how to add new rules and change existing ones. For example a unanimity > vote is necessary to have a new rule accepted. > - how to win the game. For example you win the game if you have 5 rules > accepted. > But of course even that can be changed! > > New in this beta release: > - the Nomyx language is now based on functional reactive programming > - the language also embeds a mechanism to separate effectful instructions > from effectless ones > - ability to fork an existing game into a new one > - ability to type-check rules before submitting them > - ability to create new games > > If you wanna help developing Nomyx, join us on the dev mailing-list: > dev-game at googlegroups.com > > > Cheers, > Corentin > > [1] www.nomic.net > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gesh at gesh.uni.cx Wed Oct 1 13:14:49 2014 From: gesh at gesh.uni.cx (Gesh) Date: Wed, 01 Oct 2014 16:14:49 +0300 Subject: [Haskell-cafe] Increasing Haskell modularity Message-ID: <542BFE49.6020306@gesh.uni.cx> Dear Caf?, Edward Yang recently wrote about the non-modularity of the current semantics for typeclasses[0] and open type families[1]. Given these problems, we can either try to work around the problem, or decide whether these features are worth the problems. The specific pair of proposals I am making are the following: * Give up on global uniqueness of typeclass instances. Oleg discusses adding local typclass instances without losing coherence in his reflection paper[2]. If we adopt his proposal, and weaken global uniqueness of instances to local uniqueness, we can then say that typeclass instances in a module are considered more local than imported instances, and therefore override them. Since instances will be locally unique, we don't have to pass around dictionaries. Data types that expect globally unique instances, such as Set, will have to store dictionaries, however. * Give up on non-associated open type families. This I have researched less well, but it seems to me that these have no use case. Since one can make whatever instances one wishes for these type families, one can't do anything useful with values of their instances. In other words, values of type F a are morally of type (forall a. a). Thus, the only way I can see these being useful is if anyone creating an instance of the family must also provide functions that can work with these instances, which brings us back to the case of associated types. As far as I can see, these two features are useless and impeding the drive to make Haskell more modular. Therefore, my questions for you are twofold: * Is there a reason to keep these features? * If not, why don't we drop them? Awaiting your criticism and ire, Gesh [0] - http://blog.ezyang.com/2014/07/type-classes-confluence-coherence-global-uniqueness/ [1] - http://blog.ezyang.com/2014/09/open-type-families-are-not-modular/ [2] - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.112.7819 From eir at cis.upenn.edu Wed Oct 1 14:01:19 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Wed, 1 Oct 2014 10:01:19 -0400 Subject: [Haskell-cafe] Increasing Haskell modularity In-Reply-To: <542BFE49.6020306@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> Message-ID: <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> I'm against this proposal. * I'm not sure exactly what you mean by "adopt [Oleg's] proposal". What's the proposal? I'm familiar with the reify/reflect trick (see http://hackage.haskell.org/package/reflection) but don't see how that exactly relates to the issue at hand. It seems the first part of your proposal just says "Haskellers can no longer expect class instance coherence." As such, this is a drastic change that would require all Haskell programs to be inspected to see if they crucially rely on coherence. * As for associated vs. non-associated type families: There is essentially no difference between associated and non-associated type families, save concrete syntax. If the Haskell house were on fire and we needed to eliminate one of these forms, I would agree to it without much trouble, because the two forms are equally expressive. But, eliminating non-associated type families wouldn't solve your problem at all: while class instance incoherence causes wonky runtime behavior, associated type instance incoherence breaks the type system. If I understand your proposal correctly, users could implement unsafeCoerce through clever hackery around associated type instance incoherence. This seems to be against the Haskell tradition of strong typing. I agree that the non-modular state we're in is regrettable. There may be a way out of the hole, but I don't think this proposal is it. Richard On Oct 1, 2014, at 9:14 AM, Gesh wrote: > Dear Caf?, > Edward Yang recently wrote about the non-modularity of the current semantics > for typeclasses[0] and open type families[1]. > Given these problems, we can either try to work around the problem, or decide > whether these features are worth the problems. > The specific pair of proposals I am making are the following: > * Give up on global uniqueness of typeclass instances. > Oleg discusses adding local typclass instances without losing coherence in his > reflection paper[2]. If we adopt his proposal, and weaken global uniqueness of > instances to local uniqueness, we can then say that typeclass instances in a > module are considered more local than imported instances, and therefore > override them. > Since instances will be locally unique, we don't have to pass around > dictionaries. Data types that expect globally unique instances, such as Set, > will have to store dictionaries, however. > * Give up on non-associated open type families. > This I have researched less well, but it seems to me that these have no use > case. Since one can make whatever instances one wishes for these type > families, one can't do anything useful with values of their instances. > In other words, values of type F a are morally of type (forall a. a). > Thus, the only way I can see these being useful is if anyone creating an > instance of the family must also provide functions that can work with these > instances, which brings us back to the case of associated types. > > As far as I can see, these two features are useless and impeding the drive to > make Haskell more modular. Therefore, my questions for you are twofold: > * Is there a reason to keep these features? > * If not, why don't we drop them? > > Awaiting your criticism and ire, > Gesh > > [0] - http://blog.ezyang.com/2014/07/type-classes-confluence-coherence-global-uniqueness/ > [1] - http://blog.ezyang.com/2014/09/open-type-families-are-not-modular/ > [2] - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.112.7819 > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From gesh at gesh.uni.cx Wed Oct 1 14:36:49 2014 From: gesh at gesh.uni.cx (Gesh hseG) Date: Wed, 1 Oct 2014 17:36:49 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <542C0FFD.6070303@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> Message-ID: Sorry, should have used reply-list. To clarify, under the proposal, the associated family instances would also be locally unique, with local instances overriding global instances. Gesh ---------- Forwarded message ---------- From: Gesh Date: Wed, Oct 1, 2014 at 5:30 PM Subject: Re: [Haskell-cafe] Increasing Haskell modularity To: Richard Eisenberg On 10/1/2014 5:01 PM, Richard Eisenberg wrote: > > * I'm not sure exactly what you mean by "adopt [Oleg's] proposal". In Section 6.1, Oleg discusses how to keep principal typing while allowing local instances. He then suggests making this part of the semantics of local instances. > It seems the first part of your proposal just says > "Haskellers can no longer expect class instance coherence." > As such, this is a drastic change that would require all Haskell > programs to be inspected to see if they crucially rely on coherence No. Coherence is preserved, since you always use the unique in-scope dictionary. What *is* lost, however, is global uniqueness, which means that code that assumes that the same dictionary is used for the same type across calls to functions must be modified. Arguably, that code is semantically incorrect to begin with, but that's neither here nor there. > * As for associated vs. non-associated type families: > There is essentially no difference between associated > and non-associated type families, save concrete syntax. > If the Haskell house were on fire and we needed to eliminate > one of these forms, I would agree to it without much trouble, > because the two forms are equally expressive. > > > But, eliminating non-associated type families wouldn't solve > your problem at all: while class instance incoherence causes > wonky runtime behavior, associated type instance incoherence > breaks the type system. If I understand your proposal correctly, > users could implement unsafeCoerce through clever hackery around > associated type instance incoherence. This seems to be against > the Haskell tradition of strong typing. To clarify my proposal: Associated type families have the added guarantee over non-associated families that functions will be defined that allow one to work with them. As mentioned above, typeclass coherence is preserved under the proposal, so I see no danger of family incoherence. However, I'm inexperienced with these kinds of proposals, and the concern that unsafeCoerce will be possible with this proposal is worrying. Could you please construct a case implementing unsafeCoerce? Thanks, Gesh From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Oct 1 14:45:55 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 1 Oct 2014 15:45:55 +0100 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> Message-ID: <20141001144555.GO28239@weber> On Wed, Oct 01, 2014 at 05:36:49PM +0300, Gesh hseG wrote: > > It seems the first part of your proposal just says > > "Haskellers can no longer expect class instance coherence." > > As such, this is a drastic change that would require all Haskell > > programs to be inspected to see if they crucially rely on coherence > No. Coherence is preserved, since you always use the unique in-scope > dictionary. What *is* lost, however, is global uniqueness, which means > that code that assumes that the same dictionary is used for the same > type across calls to functions must be modified. Arguably, that code > is semantically incorrect to begin with, but that's neither here nor > there. What sort of code is that exactly? I'm aware there are things like `Data.Set` which crucially rely on global uniquess of instances to maintain invariants. Are there any other sorts of functionality where this is needed? Tom From carter.schonwald at gmail.com Wed Oct 1 15:02:39 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 1 Oct 2014 11:02:39 -0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <20141001144555.GO28239@weber> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <20141001144555.GO28239@weber> Message-ID: This proposal is missing a key ingredient, how to resolve import of two conflicting instances. And I can't imagine any good selection strategy under this scoping scheme. Additionally, how this would work in the case of fancier programs that use fundeps and multiparam type classes to construct type level programs is a bit confusing. Would this entail that those programs would have hot swappable parts? What does that mean? One hackage package that would suffer terribly would be the HList one I think. Also I'm not sure what implications this would have for how type inference would work. Having global uniqueness is a wonderful assumption to have, and losing it might result in losing huge swaths of type inference, because suddenly we have 'pick the instance in the nearest scope'.. So how would this notion interact with the instance resolution that happens for overlapping instances? On Oct 1, 2014 10:46 AM, "Tom Ellis" < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > On Wed, Oct 01, 2014 at 05:36:49PM +0300, Gesh hseG wrote: > > > It seems the first part of your proposal just says > > > "Haskellers can no longer expect class instance coherence." > > > As such, this is a drastic change that would require all Haskell > > > programs to be inspected to see if they crucially rely on coherence > > No. Coherence is preserved, since you always use the unique in-scope > > dictionary. What *is* lost, however, is global uniqueness, which means > > that code that assumes that the same dictionary is used for the same > > type across calls to functions must be modified. Arguably, that code > > is semantically incorrect to begin with, but that's neither here nor > > there. > > What sort of code is that exactly? I'm aware there are things like > `Data.Set` which crucially rely on global uniquess of instances to maintain > invariants. Are there any other sorts of functionality where this is > needed? > > Tom > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gershomb at gmail.com Wed Oct 1 15:25:48 2014 From: gershomb at gmail.com (Gershom B) Date: Wed, 1 Oct 2014 11:25:48 -0400 Subject: [Haskell-cafe] Increasing Haskell modularity Message-ID: It seems to me the far easier choice, in ditching the feature ?not worth the problem? is simply to eliminate orphan instances as in ?Extension 1? described in Edward Yang?s blog post (http://blog.ezyang.com/2014/09/open-type-families-are-not-modular/). I?d like to open up a further discussion on this at some future point, as I?m convinced that there is no ?legitimate? use of orphans in the Haskell ecosystem that cannot be substituted for with other safer and more straightforward techniques. -g On October 1, 2014 at 9:26:45 AM, Gesh (gesh at gesh.uni.cx) wrote: > Dear Caf?, > Edward Yang recently wrote about the non-modularity of the current semantics > for typeclasses[0] and open type families[1]. > Given these problems, we can either try to work around the problem, or > decide > whether these features are worth the problems. > The specific pair of proposals I am making are the following: > * Give up on global uniqueness of typeclass instances. > Oleg discusses adding local typclass instances without losing > coherence in his > reflection paper[2]. If we adopt his proposal, and weaken global > uniqueness of > instances to local uniqueness, we can then say that typeclass > instances in a > module are considered more local than imported instances, and therefore > override them. > Since instances will be locally unique, we don't have to pass around > dictionaries. Data types that expect globally unique instances, such > as Set, > will have to store dictionaries, however. > * Give up on non-associated open type families. > This I have researched less well, but it seems to me that these have > no use > case. Since one can make whatever instances one wishes for these type > families, one can't do anything useful with values of their instances. > In other words, values of type F a are morally of type (forall a. a). > Thus, the only way I can see these being useful is if anyone creating an > instance of the family must also provide functions that can work with > these > instances, which brings us back to the case of associated types. > > As far as I can see, these two features are useless and impeding the > drive to > make Haskell more modular. Therefore, my questions for you are twofold: > * Is there a reason to keep these features? > * If not, why don't we drop them? > > Awaiting your criticism and ire, > Gesh > > [0] - > http://blog.ezyang.com/2014/07/type-classes-confluence-coherence-global-uniqueness/ > [1] - http://blog.ezyang.com/2014/09/open-type-families-are-not-modular/ > [2] - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.112.7819 > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From jon at jonmsterling.com Wed Oct 1 15:55:12 2014 From: jon at jonmsterling.com (Jon Sterling) Date: Wed, 01 Oct 2014 08:55:12 -0700 Subject: [Haskell-cafe] Increasing Haskell modularity In-Reply-To: References: Message-ID: <1412178912.1372699.173964509.319E1986@webmail.messagingengine.com> Gershom, As far as Haskell is concerned, yes, I think orphan instances should go. However, they are very useful! It is our aversion to using them which prevents us from splitting things into separate, modular libraries: for instance, library A provides type classes, library B provides unrelated types, library C provides A instances for B types. When people use the word "modularity", it is assumed that this is one of the things it can do, so it's kind of funny to hear the word used in a sense which rules out this case. But as you and Ed have argued in the past, orphan instances in Haskell actually cause a fair amount of problems, which I consider to be a *ringing* indictment of type classes as the only means of modular abstraction. If we outlaw the orphans, we'll rule out some bad cases, and at the very least make crystal clear the actual problem of modularity such that people will not easily confuse Haskell type classes with a solution to it, as some do now. So I'm in favor. Kind regards, Jon On Wed, Oct 1, 2014, at 08:25 AM, Gershom B wrote: > It seems to me the far easier choice, in ditching the feature ?not > worth the problem? is simply to eliminate orphan instances as in > ?Extension 1? described in Edward Yang?s blog post > (http://blog.ezyang.com/2014/09/open-type-families-are-not-modular/). > > I?d like to open up a further discussion on this at some future point, > as I?m convinced that there is no ?legitimate? use of orphans in the > Haskell ecosystem that cannot be substituted for with other safer and > more straightforward techniques. > > -g > > > On October 1, 2014 at 9:26:45 AM, Gesh (gesh at gesh.uni.cx) wrote: > > Dear Caf?, > > Edward Yang recently wrote about the non-modularity of the current semantics > > for typeclasses[0] and open type families[1]. > > Given these problems, we can either try to work around the problem, or > > decide > > whether these features are worth the problems. > > The specific pair of proposals I am making are the following: > > * Give up on global uniqueness of typeclass instances. > > Oleg discusses adding local typclass instances without losing > > coherence in his > > reflection paper[2]. If we adopt his proposal, and weaken global > > uniqueness of > > instances to local uniqueness, we can then say that typeclass > > instances in a > > module are considered more local than imported instances, and therefore > > override them. > > Since instances will be locally unique, we don't have to pass around > > dictionaries. Data types that expect globally unique instances, such > > as Set, > > will have to store dictionaries, however. > > * Give up on non-associated open type families. > > This I have researched less well, but it seems to me that these have > > no use > > case. Since one can make whatever instances one wishes for these type > > families, one can't do anything useful with values of their instances. > > In other words, values of type F a are morally of type (forall a. a). > > Thus, the only way I can see these being useful is if anyone creating an > > instance of the family must also provide functions that can work with > > these > > instances, which brings us back to the case of associated types. > > > > As far as I can see, these two features are useless and impeding the > > drive to > > make Haskell more modular. Therefore, my questions for you are twofold: > > * Is there a reason to keep these features? > > * If not, why don't we drop them? > > > > Awaiting your criticism and ire, > > Gesh > > > > [0] - > > http://blog.ezyang.com/2014/07/type-classes-confluence-coherence-global-uniqueness/ > > [1] - http://blog.ezyang.com/2014/09/open-type-families-are-not-modular/ > > [2] - http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.112.7819 > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From gesh at gesh.uni.cx Wed Oct 1 16:33:55 2014 From: gesh at gesh.uni.cx (Gesh) Date: Wed, 01 Oct 2014 19:33:55 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <20141001144555.GO28239@weber> Message-ID: <542C2CF3.2020207@gesh.uni.cx> On 10/1/2014 6:02 PM, Carter Schonwald wrote: > This proposal is missing a key ingredient, how to resolve import of two > conflicting instances. And I can't imagine any good selection strategy > under this scoping scheme. Why should two conflicting in-scope instances be a valid situation? All I'm doing is making instance resolution more similar to other name resolution. Creating a new instance in a scope shadows the instance outside the scope, but multiple instances in the same scope aren't allowed. > Additionally, how this would work in the case of fancier programs that > use fundeps and multiparam type classes to construct type level programs > is a bit confusing. Would this entail that those programs would have hot > swappable parts? What does that mean? You're right, I didn't pay much attention to the fancier stuff we can do. I don't think this will cause trouble, but I'm not qualified to say that with certainty. > One hackage package that would suffer terribly would be the HList one I > think. A cursory glance at HList reveals several open type families. I *think* that they can be rewritten to be closed families. > Also I'm not sure what implications this would have for how type > inference would work. Having global uniqueness is a wonderful > assumption to have, and losing it might result in losing huge swaths of > type inference, because suddenly we have 'pick the instance in the > nearest scope'.. So how would this notion interact with the instance > resolution that happens for overlapping instances? If there's an exact instance that matches the local instance, the local instance shadows it, and overlapping instance inference proceeds as usual. Some examples: > module Foo where > import Bar (Baz) -- With an instance Show (Baz a) > instance Show (Baz a) where -- shadows the instance from Bar > foo = let instance Show (Baz a) where -- shadows the module instance > instance Show (Baz Quz) where > -- Does not shadow any instance, OverlappingInstances > -- resolution proceeds with the two instances defined in > -- the let block Hope this clarifies things, Gesh From gesh at gesh.uni.cx Wed Oct 1 16:36:13 2014 From: gesh at gesh.uni.cx (Gesh) Date: Wed, 01 Oct 2014 19:36:13 +0300 Subject: [Haskell-cafe] Increasing Haskell modularity In-Reply-To: References: Message-ID: <542C2D7D.5060306@gesh.uni.cx> On 10/1/2014 6:25 PM, Gershom B wrote: > It seems to me the far easier choice, in ditching the feature ?not > worth the problem? is simply to eliminate orphan instances as in > ?Extension 1? described in Edward Yang?s blog post > (http://blog.ezyang.com/2014/09/open-type-families-are-not-modular/). While I definitely agree with you that orphan instances should go, or at least have some resolution mechanism, I'm proposing local instances on their own merits. Gesh From Graham.Hutton at nottingham.ac.uk Wed Oct 1 17:04:10 2014 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Wed, 1 Oct 2014 18:04:10 +0100 Subject: [Haskell-cafe] Journal of Functional Programming - Call for PhD Abstracts Message-ID: ============================================================ CALL FOR PHD ABSTRACTS Journal of Functional Programming Deadline: 31st October 2014 http://tinyurl.com/jfp-phd-abstracts ============================================================ PREAMBLE: Many students complete PhDs in functional programming each year, but there is currently no common location in which to promote and advertise the resulting work. The Journal of Functional Programming would like to change that! As a service to the community, JFP recently launched a new feature, in the form of a regular publication of abstracts from PhD dissertations that were completed during the previous year. The abstracts are made freely available on the JFP website, i.e. not behind any paywall, and do not require any transfer for copyright, merely a license from the author. The first round of published abstracts can be downloaded from http://journals.cambridge.org/jfp/phd_abstracts. Please submit dissertation abstracts according to the instructions below. A dissertation is eligible if parts of it have or could have appeared in JFP, that is, if it is in the general area of functional programming. JFP will not have these abstracts reviewed. We welcome submissions from both the PhD student and PhD advisor/ supervisor although we encourage them to coordinate. ============================================================ SUBMISSION: Please submit the following information to Graham Hutton by 31st October 2014. o Dissertation title: (including any subtitle) o Student: (full name) o Awarding institution: (full name and country) o Date of PhD award: (month and year; depending on the institution, this may be the date of the viva, corrections being approved, graduation ceremony, or otherwise) o Advisor/supervisor: (full names) o Dissertation URL: (please provide a permanently accessible link to the dissertation if you have one, such as to an institutional repository or other public archive; links to personal web pages should be considered a last resort) o Dissertation abstract: (plain text, maximum 1000 words; you may use \emph{...} for emphasis, but we prefer no other markup or formatting in the abstract, but do get in touch if this causes significant problems) Please do not submit a copy of the dissertation itself, as this is not required. JFP reserves the right to decline to publish abstracts that are not deemed appropriate. ============================================================ PHD ABSTRACT EDITOR: Graham Hutton School of Computer Science University of Nottingham Nottingham NG8 1BB United Kingdom ============================================================ This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From alan.zimm at gmail.com Wed Oct 1 18:34:18 2014 From: alan.zimm at gmail.com (Alan & Kim Zimmerman) Date: Wed, 1 Oct 2014 20:34:18 +0200 Subject: [Haskell-cafe] GHC 7.10 GHC-API Changes and proposed changes. Message-ID: There are a number of changes in GHC 7.10 that will make it easier for tool writers to use the GHC API. These include 1. More parser entrypoints, to explicitly parse fragments [Andrew Gibiansky] The following parsers are now provided parseModule, parseImport, parseStatement, ? parseDeclaration, parseExpression, parseTypeSignature, ? parseFullStmt, parseStmt, parseIdentifier, ? parseType, parseHeader 2. No more landmines in the AST [Alan Zimmerman] In the past it was difficult to work with the GHC AST as any generic traversals had to carefully tiptoe around an assortment of panic and undefined expressions. These have now been removed, allowing standard traversal libraries to be used. There is a third change currently being discussed, and I would like feedback on it's desirability. 3. Introduce an annotation structure to the ParsedSource to record the location of uncaptured keywords. At the moment the location of let / in / if / then / else / do etc is not captured in the AST. This makes it difficult to parse some source, transform the AST, and then output it again preserving the original layout. The current proposal, which can be seen at [1] and a proof of concept implementation at [2] returns a structure keyed to each AST element containing simply the specific SrcSpan's not already captured in the AST. This is the analogue of the Language.Haskell.Exts.Annotated.Syntax from haskell-src-exts, except a custom SrcSpanInfo structure is provided for each AST element constructor, and it is not embedded within the AST. [1] https://ghc.haskell.org/trac/ghc/wiki/GhcAstAnnotations [2] https://phabricator.haskell.org/D297 So, apart from HaRe, are there any other users who would be interested in using this? Regards Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave at zednenem.com Wed Oct 1 19:49:05 2014 From: dave at zednenem.com (David Menendez) Date: Wed, 1 Oct 2014 15:49:05 -0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> Message-ID: On Wed, Oct 1, 2014 at 10:36 AM, Gesh hseG wrote: > > It seems the first part of your proposal just says > > "Haskellers can no longer expect class instance coherence." > > As such, this is a drastic change that would require all Haskell > > programs to be inspected to see if they crucially rely on coherence > No. Coherence is preserved, since you always use the unique in-scope > dictionary. What *is* lost, however, is global uniqueness, which means > that code that assumes that the same dictionary is used for the same > type across calls to functions must be modified. Arguably, that code > is semantically incorrect to begin with, but that's neither here nor > there. > How is that neither here nor there? Haskell says that types belong to classes, and each (type) instance of a class has a specific implementation. The fact that GHC implements this using dictionaries is irrelevant. It?s perfectly valid to implement type classes with partial evaluation, or matching on type parameters, or even C++-style templates. In other words: no, coherency is not preserved. You can?t change the semantics of classes and then say that programs built around the old semantics were wrong all along. -- Dave Menendez -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.gibiansky at gmail.com Wed Oct 1 20:28:58 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Wed, 1 Oct 2014 13:28:58 -0700 Subject: [Haskell-cafe] GHC 7.10 GHC-API Changes and proposed changes. In-Reply-To: References: Message-ID: I am very much in favor of this. IHaskell does not need this (...yet?), but I have played around with writing other source-transforming tools, and having to rely on HSE for parsing and reformatting and relying on GHC API for interpreting and typechecking is a little bit of a pain. Besides HaRe, I'd love a tool equivalent to `go fmt` which normalized stuff like indentation, alignment, and usage of `where` vs `let`, and automatically applied various changes (of course details are complicated); that sort of thing requires good support for the sort of work you're doing in HaRe. Also, I *very strongly* support any work that goes into improving the GHC API. Working with it was a nightmare at the beginning due to lack of documentation, lack of exposed symbols, and other issues. (That said, I'm also fine with using the dynamic typing approach that was mentioned elsewhere to avoid an extra type parameter. Have the annotation be a Dynamic or something. The motivation for this would be to make the change less intrusive.) -- Andrew On Wed, Oct 1, 2014 at 11:34 AM, Alan & Kim Zimmerman wrote: > There are a number of changes in GHC 7.10 that will make it easier for > tool writers to use the GHC API. > > These include > > 1. More parser entrypoints, to explicitly parse fragments [Andrew > Gibiansky] > > The following parsers are now provided > > parseModule, parseImport, parseStatement, ? parseDeclaration, > parseExpression, parseTypeSignature, ? parseFullStmt, parseStmt, > parseIdentifier, ? parseType, parseHeader > > 2. No more landmines in the AST [Alan Zimmerman] > > In the past it was difficult to work with the GHC AST as any generic > traversals had to carefully tiptoe around an assortment of panic and > undefined expressions. These have now been removed, allowing > standard traversal libraries to be used. > > There is a third change currently being discussed, and I would like > feedback on it's desirability. > > 3. Introduce an annotation structure to the ParsedSource to record the > location of uncaptured keywords. > > At the moment the location of let / in / if / then / else / do > etc is not captured in the AST. This makes it difficult to > parse some source, transform the AST, and then output it again > preserving the original layout. > > The current proposal, which can be seen at [1] and a proof of > concept implementation at [2] returns a structure keyed to each AST > element containing simply the specific SrcSpan's not already > captured in the AST. > > This is the analogue of the Language.Haskell.Exts.Annotated.Syntax > from haskell-src-exts, except a custom SrcSpanInfo structure is > provided for each AST element constructor, and it is not embedded > within the AST. > > [1] https://ghc.haskell.org/trac/ghc/wiki/GhcAstAnnotations > [2] https://phabricator.haskell.org/D297 > > So, apart from HaRe, are there any other users who would be interested > in using this? > > Regards > Alan > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spam at scientician.net Wed Oct 1 20:42:29 2014 From: spam at scientician.net (Bardur Arantsson) Date: Wed, 01 Oct 2014 22:42:29 +0200 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> Message-ID: On 2014-10-01 21:49, David Menendez wrote: > On Wed, Oct 1, 2014 at 10:36 AM, Gesh hseG wrote: > >>> It seems the first part of your proposal just says >>> "Haskellers can no longer expect class instance coherence." >>> As such, this is a drastic change that would require all Haskell >>> programs to be inspected to see if they crucially rely on coherence >> No. Coherence is preserved, since you always use the unique in-scope >> dictionary. What *is* lost, however, is global uniqueness, which means >> that code that assumes that the same dictionary is used for the same >> type across calls to functions must be modified. Arguably, that code >> is semantically incorrect to begin with, but that's neither here nor >> there. >> > > How is that neither here nor there? Haskell says that types belong to > classes, and each (type) instance of a class has a specific implementation. > The fact that GHC implements this using dictionaries is irrelevant. It?s > perfectly valid to implement type classes with partial evaluation, or > matching on type parameters, or even C++-style templates. > > In other words: no, coherency is not preserved. You can?t change the > semantics of classes and then say that programs built around the old > semantics were wrong all along. > +1 to this post. -1 to the proposal. (I say "proposal"... this needs some serious fleshing out and a semi-formal specification for instance resolution rules &c before it becomes a proposal. Just "Look at Oleg's paper" is not good enough.) Regards, From rowley.evan at gmail.com Wed Oct 1 21:01:07 2014 From: rowley.evan at gmail.com (Evan Rowley) Date: Wed, 1 Oct 2014 17:01:07 -0400 Subject: [Haskell-cafe] Broken linkr in wiki for Ivo Message-ID: The theorem provers page has a link for Ivor at the bottom: http://www.haskell.org/haskellwiki/Libraries_and_tools/Theorem_provers This current link is dead: http://www.dcs.st-and.ac.uk/~eb/ivor.php This new link works: http://eb.host.cs.st-andrews.ac.uk/ivor.php -- -- - EJR -------------- next part -------------- An HTML attachment was scrubbed... URL: From gesh at gesh.uni.cx Wed Oct 1 21:44:25 2014 From: gesh at gesh.uni.cx (Gesh) Date: Thu, 02 Oct 2014 00:44:25 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> Message-ID: <542C75B9.2010303@gesh.uni.cx> On 10/1/2014 10:49 PM, David Menendez wrote: > How is that neither here nor there? Haskell says that types belong to > classes, and each (type) instance of a class has a specific > implementation. The fact that GHC implements this using dictionaries is > irrelevant. It?s perfectly valid to implement type classes with partial > evaluation, or matching on type parameters, or even C++-style templates. How is this point relevant? As far as I understand typeclasses enjoy three properties: confluence, coherence and global uniqueness. These are defined as follows: * Confluence: Constraint-solving always terminates with the same sets of constraints on terms. * Coherence: The same instance is always chosen for terms. * Global uniqueness: For any type and typeclass, there exists at most one instance of the typeclass for the type. What I suggested was to weaken global uniqueness to local uniqueness, defined as: * Local uniqueness: For any type and typeclass, in any scope there exists at most one instance of the typeclass for the type. And a scope is a set of parallel bindings, introduced by a module declaration, let expression or where clause. Since this only affects global uniqueness, I fail to see how concerns about coherence being lost are relevant. > In other words: no, coherency is not preserved. You can?t change the > semantics of classes and then say that programs built around the old > semantics were wrong all along. Correct, although that's not what I said. I just said that a case could be made for saying the design of programs around global uniqueness was poorly thought out. I admit that these changes will require people to redesign such programs. I'm not convinced this is a bad thing. I am sorry for not being clearer to begin with. Gesh From chrisdone at gmail.com Wed Oct 1 22:01:40 2014 From: chrisdone at gmail.com (Christopher Done) Date: Thu, 2 Oct 2014 00:01:40 +0200 Subject: [Haskell-cafe] A prototype concept for teaching type-class polymorphic functions Message-ID: Hey there, For those teaching Haskell and making teaching tools, you might be interested in this mode of presentation of a function: http://chrisdone.com/fmap It's a little slow because the implementation is naive (it abuses my tryhaskell.org server), however the concept is: see what fmap really does by showing what you get when applying it to a variety of different types, including ?strange? ones like Const and the function type. A given function has visually evident ways of applying to different data structures. The value changes and so does the type. Challenge: take this ball and run with it to illustrate return and >>= for a number of monads. Maybe, [], LogicT, Either, etc. Given that I've been using Haskell for 6 years and haven't yet written a monad tutorial, I don't want to break that clean sheet now. If that's too hard, there're plenty of simpler classes to experiment with. Some types require special handling to display in an intuitive way, like the ((->) r) example. But ignoring that, if you were sufficiently shrewd, you could automatically generate such an interactive page by taking a given typeclass, asking GHCi or the GHC API for all known instances of that type, which are Showable (or somehow representable) and then enumerating them in this kind of display. Others have suggested a "before and after" side-by-side look. So that's an option to consider. Technically you can get before/after with ?id? (a lesson in itself, the identity law!), but a two-column layout is an option. Ciao! From gesh at gesh.uni.cx Wed Oct 1 22:05:35 2014 From: gesh at gesh.uni.cx (Gesh) Date: Thu, 02 Oct 2014 01:05:35 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> Message-ID: <542C7AAF.2010501@gesh.uni.cx> On 10/1/2014 11:42 PM, Bardur Arantsson wrote: > (I say "proposal"... this needs some serious fleshing out and a > semi-formal specification for instance resolution rules &c before it > becomes a proposal. Just "Look at Oleg's paper" is not good enough.) I see I came off unclearly. Please allow me to remedy that. My reference to Oleg's paper was badly framed. What I meant to say was more along the following lines: Oleg discussed adding local typeclass instances in his reflection paper. For some reason, his proposal wasn't taken. (Does anyone know why?) I'd like to suggest something along similar lines: Allow instances in let-expressions and where-clauses. These instances shadow other instances with the same parameter list. Similarly, instances defined in modules shadow imported instances. Thus, in the following program: > module Foo where > import Bar (Baz) -- Where Bar defines instance Show (Baz a) > instance Show (Baz a) where -- shadows the imported instance > foo = let instance Show (Baz a) where -- shadows the instance defined > in ... -- in where below, just like other bindings > where instance Show (Baz a) -- shadows the module-global instance > instance Show (Baz Quz) -- only allowed with > -- OverlappingInstances, isn't shadowed by any of the other > -- instances in this example. In this example, the instances for Baz have the following scopes: * From Bar: Nowhere, as it is immediately shadowed. * From Foo: Within all top-level declarations besides foo, as foo's where clause shadows it. * From the where clause: Within the where clause. The instance for Baz Quz is also visible within the let expression, as it is not shadowed by it. * From the let expression: Within the let expression. Basically all I'm doing is applying regular name resolution semantics to instances with the same parameter lists. I hope this helps clarify things. If not, please tell me what needs to be done to fully clarify this. Gesh From brandon_m_moore at yahoo.com Wed Oct 1 22:14:31 2014 From: brandon_m_moore at yahoo.com (Brandon Moore) Date: Wed, 1 Oct 2014 22:14:31 +0000 (UTC) Subject: [Haskell-cafe] Reflection functional dependency as an associated type? Message-ID: <1761275958.4908.1412201671327.JavaMail.yahoo@jws10065.mail.ne1.yahoo.com> I was trying to make a bridge like this class MonadStateTF m where?? type StateOf m :: *instance (MonadState s m) => MonadStateTF m where? type StateOF m = s to allow writing constraints on state monads without a dangling type parameter type NumMonad m = (MonadStateTF m, Num (StateOf m)) Unfortunately, the declaration type StateOF m = s complains that "s" isn't mentioned on the left hand side rather than somehow making use of the fundep. Brandon -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjgtuyl at chello.nl Wed Oct 1 22:35:14 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Thu, 02 Oct 2014 00:35:14 +0200 Subject: [Haskell-cafe] Broken linkr in wiki for Ivo In-Reply-To: References: Message-ID: On Wed, 01 Oct 2014 23:01:07 +0200, Evan Rowley wrote: > The theorem provers page has a link for Ivor at the bottom: > http://www.haskell.org/haskellwiki/Libraries_and_tools/Theorem_provers > > This current link is dead: http://www.dcs.st-and.ac.uk/~eb/ivor.php > > This new link works: http://eb.host.cs.st-andrews.ac.uk/ivor.php I've updated the page. If you request a user id[0] for HaskellWiki, you can make changes like this yourself, with about the same amount of work as writing an email. Regards, Henk-Jan van Tuyl [0] http://www.haskell.org/haskellwiki/index.php?title=Special:UserLogin -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- From ok at cs.otago.ac.nz Wed Oct 1 23:14:08 2014 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Thu, 2 Oct 2014 12:14:08 +1300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <542C7AAF.2010501@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> Message-ID: <53C16FB6-B2D8-494B-98E8-962B1A56A70B@cs.otago.ac.nz> Please consider the needs of Haskell *readers* as well as Haskell *writers*, even bears of very little brain like me. This sounds to me like a proposal to make writing (some) programs easier but reading them much harder. From eir at cis.upenn.edu Wed Oct 1 23:50:32 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Wed, 1 Oct 2014 19:50:32 -0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <542C7AAF.2010501@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> Message-ID: <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> Thanks, Gesh, for the email below and the previous one, spelling out the distinction between coherence and global uniqueness. I had been conflating coherence and global uniqueness (as it seems others have been), and drawing this out is helpful. Though I can't yet say I'm in support, exactly, I'm less vehemently against this idea than I was this morning. In particular, I actually really like the idea of local class instances, which have occurred to me before but which I've never considered seriously. Unfortunately, this all breaks apart horribly when thinking about type instances. Global uniqueness, not just coherence, is needed for type instances: > type family F a b > type instance F a b = b > > oops :: F a b -> b > oops = id > > unsafeCoerce :: a -> b > unsafeCoerce = let type instance F a b = a in > oops The problem is that a type instance introduces a type equality. Haskell is capable of passing type equality evidence around, so equalities can escape their scope, if the programmer wants to do so. Thus, there can never be a situation where some type (in this case `F a b`) is equal to one thing in one context and an incompatible thing in a different context, anywhere in the same program. I've written my example above with non-associated types, but the same thing can be written with associated types (and more syntactic overhead). I can't currently imagine a type-safe system that did not require global uniqueness for type instances. For what it's worth, I think I can agree that types like `Set` should carry around the relevant `Ord` dictionary. Global uniqueness of class instances is already threatened by all manner of extensions; we've just been much more careful about global uniqueness of type instances. Richard On Oct 1, 2014, at 6:05 PM, Gesh wrote: > On 10/1/2014 11:42 PM, Bardur Arantsson wrote: >> (I say "proposal"... this needs some serious fleshing out and a >> semi-formal specification for instance resolution rules &c before it >> becomes a proposal. Just "Look at Oleg's paper" is not good enough.) > I see I came off unclearly. Please allow me to remedy that. > > My reference to Oleg's paper was badly framed. What I meant to say was > more along the following lines: > Oleg discussed adding local typeclass instances in his reflection paper. > For some reason, his proposal wasn't taken. (Does anyone know why?) > I'd like to suggest something along similar lines: > Allow instances in let-expressions and where-clauses. These instances > shadow other instances with the same parameter list. > Similarly, instances defined in modules shadow imported instances. > > Thus, in the following program: > > module Foo where > > import Bar (Baz) -- Where Bar defines instance Show (Baz a) > > instance Show (Baz a) where -- shadows the imported instance > > foo = let instance Show (Baz a) where -- shadows the instance defined > > in ... -- in where below, just like other bindings > > where instance Show (Baz a) -- shadows the module-global instance > > instance Show (Baz Quz) -- only allowed with > > -- OverlappingInstances, isn't shadowed by any of the other > > -- instances in this example. > > In this example, the instances for Baz have the following scopes: > * From Bar: Nowhere, as it is immediately shadowed. > * From Foo: Within all top-level declarations besides foo, as foo's > where clause shadows it. > * From the where clause: Within the where clause. The instance for > Baz Quz is also visible within the let > expression, as it is not shadowed by it. > * From the let expression: Within the let expression. > > Basically all I'm doing is applying regular name resolution semantics > to instances with the same parameter lists. > > I hope this helps clarify things. If not, please tell me what needs to > be done to fully clarify this. > > Gesh > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From eir at cis.upenn.edu Wed Oct 1 23:55:24 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Wed, 1 Oct 2014 19:55:24 -0400 Subject: [Haskell-cafe] Reflection functional dependency as an associated type? In-Reply-To: <1761275958.4908.1412201671327.JavaMail.yahoo@jws10065.mail.ne1.yahoo.com> References: <1761275958.4908.1412201671327.JavaMail.yahoo@jws10065.mail.ne1.yahoo.com> Message-ID: <8E913B07-29AA-4D62-9975-4946CAA20041@cis.upenn.edu> Type families and functional dependencies play very poorly together. The internal GHC mechanisms to implement them are basically entirely separate, so I'm not surprised that this fails. I do think that what you want is type-safe, but just not supported right now. Richard On Oct 1, 2014, at 6:14 PM, Brandon Moore wrote: > I was trying to make a bridge like this > > class MonadStateTF m where > type StateOf m :: * > instance (MonadState s m) => MonadStateTF m where > type StateOF m = s > > to allow writing constraints on state monads without a dangling type parameter > type NumMonad m = (MonadStateTF m, Num (StateOf m)) > > Unfortunately, the declaration type StateOF m = s > complains that "s" isn't mentioned on the left hand side rather > than somehow making use of the fundep. > > Brandon > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstcruz at gmail.com Thu Oct 2 04:47:05 2014 From: dstcruz at gmail.com (Daniel Santa Cruz) Date: Wed, 1 Oct 2014 22:47:05 -0600 Subject: [Haskell-cafe] Haskell Weekly News: Issue 308 Message-ID: Welcome to issue 308 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from September 21 to 27, 2014 Quotes of the Week * No one @remember'd fun stuff in IRC -- sadness! Top Reddit Stories * The GHC source code contains 1088 TODOs, please help bring that number down Domain: self.haskell, Score: 137, Comments: 101 Original: [1] http://goo.gl/DHnNdB On Reddit: [2] http://goo.gl/DHnNdB * [Elm] "Controlling Time and Space: understanding the many formulations of FRP" by Evan Czaplicki Domain: youtube.com, Score: 77, Comments: 25 Original: [3] http://goo.gl/SbkmGf On Reddit: [4] http://goo.gl/FfTW7e * Visualisation of Haskell Performance (thesis, pdf) Domain: personal.leeds.ac.uk, Score: 72, Comments: 14 Original: [5] http://goo.gl/WabCEA On Reddit: [6] http://goo.gl/niC2Y6 * shell-conduit: Write shell scripts in Haskell with Conduit Domain: chrisdone.com, Score: 70, Comments: 22 Original: [7] http://goo.gl/VWLO6V On Reddit: [8] http://goo.gl/ekDZUP * Time travel made easy - Introducing Elm Reactor Domain: elm-lang.org, Score: 57, Comments: 0 Original: [9] http://goo.gl/TEqQWi On Reddit: [10] http://goo.gl/bN5iUk * THIS is why you should hire Haskellers Domain: fpcomplete.com, Score: 53, Comments: 36 Original: [11] http://goo.gl/VbO8xQ On Reddit: [12] http://goo.gl/DzLzyp * "Edwin Brady on Idris" in the Type Theory Podcast Domain: typetheorypodcast.com, Score: 50, Comments: 87 Original: [13] http://goo.gl/45jZKf On Reddit: [14] http://goo.gl/BdIYxZ * Neil Mitchell's Haskell Blog: GHCID Domain: neilmitchell.blogspot.com, Score: 50, Comments: 57 Original: [15] http://goo.gl/Z4MJA5 On Reddit: [16] http://goo.gl/dHuK3y * "Coder Decoder: Functional Programmer Lingo Explained" Domain: youtube.com, Score: 46, Comments: 10 Original: [17] http://goo.gl/Rv8Ihc On Reddit: [18] http://goo.gl/6jeI38 * Snake in haskell < 170 lines [My first haskell app] Domain: self.haskell, Score: 46, Comments: 42 Original: [19] http://goo.gl/lUDNr4 On Reddit: [20] http://goo.gl/lUDNr4 * "Writing a game in Haskell" by Elise Huard Domain: youtube.com, Score: 40, Comments: 9 Original: [21] http://goo.gl/e9yIRJ On Reddit: [22] http://goo.gl/jIR56E * Automasymbolic Differentiation Domain: jtobin.ca, Score: 32, Comments: 11 Original: [23] http://goo.gl/5gGJHy On Reddit: [24] http://goo.gl/fJGS4O * Codewars now supports Haskell! Domain: codewars.com, Score: 31, Comments: 17 Original: [25] http://goo.gl/1X4Kd On Reddit: [26] http://goo.gl/DtXFcN * HIW 2014: Lennart Augustsson: Better type-error messages (very funny) Domain: youtube.com, Score: 29, Comments: 10 Original: [27] http://goo.gl/OtDjcI On Reddit: [28] http://goo.gl/2lOzfE * Tetris in Haskell with Netwire and GLFW Domain: scrambledeggsontoast.github.io, Score: 28, Comments: 12 Original: [29] http://goo.gl/W89z06 On Reddit: [30] http://goo.gl/bd2kvU * Leksah 0.14.1 includes a Web Inspector Domain: self.haskell, Score: 24, Comments: 6 Original: [31] http://goo.gl/QAFuF1 On Reddit: [32] http://goo.gl/QAFuF1 * Finger Trees - Tutorial and IHaskell Notebook Domain: andrew.gibiansky.com, Score: 24, Comments: 1 Original: [33] http://goo.gl/UxkDPr On Reddit: [34] http://goo.gl/cSZhyE * Getting a Quick Fix on Comonads (talk at Boston Haskell, Sept. 17) Domain: youtube.com, Score: 24, Comments: 19 Original: [35] http://goo.gl/FyAlIZ On Reddit: [36] http://goo.gl/hQ6KgW * Parametricity: Money for Nothing and Theorems for Free Bartosz Milewski Domain: bartoszmilewski.com, Score: 23, Comments: 27 Original: [37] http://goo.gl/1W3uEj On Reddit: [38] http://goo.gl/b2rPPN Top StackOverflow Questions * what does Haskell's <|> operator do? votes: 35, answers: 4 Read on SO: [39] http://goo.gl/6aT68b * Does creating a (non-list) data structure via fromList actually create the list? votes: 14, answers: 1 Read on SO: [40] http://goo.gl/HwM94h * Why does <$> and <*> take input in an order opposite of >>=? votes: 14, answers: 2 Read on SO: [41] http://goo.gl/TXFyTD * Check memory usage in haskell votes: 13, answers: 1 Read on SO: [42] http://goo.gl/L4WmV4 * What are the differences between layers and extensible-effects? votes: 11, answers: 2 Read on SO: [43] http://goo.gl/9K0gLz Until next time, [44]+Daniel Santa Cruz References 1. http://www.reddit.com/r/haskell/comments/2hes8m/the_ghc_source_code_contains_1088_todos_please/ 2. http://www.reddit.com/r/haskell/comments/2hes8m/the_ghc_source_code_contains_1088_todos_please/ 3. https://www.youtube.com/watch?v=Agu6jipKfYw 4. http://www.reddit.com/r/haskell/comments/2h43hs/elm_controlling_time_and_space_understanding_the/ 5. http://www.personal.leeds.ac.uk/~scpmw/static/thesis.pdf 6. http://www.reddit.com/r/haskell/comments/2h89xh/visualisation_of_haskell_performance_thesis_pdf/ 7. http://chrisdone.com/posts/shell-conduit 8. http://www.reddit.com/r/haskell/comments/2h017v/shellconduit_write_shell_scripts_in_haskell_with/ 9. http://elm-lang.org/blog/Introducing-Elm-Reactor.elm 10. http://www.reddit.com/r/haskell/comments/2hcgs1/time_travel_made_easy_introducing_elm_reactor/ 11. https://www.fpcomplete.com/business/blog/utilizing-haskell-fynder/ 12. http://www.reddit.com/r/haskell/comments/2h9p8z/this_is_why_you_should_hire_haskellers/ 13. http://typetheorypodcast.com/2014/09/episode-2-edwin-brady-on-idris/ 14. http://www.reddit.com/r/haskell/comments/2hif58/edwin_brady_on_idris_in_the_type_theory_podcast/ 15. http://neilmitchell.blogspot.com/2014/09/ghcid-new-ghci-based-ide-ish.html 16. http://www.reddit.com/r/haskell/comments/2hnmjr/neil_mitchells_haskell_blog_ghcid/ 17. https://www.youtube.com/watch?v=uwrCQmpZ8Ts&index=28&list=UU_QIfHvN9auy2CoOdSfMWDw 18. http://www.reddit.com/r/haskell/comments/2hbjya/coder_decoder_functional_programmer_lingo/ 19. http://www.reddit.com/r/haskell/comments/2hnarl/snake_in_haskell_170_lines_my_first_haskell_app/ 20. http://www.reddit.com/r/haskell/comments/2hnarl/snake_in_haskell_170_lines_my_first_haskell_app/ 21. https://www.youtube.com/watch?v=1MNTerD8IuI 22. http://www.reddit.com/r/haskell/comments/2h7tw8/writing_a_game_in_haskell_by_elise_huard/ 23. http://jtobin.ca/blog/2014/07/06/automasymbolic-differentiation/ 24. http://www.reddit.com/r/haskell/comments/2hkmlq/automasymbolic_differentiation/ 25. http://www.codewars.com/ 26. http://www.reddit.com/r/haskell/comments/2hflkd/codewars_now_supports_haskell/ 27. https://www.youtube.com/watch?v=rdVqQUOvxSU 28. http://www.reddit.com/r/haskell/comments/2hf34h/hiw_2014_lennart_augustsson_better_typeerror/ 29. http://scrambledeggsontoast.github.io/2014/09/23/tetris-netwire/ 30. http://www.reddit.com/r/haskell/comments/2h6g8n/tetris_in_haskell_with_netwire_and_glfw/ 31. http://www.reddit.com/r/haskell/comments/2h357z/leksah_0141_includes_a_web_inspector/ 32. http://www.reddit.com/r/haskell/comments/2h357z/leksah_0141_includes_a_web_inspector/ 33. http://andrew.gibiansky.com/blog/haskell/finger-trees/ 34. http://www.reddit.com/r/haskell/comments/2h9p9z/finger_trees_tutorial_and_ihaskell_notebook/ 35. https://www.youtube.com/watch?v=F7F-BzOB670&feature=youtu.be 36. http://www.reddit.com/r/haskell/comments/2hc3im/getting_a_quick_fix_on_comonads_talk_at_boston/ 37. http://bartoszmilewski.com/2014/09/22/parametricity-money-for-nothing-and-theorems-for-free/ 38. http://www.reddit.com/r/haskell/comments/2h4t98/parametricity_money_for_nothing_and_theorems_for/ 39. http://stackoverflow.com/questions/26002415/what-does-haskells-operator-do 40. http://stackoverflow.com/questions/25964737/does-creating-a-non-list-data-structure-via-fromlist-actually-create-the-list 41. http://stackoverflow.com/questions/26015473/why-does-and-take-input-in-an-order-opposite-of 42. http://stackoverflow.com/questions/26035489/check-memory-usage-in-haskell 43. http://stackoverflow.com/questions/25995369/what-are-the-differences-between-layers-and-extensible-effects 44. https://plus.google.com/105107667630152149014/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.trstenjak at gmail.com Thu Oct 2 08:50:18 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Thu, 2 Oct 2014 10:50:18 +0200 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <542C75B9.2010303@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C75B9.2010303@gesh.uni.cx> Message-ID: <20141002085018.GA2998@machine> Hi Gesh, On Thu, Oct 02, 2014 at 12:44:25AM +0300, Gesh wrote: > Correct, although that's not what I said. I just said that a case could > be made for saying the design of programs around global uniqueness was > poorly thought out. I think the problem is, that for some type classes global uniqueness is a very good idea and for some it might not be that relevant. If there's e.g. a PrettyPrint type class, then one might argue, that it's a good idea to be able to change the pretty printing of a data type depending on the context. But for a type class represeting the equality of a data type it might be more harmful then good, to be able to change it. One could argue now, that it's in the responsibility of the programmer to do the right thing, but I like it very much, that Haskell does most of the time the right thing for me. I'm also not quite sure how much harder the reasoning of code gets, if instances can be overloaded. Greetings, Daniel From roma at ro-che.info Thu Oct 2 09:08:39 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Thu, 02 Oct 2014 12:08:39 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> Message-ID: <542D1617.6020408@ro-che.info> On 02/10/14 02:50, Richard Eisenberg wrote: > For what it's worth, I think I can agree that types like `Set` should > carry around the relevant `Ord` dictionary. What exactly do you mean by that? Redefining the Set type so that it carries a dictionary, such as data Set a where Bin :: Ord a => ... or somehow modifying GHC's internal dictionary passing mechanism without changing any user code (such as Data.Set)? Roman -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From miguelimo38 at yandex.ru Thu Oct 2 09:29:00 2014 From: miguelimo38 at yandex.ru (Miguel Mitrofanov) Date: Thu, 02 Oct 2014 13:29:00 +0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> Message-ID: <243441412242140@web20h.yandex.ru> An HTML attachment was scrubbed... URL: From dominique.devriese at cs.kuleuven.be Thu Oct 2 09:29:43 2014 From: dominique.devriese at cs.kuleuven.be (Dominique Devriese) Date: Thu, 2 Oct 2014 11:29:43 +0200 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <20141002085018.GA2998@machine> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C75B9.2010303@gesh.uni.cx> <20141002085018.GA2998@machine> Message-ID: Daniel, This is an interesting discussion and I personally also think Haskell should in time move away from global uniqueness of instances, at least as the default. 2014-10-02 10:50 GMT+02:00 Daniel Trstenjak : > On Thu, Oct 02, 2014 at 12:44:25AM +0300, Gesh wrote: >> Correct, although that's not what I said. I just said that a case could >> be made for saying the design of programs around global uniqueness was >> poorly thought out. > > I think the problem is, that for some type classes global uniqueness is > a very good idea and for some it might not be that relevant. > > If there's e.g. a PrettyPrint type class, then one might argue, that > it's a good idea to be able to change the pretty printing of a data type > depending on the context. > > But for a type class represeting the equality of a data type it might be > more harmful then good, to be able to change it. I think you're right that whether we want global uniqueness of instances depends on the situation. However, it doesn't just depend on the type class in question. Consider for example the Ord type class. The fact that we sometimes want to use different orderings for the same data types is clearly evidenced by the existence of functions such as sortBy and all of the "comparing ..." stuff in Data.Ord. On the other hand, there is the fact that data types like Set crucially depend on being used with a single Ord instance for correctness. As you suggest, a way to deal with this could be to make a data type like Data.Set carry around the Ord instance, something like this: data Set a where SomeInternalConstructor :: Ord a => ... insert :: a -> Set a -> Set a However, it seems a bit unfortunate to me that this extra data (the type class dictionary) would be carried around at runtime instead of it being inferred and potentially compiled out at compile time. I wonder if a more static alternative could be to introduce some limited form of dependent types (I'm reminded of Scala's value-dependent types) to index the Data.Set data type with the Ord instance that it should be used with, something like: data Set a (instOrdA :: Ord a) where ... insert :: (ordA :: Ord a, ordA ~v instOrdA) => a -> Set a instOrdA -> Set a instOrdA In such code, the constraint "ordA ~v instOrdA" would require that the two instances are equal in some intentional and decidably checkable way (i.e. no automatic unfolding of recursive definitions and such). Perhaps it's not even needed to require the "(ordA :: Ord a, ordA ~v instOrdA) =>" contraint, but the compiler could somehow just take the instance from the "Set a instOrdA" type and make it available for type class resolution in the body of insert? Anyway, I agree with Gesh that at some point, Haskell should deprecate global uniqueness of type class instances, but we should first explore alternatives for modeling data types like Set that currently depend on it. There's still quite some room for research here in my opinion. Regards, Dominique From miguelimo38 at yandex.ru Thu Oct 2 09:31:26 2014 From: miguelimo38 at yandex.ru (Miguel Mitrofanov) Date: Thu, 02 Oct 2014 13:31:26 +0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> Message-ID: <256081412242286@web20h.yandex.ru> How can we merge two Sets if they carry different Ord dictionaries? 02.10.2014, 03:51, "Richard Eisenberg" : > Thanks, Gesh, for the email below and the previous one, spelling out the distinction between coherence and global uniqueness. I had been conflating coherence and global uniqueness (as it seems others have been), and drawing this out is helpful. > > Though I can't yet say I'm in support, exactly, I'm less vehemently against this idea than I was this morning. In particular, I actually really like the idea of local class instances, which have occurred to me before but which I've never considered seriously. > > Unfortunately, this all breaks apart horribly when thinking about type instances. Global uniqueness, not just coherence, is needed for type instances: >> ?type family F a b >> ?type instance F a b = b >> >> ?oops :: F a b -> b >> ?oops = id >> >> ?unsafeCoerce :: a -> b >> ?unsafeCoerce = let type instance F a b = a in >> ????????????????oops > > The problem is that a type instance introduces a type equality. Haskell is capable of passing type equality evidence around, so equalities can escape their scope, if the programmer wants to do so. Thus, there can never be a situation where some type (in this case `F a b`) is equal to one thing in one context and an incompatible thing in a different context, anywhere in the same program. I've written my example above with non-associated types, but the same thing can be written with associated types (and more syntactic overhead). I can't currently imagine a type-safe system that did not require global uniqueness for type instances. > > For what it's worth, I think I can agree that types like `Set` should carry around the relevant `Ord` dictionary. Global uniqueness of class instances is already threatened by all manner of extensions; we've just been much more careful about global uniqueness of type instances. > > Richard > > On Oct 1, 2014, at 6:05 PM, Gesh wrote: >> ?On 10/1/2014 11:42 PM, Bardur Arantsson wrote: >>> ?(I say "proposal"... this needs some serious fleshing out and a >>> ?semi-formal specification for instance resolution rules &c before it >>> ?becomes a proposal. Just "Look at Oleg's paper" is not good enough.) >> ?I see I came off unclearly. Please allow me to remedy that. >> >> ?My reference to Oleg's paper was badly framed. What I meant to say was >> ?more along the following lines: >> ?Oleg discussed adding local typeclass instances in his reflection paper. >> ?For some reason, his proposal wasn't taken. (Does anyone know why?) >> ?I'd like to suggest something along similar lines: >> ?Allow instances in let-expressions and where-clauses. These instances >> ?shadow other instances with the same parameter list. >> ?Similarly, instances defined in modules shadow imported instances. >> >> ?Thus, in the following program: >>> ?module Foo where >>> ?import Bar (Baz) -- Where Bar defines instance Show (Baz a) >>> ?instance Show (Baz a) where -- shadows the imported instance >>> ?foo = let instance Show (Baz a) where -- shadows the instance defined >>> ???????in ... ?????????????-- in where below, just like other bindings >>> ???where instance Show (Baz a) -- shadows the module-global instance >>> ?????????instance Show (Baz Quz) -- only allowed with >>> ?????????-- OverlappingInstances, isn't shadowed by any of the other >>> ?????????-- instances in this example. >> ?In this example, the instances for Baz have the following scopes: >> ?* From Bar: Nowhere, as it is immediately shadowed. >> ?* From Foo: Within all top-level declarations besides foo, as foo's >> ????????????where clause shadows it. >> ?* From the where clause: Within the where clause. The instance for >> ?????????????????????????Baz Quz is also visible within the let >> ?????????????????????????expression, as it is not shadowed by it. >> ?* From the let expression: Within the let expression. >> >> ?Basically all I'm doing is applying regular name resolution semantics >> ?to instances with the same parameter lists. >> >> ?I hope this helps clarify things. If not, please tell me what needs to >> ?be done to fully clarify this. >> >> ?Gesh >> ?_______________________________________________ >> ?Haskell-Cafe mailing list >> ?Haskell-Cafe at haskell.org >> ?http://www.haskell.org/mailman/listinfo/haskell-cafe > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From johan.tibell at gmail.com Thu Oct 2 09:43:39 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Thu, 2 Oct 2014 11:43:39 +0200 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <256081412242286@web20h.yandex.ru> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> <256081412242286@web20h.yandex.ru> Message-ID: We have to use a less efficient algorithm (e.g. repeated insertion.) We could possibly regain the efficiency in the common case if the dictionary was statically allocated, as we could check if the two sets used the same dictionary by a pointer comparison. On Thu, Oct 2, 2014 at 11:31 AM, Miguel Mitrofanov wrote: > How can we merge two Sets if they carry different Ord dictionaries? > > 02.10.2014, 03:51, "Richard Eisenberg" : > > Thanks, Gesh, for the email below and the previous one, spelling out the > distinction between coherence and global uniqueness. I had been conflating > coherence and global uniqueness (as it seems others have been), and drawing > this out is helpful. > > > > Though I can't yet say I'm in support, exactly, I'm less vehemently > against this idea than I was this morning. In particular, I actually really > like the idea of local class instances, which have occurred to me before > but which I've never considered seriously. > > > > Unfortunately, this all breaks apart horribly when thinking about type > instances. Global uniqueness, not just coherence, is needed for type > instances: > >> type family F a b > >> type instance F a b = b > >> > >> oops :: F a b -> b > >> oops = id > >> > >> unsafeCoerce :: a -> b > >> unsafeCoerce = let type instance F a b = a in > >> oops > > > > The problem is that a type instance introduces a type equality. Haskell > is capable of passing type equality evidence around, so equalities can > escape their scope, if the programmer wants to do so. Thus, there can never > be a situation where some type (in this case `F a b`) is equal to one thing > in one context and an incompatible thing in a different context, anywhere > in the same program. I've written my example above with non-associated > types, but the same thing can be written with associated types (and more > syntactic overhead). I can't currently imagine a type-safe system that did > not require global uniqueness for type instances. > > > > For what it's worth, I think I can agree that types like `Set` should > carry around the relevant `Ord` dictionary. Global uniqueness of class > instances is already threatened by all manner of extensions; we've just > been much more careful about global uniqueness of type instances. > > > > Richard > > > > On Oct 1, 2014, at 6:05 PM, Gesh wrote: > >> On 10/1/2014 11:42 PM, Bardur Arantsson wrote: > >>> (I say "proposal"... this needs some serious fleshing out and a > >>> semi-formal specification for instance resolution rules &c before it > >>> becomes a proposal. Just "Look at Oleg's paper" is not good enough.) > >> I see I came off unclearly. Please allow me to remedy that. > >> > >> My reference to Oleg's paper was badly framed. What I meant to say was > >> more along the following lines: > >> Oleg discussed adding local typeclass instances in his reflection > paper. > >> For some reason, his proposal wasn't taken. (Does anyone know why?) > >> I'd like to suggest something along similar lines: > >> Allow instances in let-expressions and where-clauses. These instances > >> shadow other instances with the same parameter list. > >> Similarly, instances defined in modules shadow imported instances. > >> > >> Thus, in the following program: > >>> module Foo where > >>> import Bar (Baz) -- Where Bar defines instance Show (Baz a) > >>> instance Show (Baz a) where -- shadows the imported instance > >>> foo = let instance Show (Baz a) where -- shadows the instance defined > >>> in ... -- in where below, just like other bindings > >>> where instance Show (Baz a) -- shadows the module-global instance > >>> instance Show (Baz Quz) -- only allowed with > >>> -- OverlappingInstances, isn't shadowed by any of the other > >>> -- instances in this example. > >> In this example, the instances for Baz have the following scopes: > >> * From Bar: Nowhere, as it is immediately shadowed. > >> * From Foo: Within all top-level declarations besides foo, as foo's > >> where clause shadows it. > >> * From the where clause: Within the where clause. The instance for > >> Baz Quz is also visible within the let > >> expression, as it is not shadowed by it. > >> * From the let expression: Within the let expression. > >> > >> Basically all I'm doing is applying regular name resolution semantics > >> to instances with the same parameter lists. > >> > >> I hope this helps clarify things. If not, please tell me what needs to > >> be done to fully clarify this. > >> > >> Gesh > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.trstenjak at gmail.com Thu Oct 2 09:53:05 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Thu, 2 Oct 2014 11:53:05 +0200 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C75B9.2010303@gesh.uni.cx> <20141002085018.GA2998@machine> Message-ID: <20141002095305.GA5778@machine> Hi Dominique, On Thu, Oct 02, 2014 at 11:29:43AM +0200, Dominique Devriese wrote: > Consider for example the Ord type class. The fact that we sometimes > want to use different orderings for the same data types is clearly > evidenced by the existence of functions such as sortBy and all of the > "comparing ..." stuff in Data.Ord. I consider the Ord type class a particular bad example for allowing to overload instances, because it will IMHO make reasoning about code harder: sort :: Ord a => [a] -> [a] Greetings, Daniel From eir at cis.upenn.edu Thu Oct 2 11:36:47 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Thu, 2 Oct 2014 07:36:47 -0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <542D1617.6020408@ro-che.info> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> <542D1617.6020408@ro-che.info> Message-ID: <2C86FDC2-334C-4B1A-AE87-44F30F22556B@cis.upenn.edu> On Oct 2, 2014, at 5:08 AM, Roman Cheplyaka wrote: > On 02/10/14 02:50, Richard Eisenberg wrote: >> For what it's worth, I think I can agree that types like `Set` should >> carry around the relevant `Ord` dictionary. > > What exactly do you mean by that? Redefining the Set type so that it > carries a dictionary, such as > > data Set a where > Bin :: Ord a => ... Yes, that's what I meant. But, Dominique's idea (further down the thread) of somehow encoding the choice of Ord instance into the type of Set is even better. That way, you could safely have multiple Sets floating around, each with a different notion of ordering. The type system could prevent you from `union`ing two Sets with different ordering relations, unless you call some explicit reorder function. There's lots of details to work out here, but I've wanted the ability to put a choice of dictionary in a type before... then again, I try to put all sorts of things into types. :) Richard From fuuzetsu at fuuzetsu.co.uk Thu Oct 2 12:08:18 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Thu, 02 Oct 2014 13:08:18 +0100 Subject: [Haskell-cafe] GHC 7.10 GHC-API Changes and proposed changes. In-Reply-To: References: Message-ID: <542D4032.1090009@fuuzetsu.co.uk> On 10/01/2014 07:34 PM, Alan & Kim Zimmerman wrote: > There are a number of changes in GHC 7.10 that will make it easier for > tool writers to use the GHC API. > > These include > > 1. More parser entrypoints, to explicitly parse fragments [Andrew Gibiansky] > > The following parsers are now provided > > parseModule, parseImport, parseStatement, ? parseDeclaration, > parseExpression, parseTypeSignature, ? parseFullStmt, parseStmt, > parseIdentifier, ? parseType, parseHeader Awesome. > 2. No more landmines in the AST [Alan Zimmerman] > > In the past it was difficult to work with the GHC AST as any generic > traversals had to carefully tiptoe around an assortment of panic and > undefined expressions. These have now been removed, allowing > standard traversal libraries to be used. > > There is a third change currently being discussed, and I would like > feedback on it's desirability. Also awesome. > 3. Introduce an annotation structure to the ParsedSource to record the > location of uncaptured keywords. > > At the moment the location of let / in / if / then / else / do > etc is not captured in the AST. This makes it difficult to > parse some source, transform the AST, and then output it again > preserving the original layout. > > The current proposal, which can be seen at [1] and a proof of > concept implementation at [2] returns a structure keyed to each AST > element containing simply the specific SrcSpan's not already > captured in the AST. > > This is the analogue of the Language.Haskell.Exts.Annotated.Syntax > from haskell-src-exts, except a custom SrcSpanInfo structure is > provided for each AST element constructor, and it is not embedded > within the AST. > > [1] https://ghc.haskell.org/trac/ghc/wiki/GhcAstAnnotations > [2] https://phabricator.haskell.org/D297 > > So, apart from HaRe, are there any other users who would be interested > in using this? > > Regards > Alan I imagine that basically *any* tool that ever cares about source locations of things would benefit. Naming existing specifics is difficult because they currently no doubt use some other way of dealing with the problem. I want to say ?yes, we could use this to implement a bunch of stuff in Yi!? but at the same time if HaRe can do it then we should simply hook up into that and never care for it ourselves. So while I appreciate SPJ making multiple attempts at reaching out for wider feedback, I think that in actual fact HaRe would be *the* big user here. It is hard to come up and say ?if GHC gets this then I'll write XYZ? because it might be the case that ?if GHC gets this then HaRe will be able to do XYZ which we can use?. I'd also like to say that it seems like it would make lexer-stuff easier but I am unsure whether that is even remotely related: this is for what parser spits out and the lexer would give us that information anyway, right? I think the lexer is currently not exposed either way? In conclusion, I think that if it makes it possible for HaRe to implement better transformations then it's a good change. I can't comment on the implementation impact here, this is merely from ?do we want this or not? point of view. -- Mateusz K. From sperber at deinprogramm.de Thu Oct 2 13:17:08 2014 From: sperber at deinprogramm.de (Michael Sperber) Date: Thu, 02 Oct 2014 15:17:08 +0200 Subject: [Haskell-cafe] Need help with scrap-your-boilerplate Message-ID: I'm a casual Haskell user, and am trying to use scrap-your-boilerplate to write a transformation - and failing. The rub is that the base function is polymorphic, boiling down to this: data Foo a = Foo a bar :: Foo a -> Foo a bar x = x Now, I'm trying to use SYB like so: foo :: Typeable a => a -> a foo = mkT bar ... but I get: Could not deduce (Typeable a0) arising from a use of ?mkT? from the context (Typeable a) bound by the type signature for foo :: Typeable a => a -> a at foo.hs:... The type variable ?a0? is ambiguous Note: there are several potential instances: Is there any way I could make this work? Any help would be much appreciated! -- Regards, Mike From oleg at okmij.org Thu Oct 2 14:21:06 2014 From: oleg at okmij.org (oleg at okmij.org) Date: Thu, 2 Oct 2014 10:21:06 -0400 (EDT) Subject: [Haskell-cafe] Increasing Haskell modularity Message-ID: <20141002142106.D09F2C3827@www1.g3.pair.com> The issue with local instances is very complicated one. First, they are sorely missed. However, they present quite a problem. Let us assume they are implemented and consider the following function f1 :: Int -> String f1 x = let instance Show Int where show _ = "one" in show x I think we all agree (f1 1) should evaluate to "one". However, given f2 :: Show a => a -> String f2 x = let instance Show Int where show _ = "one" in show x what should (f2 (1::Int)) return? One answer is that it should still return "one" -- that is, local instances should sort of form a closure (like local variables in the real closure). That is a good answer, but may lead to unpleasant surprises because the fact of the closure is not at all reflected in the type of the function. Consider data T = T f3 :: Show a => a -> String f3 x = let instance Show T where show _ = "T" in show x and take the closure semantics. The type says that to make (f3 T) well-typed, there has to be an instance Show T in scope. The user of f3 has no way to know of the private local instance that is closed over (short of examining the source code). Since the user knows there is no global instance T, the user attempts to define in. The user will be quite surprised to discover that (f3 T) is well-typed but their global instance Show T has no effect. Let us assume the opposite of the closure semantics -- local instances are not closed. So, local instances should behave sort of dynamically scoped variables (which are not captured in closures). Therefore, (f2 (1::Int)) should return "1". Such a choice is also problematic. Suppose GHC, seeing our call to f2, notices that the polymorphic f2 is called at type Int and decides, to save time on indirect dictionary calls, to specialize f2 to the type Int. So, GHC will generate a specialized instance of f2: f2_Int :: Int -> String f2_Int x = let instance Show Int where show _ = "one" in show x and we have already decided that (f2_Int 1), should return "one" rather than "1" (since f2_Int looks just like f1). Previously, specialization of a function was easy to understand: GHC may, at will, create a copy of a polymorphic function and instantiate it at a specific type. Then all calls to the polymorphic function at that specific type are replaced with the calls to the specialized function. The user can even do such a specialization themselves. With unclosed local instances, such a specialization changes the program behavior. We have to complicate the matters. Further, what should (f4 (1::Int)) return? f4 :: Show a => a -> String f4 x = let instance Show Int where show _ = "two" in f2 x Stefan Kaes, the person who introduced ``parametric overloading'' (type classes, in modern term) chose the ``closure semantics''. His system and prototype implementation had only local instances (and even local type classes). http://okmij.org/ftp/Computation/typeclass.html#Kaes Perhaps the most comprehensive treatment of local instances is the old paper D. Duggan and J. Ophel. Open and closed scopes for constrained genericity (PDF). Theoretical Computer Science, 275, 215-258, 2002. http://dl.acm.org/citation.cfm?id=570578 They propose a method to have both closure and non-closure semantics, differentiating based on so-called open and closed types. Our HW 2004 paper with Chung-chieh Shan proposed a way to elide the problem by restricting the local instances in such a way that the problem never arises. The `reflection' facility was used to implement such local instances. The idea was that local instances can be thought of as ordinary global instances; however, the scope of the type in their head is restricted. That is, rather than make the instances local we make local the type for which they are defined (or one of the types, for multi-parameter type classes). Local types can be emulated via first-class polymorphism. (BTW, if one can leave with unsafeCoerce, local instances can be much more efficiently implemented.) Gesh wrote: > * Give up on non-associated open type families. This I have > researched less well, but it seems to me that these have no use > case. Since one can make whatever instances one wishes for these type > families, one can't do anything useful with values of their instances. On the contrary, we found them very useful in defining interpreters that provide their own interpretation of not only primitives but also of types. http://okmij.org/ftp/gengo/NASSLLI10/index.html See, for example, http://okmij.org/ftp/gengo/NASSLLI10/Lambda.hs for partial evaluation and http://okmij.org/ftp/gengo/NASSLLI10/CFG.hs In the latter case, extensibility is particularly important as we do want to add further syntactic categories and their semantic interpretations. From jmccarty at sent.com Thu Oct 2 17:53:38 2014 From: jmccarty at sent.com (Jason McCarty) Date: Thu, 2 Oct 2014 13:53:38 -0400 Subject: [Haskell-cafe] Increasing Haskell modularity In-Reply-To: <20141002142106.D09F2C3827@www1.g3.pair.com> References: <20141002142106.D09F2C3827@www1.g3.pair.com> Message-ID: <20141002175338.GA28981@tensor> Here's another fun question. The following module is legal in GC, and does what you would expect. \begin{code} {-# LANGUAGE FlexibleInstances, OverlappingInstances #-} module Parametric where class IsInt a where isInt :: a -> Bool instance IsInt a where isInt _ = False instance IsInt Int where isInt _ = True myList1 :: IsInt a => a -> [a] myList1 x = if isInt x then [x] else [x, x] \end{code} Would the following module be legal under the proposal? If so, parametricity is gone, because you can define typecase without any constraints. \begin{code} {-# LANGUAGE ScopedTypeVariables, FlexibleInstances, OverlappingInstances, LocalInstances #-} module NotParametric where import Parametric myList2 :: a -> [a] myList2 (x :: a) = let instance IsInt a where isInt _ = False in let instance IsInt Int where isInt _ = True in myList1 x -- the IsInt constraint should be discharged by the local instances \end{code} The only way I see of avoiding this is if local instances can't discharge a constraint; that is, a local instance can only shadow an existing instance. It can't create an instance for a type that didn't already have one. Or maybe there's just a bad interaction with flexible/overlapping instances, but the extension seems less useful without these. -- Jason McCarty From gesh at gesh.uni.cx Thu Oct 2 18:37:52 2014 From: gesh at gesh.uni.cx (Gesh) Date: Thu, 02 Oct 2014 21:37:52 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> Message-ID: <542D9B80.7000605@gesh.uni.cx> On 10/2/2014 2:50 AM, Richard Eisenberg wrote: > Unfortunately, this all breaks apart horribly when thinking about > type instances. Global uniqueness, not just coherence, is needed for > type instances: > >> type family F a b >> type instance F a b = b >> >> oops :: F a b -> b >> oops = id >> >> unsafeCoerce :: a -> b >> unsafeCoerce = let type instance F a b = a in >> oops > > The problem is that a type instance introduces a type equality. > Haskell is capable of passing type equality evidence around, so > equalities can escape their scope, if the programmer wants to do so. > Thus, there can never be a situation where some type (in this case > `F a b`) is equal to one thing in one context and an incompatible > thing in a different context, anywhere in the same program. > I've written my example above with non-associated types, but the > same thing can be written with associated types (and more syntactic > overhead). I can't currently imagine a type-safe system that did not > require global uniqueness for type instances. Thank you, Richard, for giving a concrete example. Several things can be said about the above code. First and foremost, it seems unsafe to allow oops to even typecheck today. Suppose `F` did not have a catchall instance. Then the type `F a b` is morally equivalent to `forall a. a`, because we could create any instance we wished for `F`. Therefore, I would suggest that regardless of my original proposal being accepted, we only allow open type families in type signatures where they are either morally equivalent to closed type families (by having catchall instances) or where they appear as restrictions on more polymorphic values (such as `id :: F a b -> F a b`). Associated types would also be permitted if an instance of their typeclass were in scope. Second, as hinted above, open type families with catchall instances are morally equivalent to a closed type families, since no other instances can be added to them without overlapping with the catchall instance. Therefore, I also suggest that open type families with catchall clauses be considered closed. Finally, this case serves as an excellent example to show that if and when we add support for local closed type families, we must consider the local type family distinct from the global one. In particular, one won't be able to pass instances of the local families to functions expecting the global family without compromising type safety. With the proposal from my first point, we outlaw `oops`, even with associated types, and thereby regain type safety. Any other problems? Gesh From gesh at gesh.uni.cx Thu Oct 2 18:46:13 2014 From: gesh at gesh.uni.cx (Gesh) Date: Thu, 02 Oct 2014 21:46:13 +0300 Subject: [Haskell-cafe] Increasing Haskell modularity In-Reply-To: <20141002142106.D09F2C3827@www1.g3.pair.com> References: <20141002142106.D09F2C3827@www1.g3.pair.com> Message-ID: <542D9D75.2070600@gesh.uni.cx> On 10/2/2014 5:21 PM, oleg at okmij.org wrote: > Given >> f2 :: Show a => a -> String >> f2 x = >> let instance Show Int where show _ = "one" >> in show x > > what should (f2 (1::Int)) return? One answer is that it should still > return "one" -- that is, local instances should sort of form a > closure (like local variables in the real closure). That is a good > answer, but may lead to unpleasant surprises because the fact of the > closure is not at all reflected in the type of the function. > > Consider >> data T = T >> f3 :: Show a => a -> String >> f3 x = >> let instance Show T where show _ = "T" >> in show x > > and take the closure semantics. The type says that to make (f3 T) > well-typed, there has to be an instance Show T in scope. The user of > f3 has no way to know of the private local instance that is closed > over (short of examining the source code). Since the user knows > there is no global instance T, the user attempts to define in. The > user will be quite surprised to discover that (f3 T) is well-typed > but their global instance Show T has no effect. That is true, but even today one can write overly-constrained expressions that don't actually need these constraints. How is `f3` above any different from > foo :: Show a => a -> String > foo = const "Fooled you, I didn't need Show after all." However, one could write a more precise type for `f3` which reflects the fact that a `Show` instance is unnecessary for `T`, as follows > class Foo a where > instance Foo T where > instance Show a => Foo a where > f3 :: Foo a => a -> String (Of course, this requires OverlappingInstances) In fact, it would be useful to have syntactic sugar for this sort of constraint disjunction, for cases like this. We might even extend GHC's type checker to infer such disjunctions, so that `f3`'s type would be inferred to be `Show a \/ (a ~ T) => a -> String`. Thanks for the in-depth analysis and further reading, Gesh P.S. You might want to change your email client's settings, as you don't seem to be sending In-Reply-To headers, which makes threading horrible. From dreixel at gmail.com Thu Oct 2 18:52:58 2014 From: dreixel at gmail.com (=?UTF-8?Q?Jos=C3=A9_Pedro_Magalh=C3=A3es?=) Date: Thu, 2 Oct 2014 19:52:58 +0100 Subject: [Haskell-cafe] Need help with scrap-your-boilerplate In-Reply-To: References: Message-ID: Hello Mike, Typeable is essentially monomorphic, so I don't think you can use mkT with a polymorphic function... Cheers, Pedro On Thu, Oct 2, 2014 at 2:17 PM, Michael Sperber wrote: > > I'm a casual Haskell user, and am trying to use scrap-your-boilerplate > to write a transformation - and failing. The rub is that the base > function is polymorphic, boiling down to this: > > data Foo a = Foo a > > bar :: Foo a -> Foo a > bar x = x > > Now, I'm trying to use SYB like so: > > foo :: Typeable a => a -> a > foo = mkT bar > > ... but I get: > > Could not deduce (Typeable a0) arising from a use of ?mkT? > from the context (Typeable a) > bound by the type signature for foo :: Typeable a => a -> a > at foo.hs:... > The type variable ?a0? is ambiguous > Note: there are several potential instances: > > Is there any way I could make this work? > > Any help would be much appreciated! > > -- > Regards, > Mike > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Thu Oct 2 19:03:13 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 2 Oct 2014 15:03:13 -0400 Subject: [Haskell-cafe] Need help with scrap-your-boilerplate In-Reply-To: References: Message-ID: I think the missing bit is simply you need to add a deriving Typeable to your data Foo declaration On Thu, Oct 2, 2014 at 2:52 PM, Jos? Pedro Magalh?es wrote: > Hello Mike, > > Typeable is essentially monomorphic, so I don't think you can use mkT with > a polymorphic function... > > > Cheers, > Pedro > > On Thu, Oct 2, 2014 at 2:17 PM, Michael Sperber > wrote: > >> >> I'm a casual Haskell user, and am trying to use scrap-your-boilerplate >> to write a transformation - and failing. The rub is that the base >> function is polymorphic, boiling down to this: >> >> data Foo a = Foo a >> >> bar :: Foo a -> Foo a >> bar x = x >> >> Now, I'm trying to use SYB like so: >> >> foo :: Typeable a => a -> a >> foo = mkT bar >> >> ... but I get: >> >> Could not deduce (Typeable a0) arising from a use of ?mkT? >> from the context (Typeable a) >> bound by the type signature for foo :: Typeable a => a -> a >> at foo.hs:... >> The type variable ?a0? is ambiguous >> Note: there are several potential instances: >> >> Is there any way I could make this work? >> >> Any help would be much appreciated! >> >> -- >> Regards, >> Mike >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eir at cis.upenn.edu Thu Oct 2 19:09:26 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Thu, 2 Oct 2014 15:09:26 -0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <542D9B80.7000605@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> <542D9B80.7000605@gesh.uni.cx> Message-ID: On Oct 2, 2014, at 2:37 PM, Gesh wrote: > On 10/2/2014 2:50 AM, Richard Eisenberg wrote: > >> type family F a b > >> type instance F a b = b > >> > >> oops :: F a b -> b > >> oops = id > > > Several things can be said about the above code. First and foremost, > it seems unsafe to allow oops to even typecheck today. Suppose `F` did > not have a catchall instance. Then the type `F a b` is morally > equivalent to `forall a. a`, because we could create any instance we > wished for `F`. Therefore, I would suggest that regardless of my > original proposal being accepted, we only allow open type families in > type signatures where they are either morally equivalent to closed > type families (by having catchall instances) or where they appear as > restrictions on more polymorphic values (such as > `id :: F a b -> F a b`). Associated types would also be permitted if > an instance of their typeclass were in scope. > I'm sorry, but I don't understand the paragraph above at all. You say below that "open type families with catchall instances [such as F] are morally equivalent to closed type families" and you say "we only allow open type families in type signatures where there are morally equivalent to closed type families". So it seems `oops` is OK. And I don't know what you're getting at by "restrictions on more polymorphic values". Incidentally, as type family instances can *never* overlap, a type family with a catchall instance must have only that one instance. > Second, as hinted above, open type families with catchall instances > are morally equivalent to a closed type families, since no other > instances can be added to them without overlapping with the catchall > instance. Therefore, I also suggest that open type families with > catchall clauses be considered closed. What does your last sentence mean? What do you mean by a type family that is considered closed? > > Finally, this case serves as an excellent example to show that if and > when we add support for local closed type families, we must consider > the local type family distinct from the global one. But I don't have a local type family. I have a local type family instance. How can one instance be seen as distinct from another? > In particular, one > won't be able to pass instances of the local families to functions > expecting the global family without compromising type safety. Unlike class instances, type family instances do not form dictionaries and are not passed around. Given that fact, I'm not sure what you mean here. > > With the proposal from my first point, we outlaw `oops`, even with > associated types, and thereby regain type safety. > > Any other problems? Yes. See above. :) Richard > > Gesh From sjackman at gmail.com Thu Oct 2 19:41:54 2014 From: sjackman at gmail.com (Shaun Jackman) Date: Thu, 2 Oct 2014 12:41:54 -0700 Subject: [Haskell-cafe] Add linker flags to GHC 6.12.3 using extra-gcc-opts Message-ID: Hi. I get the following error message when linking with GHC. ``` $ ghc -o hello-hs hello-hs.hs /projects/btl/linuxbrew/bin/ld: cannot find -lgmp collect2: ld returned 1 exit status ``` It's fixed by adding `-L/projects/btl/linuxbrew/lib` to the command line. ``` $ ghc -L/projects/btl/linuxbrew/lib -o hello-hs hello-hs.hs ``` I'd like to add the above `-L` option to the default linking arguments of GHC. I thought that I could do this by modifying the file `extra-gcc-opts`. I changed it from ` -fwrapv` to ` -fwrapv -L/projects/btl/linuxbrew/lib`, but it has no effect. I confirmed this by changing it to ` -fBROKEN`, and again no effect. The file location is `/projects/btl/linuxbrew/Cellar/ghc612/6.12.3/lib/ghc-6.12.3/extra-gcc-opts`. How do I change the default gcc link options of GHC 6.12.3? It would be difficult for me to upgrade to GHC 7.8.3 because the binary package does not run on CentOS 5.11. Yes, I know it's ancient. It's an HPC cluster, and I have no control over it. So, likewise, I'm not able to install `libgmp-devel` in `/usr`, which would also solve this issue. Thanks for your help. Cheers, Shaun http://sjackman.ca From roma at ro-che.info Thu Oct 2 21:38:06 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Fri, 03 Oct 2014 00:38:06 +0300 Subject: [Haskell-cafe] Need help with scrap-your-boilerplate In-Reply-To: References: Message-ID: <542DC5BE.8000508@ro-che.info> On 02/10/14 16:17, Michael Sperber wrote: > > I'm a casual Haskell user, and am trying to use scrap-your-boilerplate > to write a transformation - and failing. The rub is that the base > function is polymorphic, boiling down to this: > > data Foo a = Foo a > > bar :: Foo a -> Foo a > bar x = x > > Now, I'm trying to use SYB like so: > > foo :: Typeable a => a -> a > foo = mkT bar > > ... but I get: > > Could not deduce (Typeable a0) arising from a use of ?mkT? > from the context (Typeable a) > bound by the type signature for foo :: Typeable a => a -> a > at foo.hs:... > The type variable ?a0? is ambiguous > Note: there are several potential instances: > > Is there any way I could make this work? > > Any help would be much appreciated! I assume you want to apply bar to all monomorphic instances of Foo a, and not just a specific one (which would be much easier). I think the following should work (with GHC 7.8). But you definitely should test it ? with this kind of code, the fact that it compiles doesn't really mean much. {-# LANGUAGE DeriveDataTypeable #-} import Data.Typeable import GHC.Prim data Foo a = Foo a deriving Typeable bar :: Foo a -> Foo a bar x = x getTyCon :: TypeRep -> TyCon getTyCon = fst . splitTyConApp fooTyCon :: TyCon fooTyCon = getTyCon $ typeRep (Proxy :: Proxy Foo) foo :: Typeable a => a -> a foo x | thisTyCon == fooTyCon = unsafeCoerce# (bar (unsafeCoerce# x :: Foo Any)) | otherwise = x where thisTyCon = getTyCon $ typeOf x Roman -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From u3502350 at connect.hku.hk Fri Oct 3 04:20:55 2014 From: u3502350 at connect.hku.hk (u3502350 at connect.hku.hk) Date: Thu, 02 Oct 2014 23:20:55 -0500 Subject: [Haskell-cafe] u3502350@connect.hku.hk has indicated you're a friend. Accept? Message-ID: <0.0.14B.7D4.1CFDEC0E8B3EA4E.273C@mail4.flipmailer.com> Hi, u3502350 at connect.hku.hk wants to follow you. ****** Is u3502350 at connect.hku.hk you friend? ****** If Yes please follow the link below: http://invites.flipmailer.com/signup_e.html?fullname=&email=haskell-cafe at haskell.org&invitername=u3502350 at connect.hku.hk&inviterid=31597183&userid=0&token=0&emailmasterid=e5ee3c5a-d4ba-44dc-bb55-4ac63f66db22&from=u3502350 at connect.hku.hk&src=txt_yes If No please follow the link below: http://invites.flipmailer.com/signup_e.html?fullname=&email=haskell-cafe at haskell.org&invitername=u3502350 at connect.hku.hk&inviterid=31597183&userid=0&token=0&emailmasterid=e5ee3c5a-d4ba-44dc-bb55-4ac63f66db22&from=u3502350 at connect.hku.hk&src=txt_no Follow the link below to remove yourself from all such emails http://invites.flipmailer.com/uns_inviter.jsp?email=haskell-cafe at haskell.org&iid=e5ee3c5a-d4ba-44dc-bb55-4ac63f66db22&from=u3502350 at connect.hku.hk -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominique.devriese at cs.kuleuven.be Fri Oct 3 11:05:05 2014 From: dominique.devriese at cs.kuleuven.be (Dominique Devriese) Date: Fri, 3 Oct 2014 13:05:05 +0200 Subject: [Haskell-cafe] Increasing Haskell modularity In-Reply-To: <20141002142106.D09F2C3827@www1.g3.pair.com> References: <20141002142106.D09F2C3827@www1.g3.pair.com> Message-ID: 2014-10-02 16:21 GMT+02:00 Oleg : > However, given > > f2 :: Show a => a -> String > f2 x = > let instance Show Int where show _ = "one" > in show x > > what should (f2 (1::Int)) return? I haven't studied this in detail (yet :)), but can't we solve this coherence problem by requiring a bit of additional type annotations from the programmer? Specifically, I would expect the problem to go away if we require the user to explicitly state the resulting type of the "let instance" expression. The syntax could look like let instance Show Int where show _ = "one" in show x as Show a => String where the specification "Show a => String" would imply that the Show a instance is propagated outwards and the Show Int instance is unused. If the programmer instead wrote let instance Show Int where show _ = "one" in show x as String That would imply that the compiler should try to resolve the required "Show a" constraint, but I would then expect an error saying that "Show a" cannot be derived from "Show Int", because we don't apply unification to constraints (or at least, GHC doesn't, and it seems like a good idea not to). Such an additional annotation is a bit more work for the programmer, but perhaps that might be acceptable for this indeed sorely missed feature? Regards, Dominique From iavor.diatchki at gmail.com Fri Oct 3 18:37:42 2014 From: iavor.diatchki at gmail.com (Iavor Diatchki) Date: Fri, 3 Oct 2014 11:37:42 -0700 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) Message-ID: Hello, I am pleased to announce a new version of `graphmod`---a program that helps you visualize the import dependencies between the modules in your Haskell programs. The new feature in version 1.2.4 is support for pruning the dependency graph, which is enabled with the flag -p or --prune-edges. When this option is selected, `graphmod` will ignore imports to modules that are already imported by some of the dependencies of the module. For example, consider the following modules: module A where { import B; import C } module B where { import C } module C where { } When generated with `--prune-edges`, the resulting graph will be: A -> B -> C Note that there is no edge from `A` to `C`, because `C` is already imported by `B`. Happy hacking, -Iavor -------------- next part -------------- An HTML attachment was scrubbed... URL: From redneb8888 at gmail.com Fri Oct 3 18:37:52 2014 From: redneb8888 at gmail.com (Marios Titas) Date: Fri, 3 Oct 2014 19:37:52 +0100 Subject: [Haskell-cafe] ANN: hxt-css 0.1.0.0, a CSS selector engine for HXT Message-ID: Hello everybody, I'd like to announce the first public release of hxt-css, a CSS selector engine for the Haskell XML Toolbox (HXT). Its main design goals are: * support as many CSS selectors as possible: it currently supports all CSS 3 selectors except the ones that do not make sense outside a web browser (e.g. such as :hover). For example, it supports weird things like div > span + p:not(:nth-of-type(3n-1)) * try to be 100% correct: in all tests I ran, the output of hxt-css was identical to that of firefox & chrome. * follow the conventions of other hxt packages: for example, error reporting is done the same way as hxt-xpath. Note, there is already a similar package in hackage called HandsomeSoup. - Marios From fuuzetsu at fuuzetsu.co.uk Fri Oct 3 18:40:29 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Fri, 03 Oct 2014 19:40:29 +0100 Subject: [Haskell-cafe] ANN: hxt-css 0.1.0.0, a CSS selector engine for HXT In-Reply-To: References: Message-ID: <542EED9D.4020100@fuuzetsu.co.uk> On 10/03/2014 07:37 PM, Marios Titas wrote: > Hello everybody, > > I'd like to announce the first public release of hxt-css, a CSS selector > engine for the Haskell XML Toolbox (HXT). Its main design goals are: > > * support as many CSS selectors as possible: it currently supports all > CSS 3 selectors except the ones that do not make sense outside a web > browser (e.g. such as :hover). For example, it supports weird things > like > > div > span + p:not(:nth-of-type(3n-1)) > > * try to be 100% correct: in all tests I ran, the output of > hxt-css was identical to that of firefox & chrome. > > * follow the conventions of other hxt packages: for > example, error reporting is done the same way as hxt-xpath. > > Note, there is already a similar package in hackage called HandsomeSoup. > > - Marios Can you explain how this differs from HandsomeSoup? -- Mateusz K. From redneb8888 at gmail.com Fri Oct 3 18:52:35 2014 From: redneb8888 at gmail.com (Marios Titas) Date: Fri, 3 Oct 2014 19:52:35 +0100 Subject: [Haskell-cafe] ANN: hxt-css 0.1.0.0, a CSS selector engine for HXT In-Reply-To: <542EED9D.4020100@fuuzetsu.co.uk> References: <542EED9D.4020100@fuuzetsu.co.uk> Message-ID: I wrote this a few years ago as part of bigger project. After examining HandsomeSoup, I found that it produces incorrect results in many cases (e.g. the > relation or the :first-child pseudo class do not work correctly, or sometimes it returns non element nodes which is not allowed by the css spec), it supports a more limited subset of CSS (than hxt-css) and has unrelated dependencies (such as HTTP). Since I had already written this code, I decided to release it as a stand alone package even though there was a similar package in hackage already. - Marios On Fri, Oct 3, 2014 at 7:40 PM, Mateusz Kowalczyk wrote: > On 10/03/2014 07:37 PM, Marios Titas wrote: >> Hello everybody, >> >> I'd like to announce the first public release of hxt-css, a CSS selector >> engine for the Haskell XML Toolbox (HXT). Its main design goals are: >> >> * support as many CSS selectors as possible: it currently supports all >> CSS 3 selectors except the ones that do not make sense outside a web >> browser (e.g. such as :hover). For example, it supports weird things >> like >> >> div > span + p:not(:nth-of-type(3n-1)) >> >> * try to be 100% correct: in all tests I ran, the output of >> hxt-css was identical to that of firefox & chrome. >> >> * follow the conventions of other hxt packages: for >> example, error reporting is done the same way as hxt-xpath. >> >> Note, there is already a similar package in hackage called HandsomeSoup. >> >> - Marios > > Can you explain how this differs from HandsomeSoup? > > > -- > Mateusz K. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From fuuzetsu at fuuzetsu.co.uk Fri Oct 3 19:19:24 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Fri, 03 Oct 2014 20:19:24 +0100 Subject: [Haskell-cafe] ANN: hxt-css 0.1.0.0, a CSS selector engine for HXT In-Reply-To: References: <542EED9D.4020100@fuuzetsu.co.uk> Message-ID: <542EF6BC.9080503@fuuzetsu.co.uk> On 10/03/2014 07:52 PM, Marios Titas wrote: > I wrote this a few years ago as part of bigger project. After > examining HandsomeSoup, I found that it produces incorrect results in > many cases (e.g. the > relation or the :first-child pseudo class do > not work correctly, or sometimes it returns non element nodes which is > not allowed by the css spec), it supports a more limited subset of CSS > (than hxt-css) and has unrelated dependencies (such as HTTP). Since I > had already written this code, I decided to release it as a stand > alone package even though there was a similar package in hackage > already. > > - Marios Cool, I was just wondering. I will consider switching to hxt-css next time I work on one of my projects using HandsomeSoup. I'm not a heavy user of it (in fact I try very hard to have as little to do with web things as possible) so I never noticed it behaved badly, good to know! > On Fri, Oct 3, 2014 at 7:40 PM, Mateusz Kowalczyk > wrote: >> On 10/03/2014 07:37 PM, Marios Titas wrote: >>> Hello everybody, >>> >>> I'd like to announce the first public release of hxt-css, a CSS selector >>> engine for the Haskell XML Toolbox (HXT). Its main design goals are: >>> >>> * support as many CSS selectors as possible: it currently supports all >>> CSS 3 selectors except the ones that do not make sense outside a web >>> browser (e.g. such as :hover). For example, it supports weird things >>> like >>> >>> div > span + p:not(:nth-of-type(3n-1)) >>> >>> * try to be 100% correct: in all tests I ran, the output of >>> hxt-css was identical to that of firefox & chrome. >>> >>> * follow the conventions of other hxt packages: for >>> example, error reporting is done the same way as hxt-xpath. >>> >>> Note, there is already a similar package in hackage called HandsomeSoup. >>> >>> - Marios >> >> Can you explain how this differs from HandsomeSoup? >> >> >> -- >> Mateusz K. >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe -- Mateusz K. From fuuzetsu at fuuzetsu.co.uk Fri Oct 3 19:43:19 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Fri, 03 Oct 2014 20:43:19 +0100 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) In-Reply-To: References: Message-ID: <542EFC57.5080303@fuuzetsu.co.uk> On 10/03/2014 07:37 PM, Iavor Diatchki wrote: > Hello, > > I am pleased to announce a new version of `graphmod`---a program that helps > you visualize the import dependencies between the modules in your Haskell > programs. > > The new feature in version 1.2.4 is support for pruning the dependency > graph, which is enabled with the flag -p or --prune-edges. When this > option is selected, `graphmod` will ignore imports to modules that are > already imported by some of the dependencies of the module. > > For example, consider the following modules: > > module A where { import B; import C } > module B where { import C } > module C where { } > > When generated with `--prune-edges`, the resulting graph will be: > > A -> B -> C > > Note that there is no edge from `A` to `C`, because `C` is already imported > by `B`. > > Happy hacking, > -Iavor > > Hi, It'd be great if the project page showed an example use and the generated graph. Does it work with possibly mutually-importing boot files? -- Mateusz K. From iavor.diatchki at gmail.com Sat Oct 4 00:33:51 2014 From: iavor.diatchki at gmail.com (Iavor Diatchki) Date: Fri, 3 Oct 2014 17:33:51 -0700 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) In-Reply-To: <542EFC57.5080303@fuuzetsu.co.uk> References: <542EFC57.5080303@fuuzetsu.co.uk> Message-ID: Hello, Good idea! I made a little web-page with examples and screenshots. Have a look: https://github.com/yav/graphmod/wiki Indeed, mutually-recursive modules are not a problem. There is an example of some mutually-recursive modules in the screen-shot from GHC's type-checker. By the way, I also added some support for modules that contains CPP, and improved the layout of the graphs a bit, so the current version is 1.2.5. Cheers, -Iavor On Fri, Oct 3, 2014 at 12:43 PM, Mateusz Kowalczyk wrote: > On 10/03/2014 07:37 PM, Iavor Diatchki wrote: > > Hello, > > > > I am pleased to announce a new version of `graphmod`---a program that > helps > > you visualize the import dependencies between the modules in your Haskell > > programs. > > > > The new feature in version 1.2.4 is support for pruning the dependency > > graph, which is enabled with the flag -p or --prune-edges. When this > > option is selected, `graphmod` will ignore imports to modules that are > > already imported by some of the dependencies of the module. > > > > For example, consider the following modules: > > > > module A where { import B; import C } > > module B where { import C } > > module C where { } > > > > When generated with `--prune-edges`, the resulting graph will be: > > > > A -> B -> C > > > > Note that there is no edge from `A` to `C`, because `C` is already > imported > > by `B`. > > > > Happy hacking, > > -Iavor > > > > > > Hi, > > It'd be great if the project page showed an example use and the > generated graph. > > Does it work with possibly mutually-importing boot files? > > > -- > Mateusz K. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bertram.felgenhauer at googlemail.com Sat Oct 4 06:52:14 2014 From: bertram.felgenhauer at googlemail.com (Bertram Felgenhauer) Date: Sat, 4 Oct 2014 08:52:14 +0200 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <542C75B9.2010303@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C75B9.2010303@gesh.uni.cx> Message-ID: <20141004065214.GA14453@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> Gesh wrote: > On 10/1/2014 10:49 PM, David Menendez wrote: > >How is that neither here nor there? Haskell says that types belong to > >classes, and each (type) instance of a class has a specific > >implementation. The fact that GHC implements this using dictionaries is > >irrelevant. It?s perfectly valid to implement type classes with partial > >evaluation, or matching on type parameters, or even C++-style templates. > > How is this point relevant? As far as I understand typeclasses enjoy > three properties: confluence, coherence and global uniqueness. > > These are defined as follows: > * Confluence: Constraint-solving always terminates with the same sets > of constraints on terms. > * Coherence: The same instance is always chosen for terms. > * Global uniqueness: For any type and typeclass, there exists at most > one instance of the typeclass for the type. > > What I suggested was to weaken global uniqueness to local uniqueness, > defined as: > * Local uniqueness: For any type and typeclass, in any scope there > exists at most one instance of the typeclass for > the type. > And a scope is a set of parallel bindings, introduced by a module > declaration, let expression or where clause. > > Since this only affects global uniqueness, I fail to see how concerns > about coherence being lost are relevant. I think there are different possible interpretations of coherence in the absence of global uniqueness. To me, correctness of Data.Set (which your proposal would break) relies solely on coherence, on the fact that the comparisons in its various functions always go the same way for any two given values. Global or local uniqueness should not matter; after all, the locations of those comparisons do not change. (Actually, ghc falls short of this ideal, see [1].) Put differently, I view global uniqueness as an ingredient for ensuring coherence in the case that instance selection is deferred to the caller. You seem to take the relaxed view that coherence is already satisfied if instance selection is deferred to the caller, even if different callers may select different instances for the same types. (-1 on the proposal from me.) Cheers, Bertram [1] https://ghc.haskell.org/trac/ghc/ticket/2356 From fuuzetsu at fuuzetsu.co.uk Sat Oct 4 07:34:55 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Sat, 04 Oct 2014 08:34:55 +0100 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) In-Reply-To: References: <542EFC57.5080303@fuuzetsu.co.uk> Message-ID: <542FA31F.3010500@fuuzetsu.co.uk> On 10/04/2014 01:33 AM, Iavor Diatchki wrote: > Hello, > > Good idea! I made a little web-page with examples and screenshots. Have a > look: > > https://github.com/yav/graphmod/wiki > > Indeed, mutually-recursive modules are not a problem. There is an example > of some mutually-recursive modules in the screen-shot from GHC's > type-checker. > > By the way, I also added some support for modules that contains CPP, and > improved the layout of the graphs a bit, so the current version is 1.2.5. > > Cheers, > -Iavor > > > That helped a lot. I packaged graphmod (and xdot) on NixOS. It graphviz kept segfaulting[2] on the file produced for Yi repository but in the end it worked after I added ?-p? to graphmod. Also --no-cluster view at [3]. Is there any plan for graphmod to do rendering itself, such as to PNG? I also wonder if there's any way to highlight cyclic paths, useful when trying to get rid of boot files. [1]: http://fuuzetsu.co.uk/images/1412407628.png [2]: libpath/shortest.c:324: triangulation failed libpath/shortest.c:192: source point not in any triangle Error: in routesplines, Pshortestpath failed out of memory [3]: http://fuuzetsu.co.uk/images/1412407805.png > > On Fri, Oct 3, 2014 at 12:43 PM, Mateusz Kowalczyk > wrote: > >> On 10/03/2014 07:37 PM, Iavor Diatchki wrote: >>> Hello, >>> >>> I am pleased to announce a new version of `graphmod`---a program that >> helps >>> you visualize the import dependencies between the modules in your Haskell >>> programs. >>> >>> The new feature in version 1.2.4 is support for pruning the dependency >>> graph, which is enabled with the flag -p or --prune-edges. When this >>> option is selected, `graphmod` will ignore imports to modules that are >>> already imported by some of the dependencies of the module. >>> >>> For example, consider the following modules: >>> >>> module A where { import B; import C } >>> module B where { import C } >>> module C where { } >>> >>> When generated with `--prune-edges`, the resulting graph will be: >>> >>> A -> B -> C >>> >>> Note that there is no edge from `A` to `C`, because `C` is already >> imported >>> by `B`. >>> >>> Happy hacking, >>> -Iavor >>> >>> >> >> Hi, >> >> It'd be great if the project page showed an example use and the >> generated graph. >> >> Does it work with possibly mutually-importing boot files? >> >> >> -- >> Mateusz K. >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -- Mateusz K. From ivan.miljenovic at gmail.com Sat Oct 4 08:04:19 2014 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Sat, 4 Oct 2014 18:04:19 +1000 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) In-Reply-To: <542FA31F.3010500@fuuzetsu.co.uk> References: <542EFC57.5080303@fuuzetsu.co.uk> <542FA31F.3010500@fuuzetsu.co.uk> Message-ID: On 4 October 2014 17:34, Mateusz Kowalczyk wrote: > On 10/04/2014 01:33 AM, Iavor Diatchki wrote: >> Hello, >> >> Good idea! I made a little web-page with examples and screenshots. Have a >> look: >> >> https://github.com/yav/graphmod/wiki >> >> Indeed, mutually-recursive modules are not a problem. There is an example >> of some mutually-recursive modules in the screen-shot from GHC's >> type-checker. >> >> By the way, I also added some support for modules that contains CPP, and >> improved the layout of the graphs a bit, so the current version is 1.2.5. >> >> Cheers, >> -Iavor >> >> >> > > That helped a lot. I packaged graphmod (and xdot) on NixOS. It graphviz > kept segfaulting[2] on the file produced for Yi repository but in the > end it worked after I added ?-p? to graphmod. Also --no-cluster view at [3]. > > Is there any plan for graphmod to do rendering itself, such as to PNG? I > also wonder if there's any way to highlight cyclic paths, useful when > trying to get rid of boot files. To do self-rendering, you would need to have a haskell implementation of a graph layout algorithm, and then a way to do the rendering (which could admittedly be done with digrams). > > [1]: http://fuuzetsu.co.uk/images/1412407628.png > [2]: > libpath/shortest.c:324: triangulation failed > libpath/shortest.c:192: source point not in any triangle > Error: in routesplines, Pshortestpath failed > out of memory > [3]: http://fuuzetsu.co.uk/images/1412407805.png > >> >> On Fri, Oct 3, 2014 at 12:43 PM, Mateusz Kowalczyk >> wrote: >> >>> On 10/03/2014 07:37 PM, Iavor Diatchki wrote: >>>> Hello, >>>> >>>> I am pleased to announce a new version of `graphmod`---a program that >>> helps >>>> you visualize the import dependencies between the modules in your Haskell >>>> programs. >>>> >>>> The new feature in version 1.2.4 is support for pruning the dependency >>>> graph, which is enabled with the flag -p or --prune-edges. When this >>>> option is selected, `graphmod` will ignore imports to modules that are >>>> already imported by some of the dependencies of the module. >>>> >>>> For example, consider the following modules: >>>> >>>> module A where { import B; import C } >>>> module B where { import C } >>>> module C where { } >>>> >>>> When generated with `--prune-edges`, the resulting graph will be: >>>> >>>> A -> B -> C >>>> >>>> Note that there is no edge from `A` to `C`, because `C` is already >>> imported >>>> by `B`. >>>> >>>> Happy hacking, >>>> -Iavor >>>> >>>> >>> >>> Hi, >>> >>> It'd be great if the project page showed an example use and the >>> generated graph. >>> >>> Does it work with possibly mutually-importing boot files? >>> >>> >>> -- >>> Mateusz K. >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> > > > -- > Mateusz K. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From nicola.gigante at gmail.com Sat Oct 4 09:57:16 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Sat, 4 Oct 2014 11:57:16 +0200 Subject: [Haskell-cafe] makeFields without lenses Message-ID: Good morning to everyone. I really love what makeFields from Control.Lens.TH does: generating a typeclasse HasXXX for each field _typeXXX and instances of the class for each type that has a record field with the same name. However, it generates lenses, which at this time I don?t use in my little project. I'll learn to use them well sooner or later, I promise! In the meantime, is there some module out there than provides a template haskell function that do the same thing but generating simple accessor functions instead of lenses? Or can I configure the parameters of makeFieldsWith to generate simple functions instead of lenses? Another related question: if I use makeFields in more than one module, and different records have fields with the same name, the generated typeclasses will have the same name but will be different, because declared twice in different modules, am I right? Is there a way to use a unique typeclass in the whole project for every generated field of the same name? Thank you very much, Nicola From edwards.benj at gmail.com Sat Oct 4 11:03:05 2014 From: edwards.benj at gmail.com (Benjamin Edwards) Date: Sat, 04 Oct 2014 04:03:05 -0700 (PDT) Subject: [Haskell-cafe] makeFields without lenses In-Reply-To: References: Message-ID: <1412420585667.d50a47e1@Nodemailer> The compiler automatically provides accessor functions already. You can't have more than one function with the same name in the same module without a qualified import. Ben On Sat, Oct 4, 2014 at 2:57 PM, Nicola Gigante wrote: > Good morning to everyone. > I really love what makeFields from > Control.Lens.TH does: generating > a typeclasse HasXXX for each > field _typeXXX and instances of the class > for each type that has a record field > with the same name. > However, it generates lenses, which > at this time I don?t use in my little project. > I'll learn to use them well sooner or later, > I promise! In the meantime, is there > some module out there than provides a > template haskell function that do the > same thing but generating simple accessor > functions instead of lenses? Or can I > configure the parameters of makeFieldsWith > to generate simple functions instead of > lenses? > Another related question: if I use makeFields > in more than one module, and different records > have fields with the same name, the generated > typeclasses will have the same name but will > be different, because declared twice in different > modules, am I right? Is there a way to use a unique > typeclass in the whole project for every generated > field of the same name? > Thank you very much, > Nicola > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.gigante at gmail.com Sat Oct 4 12:44:53 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Sat, 4 Oct 2014 14:44:53 +0200 Subject: [Haskell-cafe] makeFields without lenses In-Reply-To: <1412420585667.d50a47e1@Nodemailer> References: <1412420585667.d50a47e1@Nodemailer> Message-ID: Il giorno 04/ott/2014, alle ore 13:03, Benjamin Edwards ha scritto: > The compiler automatically provides accessor functions already. > You can't have more than one function with the same name in the same module without a qualified import. > Yes, that?s exactly the problem solved by makeFields. You declare the fields with a different name for each type but you get a lens with the same name for each type by declaring the suitable type class and instances. What I was asking is if is it possible to do the same generating simple functions instead of lenses. The functions generated by the compiler with the record syntax are not what I want, because the name must be unique for any single type. > Ben > Thanks, Nicola From mihai.maruseac at gmail.com Sat Oct 4 13:32:25 2014 From: mihai.maruseac at gmail.com (Mihai Maruseac) Date: Sat, 4 Oct 2014 09:32:25 -0400 Subject: [Haskell-cafe] Call for Contributions - Haskell Communities and Activities Report, November 2014 edition Message-ID: Dear all, We would like to collect contributions for the 27th edition of the ============================================================ Haskell Communities & Activities Report http://www.haskell.org/haskellwiki/Haskell_Communities_and_Activities_Report Submission deadline: 1 Nov 2014 (please send your contributions to hcar at haskell.org, in plain text or LaTeX format) ============================================================ This is the short story: * If you are working on any project that is in some way related to Haskell, please write a short entry and submit it. Even if the project is very small or unfinished or you think it is not important enough --- please reconsider and submit an entry anyway! * If you are interested in an existing project related to Haskell that has not previously been mentioned in the HCAR, please tell us, so that we can contact the project leaders and ask them to submit an entry. * Feel free to pass on this call for contributions to others that might be interested. More detailed information: The Haskell Communities & Activities Report is a bi-annual overview of the state of Haskell as well as Haskell-related projects over the last, and possibly the upcoming six months. If you have only recently been exposed to Haskell, it might be a good idea to browse the previous edition --- you will find interesting projects described as well as several starting points and links that may provide answers to many questions. Contributions will be collected until the submission deadline. They will then be compiled into a coherent report that is published online as soon as it is ready. As always, this is a great opportunity to update your webpages, make new releases, announce or even start new projects, or to talk about developments you want every Haskeller to know about! Looking forward to your contributions, Mihai Maruseac and Alejandro Serrano Mena FAQ: Q: What format should I write in? A: The required format is a LaTeX source file, adhering to the template that is available at: http://haskell.org/communities/11-2014/template.tex There is also a LaTeX style file at http://haskell.org/communities/11-2014/hcar.sty that you can use to preview your entry. If you do not know LaTeX, then use plain text. If you modify an old entry that you have written for an earlier edition of the report, you should soon receive your old entry as a template (provided we have your valid email address). Please modify that template, rather than using your own version of the old entry as a template. Q: Can I include Haskell code? A: Yes. Please use lhs2tex syntax (http://www.andres-loeh.de/lhs2tex/). The report is compiled in mode polycode.fmt. Q: Can I include images? A: Yes, you are even encouraged to do so. Please use .jpg format, then. Q: Should I send files in .zip archives or similar? A: No, plain file attachements are the way. Q: How much should I write? A: Authors are asked to limit entries to about one column of text. A general introduction is helpful. Apart from that, you should focus on recent or upcoming developments. Pointers to online content can be given for more comprehensive or "historic" overviews of a project. Images do not count towards the length limit, so you may want to use this opportunity to pep up entries. There is no minimum length of an entry! The report aims for being as complete as possible, so please consider writing an entry, even if it is only a few lines long. Q: Which topics are relevant? A: All topics which are related to Haskell in some way are relevant. We usually had reports from users of Haskell (private, academic, or commercial), from authors or contributors to projects related to Haskell, from people working on the Haskell language, libraries, on language extensions or variants. We also like reports about distributions of Haskell software, Haskell infrastructure, books and tutorials on Haskell. Reports on past and upcoming events related to Haskell are also relevant. Finally, there might be new topics we do not even think about. As a rule of thumb: if in doubt, then it probably is relevant and has a place in the HCAR. You can also simply ask us. Q: Is unfinished work relevant? Are ideas for projects relevant? A: Yes! You can use the HCAR to talk about projects you are currently working on. You can use it to look for other developers that might help you. Q: If I do not update my entry, but want to keep it in the report, what should I do? A: Tell us that there are no changes. The old entry will typically be reused in this case, but it might be dropped if it is older than a year, to give more room and more attention to projects that change a lot. Do not resend complete entries if you have not changed them. Q: Will I get confirmation if I send an entry? How do I know whether my email has even reached its destination, and not ended up in a spam folder? A: Prior to publication of the final report, we will send a draft to all contributors, for possible corrections. So if you do not hear from us within two weeks after the deadline, it is safer to send another mail and check whether your first one was received. -- Mihai Maruseac (MM) "If you don't know, the thing to do is not to get scared, but to learn." -- Atlas Shrugged. From allbery.b at gmail.com Sat Oct 4 13:53:26 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 4 Oct 2014 09:53:26 -0400 Subject: [Haskell-cafe] makeFields without lenses In-Reply-To: References: Message-ID: On Sat, Oct 4, 2014 at 5:57 AM, Nicola Gigante wrote: > However, it generates lenses, which > at this time I don?t use in my little project. > I'll learn to use them well sooner or later, > I promise! In the meantime, is there > some module out there than provides a > template haskell function that do the > same thing but generating simple accessor > functions instead of lenses? > Anything that does this creates lenses. That does not mean that they all create Control.Lens, though; a lens is a general abstraction, not a trademark. The simplest version, focused solely on this use case, is probably the fclabels package. Note that the reason they do what you need is that they are lenses. Simple accessors will conflict as you described. fclabels is still useful if you're only interested in lenses for record field accessors, though, since the full lens package is rather heavyweight in that case --- and as a bonus, you'll be getting a head start on the more general concept, without getting dropped into the deep end of the pool. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From iavor.diatchki at gmail.com Sat Oct 4 15:22:25 2014 From: iavor.diatchki at gmail.com (Iavor Diatchki) Date: Sat, 4 Oct 2014 08:22:25 -0700 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) In-Reply-To: References: <542EFC57.5080303@fuuzetsu.co.uk> <542FA31F.3010500@fuuzetsu.co.uk> Message-ID: Hello, Yeah, I've seen the crushes on large graphs too---looks like a bug in graphviz, perhaps we should report it. I have some code for laying out graphs using a force based algorithm, but graphiz does quite a lot (e.g., supports many different formats), so I don't have any immediate plans to write a render. My next task for `graphmod` is to implement `Cabal` support, so that you could easily visualize a package. Cheers, -Iavor On Sat, Oct 4, 2014 at 1:04 AM, Ivan Lazar Miljenovic < ivan.miljenovic at gmail.com> wrote: > On 4 October 2014 17:34, Mateusz Kowalczyk > wrote: > > On 10/04/2014 01:33 AM, Iavor Diatchki wrote: > >> Hello, > >> > >> Good idea! I made a little web-page with examples and screenshots. > Have a > >> look: > >> > >> https://github.com/yav/graphmod/wiki > >> > >> Indeed, mutually-recursive modules are not a problem. There is an > example > >> of some mutually-recursive modules in the screen-shot from GHC's > >> type-checker. > >> > >> By the way, I also added some support for modules that contains CPP, and > >> improved the layout of the graphs a bit, so the current version is > 1.2.5. > >> > >> Cheers, > >> -Iavor > >> > >> > >> > > > > That helped a lot. I packaged graphmod (and xdot) on NixOS. It graphviz > > kept segfaulting[2] on the file produced for Yi repository but in the > > end it worked after I added ?-p? to graphmod. Also --no-cluster view at > [3]. > > > > Is there any plan for graphmod to do rendering itself, such as to PNG? I > > also wonder if there's any way to highlight cyclic paths, useful when > > trying to get rid of boot files. > > To do self-rendering, you would need to have a haskell implementation > of a graph layout algorithm, and then a way to do the rendering (which > could admittedly be done with digrams). > > > > > [1]: http://fuuzetsu.co.uk/images/1412407628.png > > [2]: > > libpath/shortest.c:324: triangulation failed > > libpath/shortest.c:192: source point not in any triangle > > Error: in routesplines, Pshortestpath failed > > out of memory > > [3]: http://fuuzetsu.co.uk/images/1412407805.png > > > >> > >> On Fri, Oct 3, 2014 at 12:43 PM, Mateusz Kowalczyk < > fuuzetsu at fuuzetsu.co.uk> > >> wrote: > >> > >>> On 10/03/2014 07:37 PM, Iavor Diatchki wrote: > >>>> Hello, > >>>> > >>>> I am pleased to announce a new version of `graphmod`---a program that > >>> helps > >>>> you visualize the import dependencies between the modules in your > Haskell > >>>> programs. > >>>> > >>>> The new feature in version 1.2.4 is support for pruning the dependency > >>>> graph, which is enabled with the flag -p or --prune-edges. When > this > >>>> option is selected, `graphmod` will ignore imports to modules that are > >>>> already imported by some of the dependencies of the module. > >>>> > >>>> For example, consider the following modules: > >>>> > >>>> module A where { import B; import C } > >>>> module B where { import C } > >>>> module C where { } > >>>> > >>>> When generated with `--prune-edges`, the resulting graph will be: > >>>> > >>>> A -> B -> C > >>>> > >>>> Note that there is no edge from `A` to `C`, because `C` is already > >>> imported > >>>> by `B`. > >>>> > >>>> Happy hacking, > >>>> -Iavor > >>>> > >>>> > >>> > >>> Hi, > >>> > >>> It'd be great if the project page showed an example use and the > >>> generated graph. > >>> > >>> Does it work with possibly mutually-importing boot files? > >>> > >>> > >>> -- > >>> Mateusz K. > >>> _______________________________________________ > >>> Haskell-Cafe mailing list > >>> Haskell-Cafe at haskell.org > >>> http://www.haskell.org/mailman/listinfo/haskell-cafe > >>> > >> > > > > > > -- > > Mateusz K. > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From abela at chalmers.se Sat Oct 4 15:44:28 2014 From: abela at chalmers.se (Andreas Abel) Date: Sat, 4 Oct 2014 17:44:28 +0200 Subject: [Haskell-cafe] Several default implementations for instance methods Message-ID: <543015DC.8020506@chalmers.se> Consider the following class for an overloaded pretty printer. For atomic data (numeric types, String etc.) one would implement prettyShow, for complex data either pretty or prettyPrec. > import Text.PrettyPrint > > class Pretty a where > pretty :: a -> Doc > prettyShow :: a -> String > prettyPrec :: Int -> a -> Doc Implementing one of these methods should be enough, giving default implementations for the other two. It is easy to get prettyShow and prettyPrec from pretty. > prettyShow = render . pretty > prettyPrec = const . pretty However, to define pretty from one of the others, I need two default implementations. > pretty = text . prettyShow > pretty = prettyPrec 0 Is there a way to get this to work? Workarounds (not entirely satisfactory): Technically, one could define a cycle of default implementations. Alternative 1: > pretty = prettyPrec 0 > prettyShow = render . pretty > prettyPrec _ = text . prettyShow Problem: Here, if pretty is defined, > prettyPrec _ = text . render . pretty instead of just > prettyPrec _ = pretty and (text . render) is not the identity (destroys inner document structure). Alternative 2: > pretty = text . prettyShow > prettyShow = render . prettyPrec 0 > prettyPrec _ = pretty Problem: Here, if prettyPrec is defined, > pretty = text . render . prettyPrec 0 instead of just > pretty = prettyPrec 0 I guess alternative 2 is worse than alternative 1, as one would usually define prettyPrec to get pretty, and not the otherway round. But none of these two alternatives really does the job. -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www2.tcs.ifi.lmu.de/~abel/ From carter.schonwald at gmail.com Sat Oct 4 16:05:30 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 4 Oct 2014 12:05:30 -0400 Subject: [Haskell-cafe] Several default implementations for instance methods In-Reply-To: <543015DC.8020506@chalmers.se> References: <543015DC.8020506@chalmers.se> Message-ID: hrm, so youre wanting something even smarter than the MINIMAL pragma stuff, namely "depending on which subset of the complementary methods are defined, define this method differently"? On Sat, Oct 4, 2014 at 11:44 AM, Andreas Abel wrote: > Consider the following class for an overloaded pretty printer. For > atomic data (numeric types, String etc.) one would implement > prettyShow, for complex data either pretty or prettyPrec. > > > import Text.PrettyPrint > > > > class Pretty a where > > pretty :: a -> Doc > > prettyShow :: a -> String > > prettyPrec :: Int -> a -> Doc > > Implementing one of these methods should be enough, giving default > implementations for the other two. > > It is easy to get prettyShow and prettyPrec from pretty. > > > prettyShow = render . pretty > > prettyPrec = const . pretty > > However, to define pretty from one of the others, I need two default > implementations. > > > pretty = text . prettyShow > > pretty = prettyPrec 0 > > Is there a way to get this to work? > > Workarounds (not entirely satisfactory): Technically, one could define > a cycle of default implementations. Alternative 1: > > > pretty = prettyPrec 0 > > prettyShow = render . pretty > > prettyPrec _ = text . prettyShow > > Problem: Here, if pretty is defined, > > > prettyPrec _ = text . render . pretty > > instead of just > > > prettyPrec _ = pretty > > and (text . render) is not the identity (destroys inner document > structure). > > Alternative 2: > > > pretty = text . prettyShow > > prettyShow = render . prettyPrec 0 > > prettyPrec _ = pretty > > Problem: Here, if prettyPrec is defined, > > > pretty = text . render . prettyPrec 0 > > instead of just > > > pretty = prettyPrec 0 > > I guess alternative 2 is worse than alternative 1, as one would > usually define prettyPrec to get pretty, and not the otherway round. > But none of these two alternatives really does the job. > > -- > Andreas Abel <>< Du bist der geliebte Mensch. > > Department of Computer Science and Engineering > Chalmers and Gothenburg University, Sweden > > andreas.abel at gu.se > http://www2.tcs.ifi.lmu.de/~abel/ > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Sat Oct 4 16:17:40 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 4 Oct 2014 12:17:40 -0400 Subject: [Haskell-cafe] Several default implementations for instance methods In-Reply-To: References: <543015DC.8020506@chalmers.se> Message-ID: On Sat, Oct 4, 2014 at 12:05 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > hrm, so youre wanting something even smarter than the MINIMAL pragma > stuff, namely > "depending on which subset of the complementary methods are defined, > define this method differently"? > I've been expecting someone to ask for that ever since MINIMAL was floated.... (In fact I more than half expected MINIMAL to vanish under a bikeshed with that as its frame.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew.gibiansky at gmail.com Sat Oct 4 18:02:00 2014 From: andrew.gibiansky at gmail.com (Andrew Gibiansky) Date: Sat, 4 Oct 2014 11:02:00 -0700 Subject: [Haskell-cafe] makeFields without lenses In-Reply-To: References: Message-ID: Nicola, Could you be looking for the OverloadedRecordFields[0] extension? This is an extension that I *think* is slated to be in 7.10, and might do what you want (though won't help you now). If you declare two data types with the same field name (e.g. data A = A { hello :: Int} and data B = B { hello :: Int }), the extension will generate some typeclasses and type families so that you can use `hello` on both data types. (I haven't used this myself, but have been looking forward to it, so if anyone wants to correct me on anything I've said please do so.) [0] https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields On Sat, Oct 4, 2014 at 6:53 AM, Brandon Allbery wrote: > On Sat, Oct 4, 2014 at 5:57 AM, Nicola Gigante > wrote: > >> However, it generates lenses, which >> at this time I don?t use in my little project. >> I'll learn to use them well sooner or later, >> I promise! In the meantime, is there >> some module out there than provides a >> template haskell function that do the >> same thing but generating simple accessor >> functions instead of lenses? >> > > Anything that does this creates lenses. That does not mean that they all > create Control.Lens, though; a lens is a general abstraction, not a > trademark. The simplest version, focused solely on this use case, is > probably the fclabels package. > > Note that the reason they do what you need is that they are lenses. Simple > accessors will conflict as you described. fclabels is still useful if > you're only interested in lenses for record field accessors, though, since > the full lens package is rather heavyweight in that case --- and as a > bonus, you'll be getting a head start on the more general concept, without > getting dropped into the deep end of the pool. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Sat Oct 4 19:53:17 2014 From: danburton.email at gmail.com (Dan Burton) Date: Sat, 4 Oct 2014 12:53:17 -0700 Subject: [Haskell-cafe] makeFields without lenses In-Reply-To: References: Message-ID: > > is there > some module out there than provides a > template haskell function that do the > same thing but generating simple accessor > functions instead of lenses? Or can I > configure the parameters of makeFieldsWith > to generate simple functions instead of > lenses? There are none that I am aware of. I certainly don't think Control.Lens supports this. Another related question: if I use makeFields > in more than one module, and different records > have fields with the same name, the generated > typeclasses will have the same name but will > be different, because declared twice in different > modules, am I right? I believe this is correct. Is there a way to use a unique > typeclass in the whole project for every generated > field of the same name? If the typeclass already exists in the module, then it won't be generated. So if you are working on module B, and you import module A which exports the class in question, then I believe module B will just use the class from module A instead of creating its own. There are various helper functions in Control.Lens.TH, such as "makeClassyFor", which are meant to help with this. However, I don't think your use case is covered well by these helper functions. If you get in touch with the lens devs (file an issue in their github tracker, or chat with them on irc), I'm sure they can help you accomplish what you desire. n.b. lenses aren't all that scary. It is quite simple to retrieve the "simple accessor" from a lens. Just use "view". import Control.Lens.Getter (view) -- given this typeclass operation fooLens :: HasFoo a => Lens' a Foo -- just use view on it to extract the getter portion of the lens foo :: HasFoo a => a -> Foo foo = view fooLens -- Dan Burton On Sat, Oct 4, 2014 at 11:02 AM, Andrew Gibiansky < andrew.gibiansky at gmail.com> wrote: > Nicola, > > Could you be looking for the OverloadedRecordFields[0] extension? This is > an extension that I *think* is slated to be in 7.10, and might do what > you want (though won't help you now). > > If you declare two data types with the same field name (e.g. data A = A { > hello :: Int} and data B = B { hello :: Int }), the extension will generate > some typeclasses and type families so that you can use `hello` on both data > types. > > (I haven't used this myself, but have been looking forward to it, so if > anyone wants to correct me on anything I've said please do so.) > > [0] https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields > > On Sat, Oct 4, 2014 at 6:53 AM, Brandon Allbery > wrote: > >> On Sat, Oct 4, 2014 at 5:57 AM, Nicola Gigante >> wrote: >> >>> However, it generates lenses, which >>> at this time I don?t use in my little project. >>> I'll learn to use them well sooner or later, >>> I promise! In the meantime, is there >>> some module out there than provides a >>> template haskell function that do the >>> same thing but generating simple accessor >>> functions instead of lenses? >>> >> >> Anything that does this creates lenses. That does not mean that they all >> create Control.Lens, though; a lens is a general abstraction, not a >> trademark. The simplest version, focused solely on this use case, is >> probably the fclabels package. >> >> Note that the reason they do what you need is that they are lenses. >> Simple accessors will conflict as you described. fclabels is still useful >> if you're only interested in lenses for record field accessors, though, >> since the full lens package is rather heavyweight in that case --- and as a >> bonus, you'll be getting a head start on the more general concept, without >> getting dropped into the deep end of the pool. >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gesh at gesh.uni.cx Sat Oct 4 20:02:27 2014 From: gesh at gesh.uni.cx (Gesh) Date: Sat, 04 Oct 2014 23:02:27 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <20141004065214.GA14453@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C75B9.2010303@gesh.uni.cx> <20141004065214.GA14453@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> Message-ID: <54305253.4050807@gesh.uni.cx> On 10/4/2014 9:52 AM, Bertram Felgenhauer wrote: > I think there are different possible interpretations of coherence in the > absence of global uniqueness. To me, correctness of Data.Set (which your > proposal would break) relies solely on coherence, on the fact that the > comparisons in its various functions always go the same way for any two > given values. Global or local uniqueness should not matter; after all, > the locations of those comparisons do not change. (Actually, ghc falls > short of this ideal, see [1].) Put differently, I view global uniqueness > as an ingredient for ensuring coherence in the case that instance > selection is deferred to the caller. Please reread my definition of coherence. Admittedly, it is slightly too concise, but the way I define coherence is that no matter how you resolve constraints, the same instance is picked for each term. You seem to be defining coherence as meaning that no matter where a term appears, then if the same type is inferred for it the same instance will be picked. I fail to see how this does not require global uniqueness of instances, nor how the locations of the comparisons have anything to do with it. Just for clarification, the difference between our definitions is that under your definition, it seems that no matter where I see the term `'a' < 'b'`, it will reduce to `True`. However, under my definition, while the reduction is context-dependent, since > (let instance Ord Char where compare = flip (compare `on` ord) > in 'a' < 'b' > , 'a' < 'b') > == (False, True) the same instance will be chosen in both expressions - that is, the local one in the first element and the global one in the second - under any valid constraint resolver. > You seem to take the relaxed view that coherence is already satisfied if > instance selection is deferred to the caller, even if different callers > may select different instances for the same types. If what you're saying is that in my opinion, the above code is coherent, then I agree with your statement. Please, could you clarify your statements? Thanks, Gesh From carter.schonwald at gmail.com Sat Oct 4 20:09:57 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 4 Oct 2014 16:09:57 -0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <54305253.4050807@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C75B9.2010303@gesh.uni.cx> <20141004065214.GA14453@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> <54305253.4050807@gesh.uni.cx> Message-ID: At the end of the say, for any interesting type system changes, there's only one way to check soundness with confidence : (machine checked) proofs. For simple changes it suffices to formalize the rules, but this seems a bit more subtle. On Oct 4, 2014 4:03 PM, "Gesh" wrote: > On 10/4/2014 9:52 AM, Bertram Felgenhauer wrote: > >> I think there are different possible interpretations of coherence in the >> absence of global uniqueness. To me, correctness of Data.Set (which your >> proposal would break) relies solely on coherence, on the fact that the >> comparisons in its various functions always go the same way for any two >> given values. Global or local uniqueness should not matter; after all, >> the locations of those comparisons do not change. (Actually, ghc falls >> short of this ideal, see [1].) Put differently, I view global uniqueness >> as an ingredient for ensuring coherence in the case that instance >> selection is deferred to the caller. >> > Please reread my definition of coherence. Admittedly, it is slightly > too concise, but the way I define coherence is that no matter how you > resolve constraints, the same instance is picked for each term. > > You seem to be defining coherence as meaning that no matter where a term > appears, then if the same type is inferred for it the same instance will > be picked. I fail to see how this does not require global uniqueness of > instances, nor how the locations of the comparisons have anything to do > with it. > > Just for clarification, the difference between our definitions is that > under your definition, it seems that no matter where I see the term > `'a' < 'b'`, it will reduce to `True`. However, under my definition, > while the reduction is context-dependent, since > > (let instance Ord Char where compare = flip (compare `on` ord) > > in 'a' < 'b' > > , 'a' < 'b') > > == (False, True) > the same instance will be chosen in both expressions - that is, > the local one in the first element and the global one in the second > - under any valid constraint resolver. > > You seem to take the relaxed view that coherence is already satisfied if >> instance selection is deferred to the caller, even if different callers >> may select different instances for the same types. >> > If what you're saying is that in my opinion, the above code is > coherent, then I agree with your statement. > > Please, could you clarify your statements? > > Thanks, > > Gesh > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gesh at gesh.uni.cx Sat Oct 4 20:27:51 2014 From: gesh at gesh.uni.cx (Gesh) Date: Sat, 04 Oct 2014 23:27:51 +0300 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> <542D9B80.7000605@gesh.uni.cx> Message-ID: <54305847.9030304@gesh.uni.cx> On 10/2/2014 10:09 PM, Richard Eisenberg wrote: > On Oct 2, 2014, at 2:37 PM, Gesh wrote: >> On 10/2/2014 2:50 AM, Richard Eisenberg wrote: >>>> type family F a b >>>> type instance F a b = b >>>> >>>> oops :: F a b -> b >>>> oops = id >> >> >> Several things can be said about the above code. >> First and foremost, it seems unsafe to allow oops to even typecheck >> today. Suppose `F` did not have a catchall instance. Then the type >> `F a b` is morally equivalent to `forall a. a`, because we could >> create any instance we wished for `F`. Therefore, I would suggest >> that regardless of my original proposal being accepted, we only >> allow open type families in type signatures where they are either >> morally equivalent to closed type families (by having catchall >> instances) or where they appear as restrictions on more polymorphic >> values (such as `id :: F a b -> F a b`). Associated types would >> also be permitted if an instance of their typeclass were in scope. >> > > I'm sorry, but I don't understand the paragraph above at all. > You say below that "open type families with catchall instances > [such as F] are morally equivalent to closed type families" and you > say "we only allow open type families in type signatures where there > are morally equivalent to closed type families". So it seems `oops` > is OK. And I don't know what you're getting at by > "restrictions on more polymorphic values". > > Incidentally, as type family instances can *never* overlap, a type > family with a catchall instance must have only that one instance. > >> Second, as hinted above, open type families with catchall instances >> are morally equivalent to a closed type families, since no other >> instances can be added to them without overlapping with the catchall >> instance. Therefore, I also suggest that open type families with >> catchall clauses be considered closed. > > What does your last sentence mean? What do you mean by a type family > that is considered closed? > >> Finally, this case serves as an excellent example to show that if >> and when we add support for local closed type families, we must >> consider the local type family distinct from the global one. > > But I don't have a local type family. I have a local type family > instance. How can one instance be seen as distinct from another? > >> In particular, one >> won't be able to pass instances of the local families to functions >> expecting the global family without compromising type safety. > > Unlike class instances, type family instances do not form > dictionaries and are not passed around. Given that fact, I'm not > sure what you mean here. Looking at what I wrote, I'm sorry for spreading confusion. Basically, what I was trying to get at is the following: * There are only three type-safe ways of using instances of open type families: * As a specialization of a polymorphic function * If the open type family is an associated type and an appropriate instance is in scope * If all possible instances are known, i.e. no more instances can be defined without overlapping. This is only possible when there exists a catchall instance. (I thought that open type families could overlap, but had OverlappingInstances-like semantics. In either case, catchall instances eliminate all possibility of additional instances. This also explains my point above regarding "open type families considered closed", in that if we had OverlappingInstances semantics, it would make sense that a declaration like > type family Open a > type instance Open Foo = Bar > type instance Open a = a would be equivalent to the declaration > type family Open a where > Open Foo = Bar > Open a = a What I was suggesting was that these declarations be declared equivalent by fiat.) * The above example, if `F` is taken to be a closed type family and the declarations are modified accordingly, shows that in the event that we allow local closed type family declarations, then in order to keep things type-safe, the local type family and the global one may not be considered equal. Otherwise, `unsafeCoerce` would be possible. But upon further reflection, this point is quite trivial. Again, sorry for the confusion. I hope things are clearer now. Gesh From byorgey at gmail.com Sat Oct 4 22:08:37 2014 From: byorgey at gmail.com (Brent Yorgey) Date: Sat, 4 Oct 2014 18:08:37 -0400 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) In-Reply-To: References: <542EFC57.5080303@fuuzetsu.co.uk> <542FA31F.3010500@fuuzetsu.co.uk> Message-ID: Note that if you just want graphviz to do the layout, but do the rendering yourself, e.g. with diagrams, this is not too hard. This doesn't help with getting rid of the graphviz dependency, but it certainly helps with making nicer-looking graphs or with tweaking the visualization based on arbitrary criteria. Ivan's graphviz package allows for round-tripping a graph data structure through graphviz, and you get it back with location annotations; you can then draw it however you like. I actually did this for a couple figures in my dissertation. Perhaps at some point in the near future I will package up the code into a nice module in diagrams-contrib. -Brent On Sat, Oct 4, 2014 at 11:22 AM, Iavor Diatchki wrote: > Hello, > > Yeah, I've seen the crushes on large graphs too---looks like a bug in > graphviz, perhaps we should report it. > > I have some code for laying out graphs using a force based algorithm, but > graphiz does quite a lot (e.g., supports many different formats), so I > don't have any immediate plans to write a render. > > My next task for `graphmod` is to implement `Cabal` support, so that you > could easily visualize a package. > > Cheers, > -Iavor > > > > > On Sat, Oct 4, 2014 at 1:04 AM, Ivan Lazar Miljenovic < > ivan.miljenovic at gmail.com> wrote: > >> On 4 October 2014 17:34, Mateusz Kowalczyk >> wrote: >> > On 10/04/2014 01:33 AM, Iavor Diatchki wrote: >> >> Hello, >> >> >> >> Good idea! I made a little web-page with examples and screenshots. >> Have a >> >> look: >> >> >> >> https://github.com/yav/graphmod/wiki >> >> >> >> Indeed, mutually-recursive modules are not a problem. There is an >> example >> >> of some mutually-recursive modules in the screen-shot from GHC's >> >> type-checker. >> >> >> >> By the way, I also added some support for modules that contains CPP, >> and >> >> improved the layout of the graphs a bit, so the current version is >> 1.2.5. >> >> >> >> Cheers, >> >> -Iavor >> >> >> >> >> >> >> > >> > That helped a lot. I packaged graphmod (and xdot) on NixOS. It graphviz >> > kept segfaulting[2] on the file produced for Yi repository but in the >> > end it worked after I added ?-p? to graphmod. Also --no-cluster view at >> [3]. >> > >> > Is there any plan for graphmod to do rendering itself, such as to PNG? I >> > also wonder if there's any way to highlight cyclic paths, useful when >> > trying to get rid of boot files. >> >> To do self-rendering, you would need to have a haskell implementation >> of a graph layout algorithm, and then a way to do the rendering (which >> could admittedly be done with digrams). >> >> > >> > [1]: http://fuuzetsu.co.uk/images/1412407628.png >> > [2]: >> > libpath/shortest.c:324: triangulation failed >> > libpath/shortest.c:192: source point not in any triangle >> > Error: in routesplines, Pshortestpath failed >> > out of memory >> > [3]: http://fuuzetsu.co.uk/images/1412407805.png >> > >> >> >> >> On Fri, Oct 3, 2014 at 12:43 PM, Mateusz Kowalczyk < >> fuuzetsu at fuuzetsu.co.uk> >> >> wrote: >> >> >> >>> On 10/03/2014 07:37 PM, Iavor Diatchki wrote: >> >>>> Hello, >> >>>> >> >>>> I am pleased to announce a new version of `graphmod`---a program that >> >>> helps >> >>>> you visualize the import dependencies between the modules in your >> Haskell >> >>>> programs. >> >>>> >> >>>> The new feature in version 1.2.4 is support for pruning the >> dependency >> >>>> graph, which is enabled with the flag -p or --prune-edges. When >> this >> >>>> option is selected, `graphmod` will ignore imports to modules that >> are >> >>>> already imported by some of the dependencies of the module. >> >>>> >> >>>> For example, consider the following modules: >> >>>> >> >>>> module A where { import B; import C } >> >>>> module B where { import C } >> >>>> module C where { } >> >>>> >> >>>> When generated with `--prune-edges`, the resulting graph will be: >> >>>> >> >>>> A -> B -> C >> >>>> >> >>>> Note that there is no edge from `A` to `C`, because `C` is already >> >>> imported >> >>>> by `B`. >> >>>> >> >>>> Happy hacking, >> >>>> -Iavor >> >>>> >> >>>> >> >>> >> >>> Hi, >> >>> >> >>> It'd be great if the project page showed an example use and the >> >>> generated graph. >> >>> >> >>> Does it work with possibly mutually-importing boot files? >> >>> >> >>> >> >>> -- >> >>> Mateusz K. >> >>> _______________________________________________ >> >>> Haskell-Cafe mailing list >> >>> Haskell-Cafe at haskell.org >> >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >>> >> >> >> > >> > >> > -- >> > Mateusz K. >> > _______________________________________________ >> > Haskell-Cafe mailing list >> > Haskell-Cafe at haskell.org >> > http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> >> >> -- >> Ivan Lazar Miljenovic >> Ivan.Miljenovic at gmail.com >> http://IvanMiljenovic.wordpress.com >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agocorona at gmail.com Sun Oct 5 09:40:05 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Sun, 5 Oct 2014 11:40:05 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? Message-ID: Sorry if this has been asked/discussed previously It seems that there are many packages in which the documentation is not generated. That is the visible effect since there is no indication if the build process failed or not. Could anyone give me some hints? I did a lazy look at the hackage2 documentation but I found nothing about that. Only that it is possible to upload the documentation if the build bot fails... -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From t_gass at gmx.de Sun Oct 5 10:14:27 2014 From: t_gass at gmx.de (Tilmann) Date: Sun, 05 Oct 2014 12:14:27 +0200 Subject: [Haskell-cafe] Printing telnet stream to wx widget with conduit Message-ID: <54311A03.60008@gmx.de> Hi, I have this little program that works 'sometimes'. It is supposed to connect to a server via telnet and print the incoming text to a wx textwidget. Usually I get an error message: ChessGui: : hGetBufSome: illegal operation (handle is closed), but I acutally saw it working a few times... The whole thing is a bit out of my Haskell-league, so I?m a bit lost now. Any help is very appreciated! Best regards, Tilmann module Main where import Control.Concurrent (forkIO, killThread) import Control.Monad.IO.Class (MonadIO, liftIO) import Control.Monad.Trans.Resource import Data.Conduit import qualified Data.Conduit.Binary as CB import qualified Data.ByteString.Char8 as BS import Network (connectTo, PortID (..)) import System.IO import Graphics.UI.WX import Graphics.UI.WX.Types import Graphics.UI.WXCore.WxcDefs main = start gui gui = do f <- frame [] t <- textCtrlEx f (wxTE_MULTILINE .+. wxTE_RICH2) [font := fontFixed] e <- entry f [] set f [layout := boxed "console" (grid 5 5 [[floatLeft $ expand $ hstretch $ widget t] ,[expand $ hstretch $ widget e]])] telnet "freechess.org" 5000 t telnet :: String -> Int -> TextCtrl() -> IO () telnet host port t = runResourceT $ do (releaseSock, hsock) <- allocate (connectTo host $ PortNumber $ fromIntegral port) hClose liftIO $ mapM_ (`hSetBuffering` LineBuffering) [ hsock ] liftIO $ forkIO $ CB.sourceHandle hsock $$ (sink' t) return () sink' :: TextCtrl () -> Sink BS.ByteString IO () sink' textCtrl = do mstr <- await case mstr of Nothing -> return () Just str -> do text' <- liftIO $ (get textCtrl text) liftIO $ set textCtrl [text := text' ++ BS.unpack str ] sink' textCtrl From nicola.gigante at gmail.com Sun Oct 5 10:56:18 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Sun, 5 Oct 2014 12:56:18 +0200 Subject: [Haskell-cafe] makeFields without lenses In-Reply-To: References: Message-ID: Il giorno 04/ott/2014, alle ore 20:02, Andrew Gibiansky ha scritto: > Nicola, > > Could you be looking for the OverloadedRecordFields[0] extension? This is an extension that I think is slated to be in 7.10, and might do what you want (though won't help you now). > > If you declare two data types with the same field name (e.g. data A = A { hello :: Int} and data B = B { hello :: Int }), the extension will generate some typeclasses and type families so that you can use `hello` on both data types. > > (I haven't used this myself, but have been looking forward to it, so if anyone wants to correct me on anything I've said please do so.) > > [0] https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields Yes, that extension would be exactly what I want. When GHC 7.10 comes out I?ll use it for sure! In the meantime I hoped there was a package to overcome this but as Dan has said, it seems it doesn?t exist. Thank you everybody for all the answers. Greetings, Nicola -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Sun Oct 5 11:12:59 2014 From: michael at snoyman.com (Michael Snoyman) Date: Sun, 5 Oct 2014 14:12:59 +0300 Subject: [Haskell-cafe] Printing telnet stream to wx widget with conduit In-Reply-To: <54311A03.60008@gmx.de> References: <54311A03.60008@gmx.de> Message-ID: On Sun, Oct 5, 2014 at 1:14 PM, Tilmann wrote: > Hi, > I have this little program that works 'sometimes'. It is supposed to > connect to a server via telnet and print the incoming text to a wx > textwidget. Usually I get an error message: ChessGui: : > hGetBufSome: illegal operation (handle is closed), but I acutally saw it > working a few times... > The whole thing is a bit out of my Haskell-league, so I?m a bit lost now. > Any help is very appreciated! > > Best regards, > Tilmann > > > > module Main where > > import Control.Concurrent (forkIO, killThread) > import Control.Monad.IO.Class (MonadIO, liftIO) > import Control.Monad.Trans.Resource > import Data.Conduit > import qualified Data.Conduit.Binary as CB > import qualified Data.ByteString.Char8 as BS > import Network (connectTo, PortID (..)) > import System.IO > import Graphics.UI.WX > import Graphics.UI.WX.Types > import Graphics.UI.WXCore.WxcDefs > > main = start gui > > gui = do > f <- frame [] > t <- textCtrlEx f (wxTE_MULTILINE .+. wxTE_RICH2) [font := fontFixed] > e <- entry f [] > set f [layout := boxed "console" (grid 5 5 [[floatLeft $ expand $ hstretch > $ widget t] > ,[expand $ hstretch $ widget e]])] > telnet "freechess.org" 5000 t > > > telnet :: String -> Int -> TextCtrl() -> IO () > telnet host port t = runResourceT $ do > (releaseSock, hsock) <- allocate (connectTo host $ PortNumber $ > fromIntegral port) hClose > liftIO $ mapM_ (`hSetBuffering` LineBuffering) [ hsock ] > liftIO $ forkIO $ CB.sourceHandle hsock $$ (sink' t) > return () > > I don't know anything about wxwidgets, but I *do* see a problem here. You're using `allocate` to say "when this ResourceT block exits, call hClose on the Socket". You then take the socket and pass it to a new thread. That new thread tries to continue using that Socket, but the first thread's ResourceT block exits immediately, closing the Socket. You may want to instead try using resourceForkIO[1]. On a separate note, your usage of mapM_ isn't necessary in this case. You can make do with: liftIO $ hSetBuffering hsock LineBuffering [1] http://haddocks.fpcomplete.com/fp/7.8/20140916-162/resourcet/Control-Monad-Trans-Resource.html#v:resourceForkIO > sink' :: TextCtrl () -> Sink BS.ByteString IO () > sink' textCtrl = do > mstr <- await > case mstr of > Nothing -> return () > Just str -> do > text' <- liftIO $ (get textCtrl text) > liftIO $ set textCtrl [text := text' ++ BS.unpack str ] > sink' textCtrl > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t_gass at gmx.de Sun Oct 5 11:28:07 2014 From: t_gass at gmx.de (Tilmann) Date: Sun, 05 Oct 2014 13:28:07 +0200 Subject: [Haskell-cafe] Printing telnet stream to wx widget with conduit In-Reply-To: References: <54311A03.60008@gmx.de> Message-ID: <54312B47.5060108@gmx.de> Awesome! It works. Thank you very much for looking into it! Am 05.10.14 13:12, schrieb Michael Snoyman: > > > On Sun, Oct 5, 2014 at 1:14 PM, Tilmann > wrote: > > Hi, > I have this little program that works 'sometimes'. It is supposed > to connect to a server via telnet and print the incoming text to a > wx textwidget. Usually I get an error message: ChessGui: 22>: hGetBufSome: illegal operation (handle is closed), but I > acutally saw it working a few times... > The whole thing is a bit out of my Haskell-league, so I?m a bit > lost now. Any help is very appreciated! > > Best regards, > Tilmann > > > > module Main where > > import Control.Concurrent (forkIO, killThread) > import Control.Monad.IO.Class (MonadIO, liftIO) > import Control.Monad.Trans.Resource > import Data.Conduit > import qualified Data.Conduit.Binary as CB > import qualified Data.ByteString.Char8 as BS > import Network (connectTo, PortID (..)) > import System.IO > import Graphics.UI.WX > import Graphics.UI.WX.Types > import Graphics.UI.WXCore.WxcDefs > > main = start gui > > gui = do > f <- frame [] > t <- textCtrlEx f (wxTE_MULTILINE .+. wxTE_RICH2) [font := fontFixed] > e <- entry f [] > set f [layout := boxed "console" (grid 5 5 [[floatLeft $ expand $ > hstretch $ widget t] > ,[expand $ hstretch $ widget e]])] > telnet "freechess.org " 5000 t > > > telnet :: String -> Int -> TextCtrl() -> IO () > telnet host port t = runResourceT $ do > (releaseSock, hsock) <- allocate (connectTo host $ PortNumber $ > fromIntegral port) hClose > liftIO $ mapM_ (`hSetBuffering` LineBuffering) [ hsock ] > liftIO $ forkIO $ CB.sourceHandle hsock $$ (sink' t) > return () > > > I don't know anything about wxwidgets, but I *do* see a problem here. > You're using `allocate` to say "when this ResourceT block exits, call > hClose on the Socket". You then take the socket and pass it to a new > thread. That new thread tries to continue using that Socket, but the > first thread's ResourceT block exits immediately, closing the Socket. > You may want to instead try using resourceForkIO[1]. > > On a separate note, your usage of mapM_ isn't necessary in this case. > You can make do with: > > liftIO $ hSetBuffering hsock LineBuffering > > [1] > http://haddocks.fpcomplete.com/fp/7.8/20140916-162/resourcet/Control-Monad-Trans-Resource.html#v:resourceForkIO > > sink' :: TextCtrl () -> Sink BS.ByteString IO () > sink' textCtrl = do > mstr <- await > case mstr of > Nothing -> return () > Just str -> do > text' <- liftIO $ (get textCtrl text) > liftIO $ set textCtrl [text := text' ++ BS.unpack str ] > sink' textCtrl > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hamish.k.mackenzie at gmail.com Sun Oct 5 14:33:30 2014 From: hamish.k.mackenzie at gmail.com (Hamish Mackenzie) Date: Mon, 6 Oct 2014 03:33:30 +1300 Subject: [Haskell-cafe] Unable to build a mingw cross compiler. In-Reply-To: <20140823003814.21b7ddef@sven.bartscher> References: <20140823003814.21b7ddef@sven.bartscher> Message-ID: <4E627126-173C-42C1-967C-4107C8D872E3@gmail.com> Did you find a solution to this? On 23 Aug 2014, at 10:38, Sven Bartscher wrote: > Greetings, > > I'm trying to build GHC to cross compile to windows. > GCC and friends are in /usr/bin/x86_64-w64-mingw32-*, libraries and > headers are in /usr/x86_64-w64-mingw32/{include,lib}. > > I configured with: > ./configure --target=x86_64-w64-mingw32 \ > --with-gcc=/usr/bin/x86_64-w64-mingw32-gcc # Needed because > # otherwise /usr/bin/gcc > # would be used > > Building fails with the following error: > utils/hsc2hs/dist/build/Main.o: In function `s2nI_info': > (.text+0x5c5): undefined reference to `GetModuleFileNameW' > collect2: error: ld returned 1 exit status > > (The GHC invocation line is included in the attached file) > > So it seems that GHC either uses the wrong linker or invokes it with > the wrong search path. > However, the configure script detects the right linker > (/usr/bin/x86_64-w64-mingw32). > > Is this a bug, or a feature? > > System data: > OS: Debian jessie Linux/GNU i386 > Installed GHC (for bootstrapping): version 7.6.3 > GHC I'm trying to build: version 7.8.3 > > Regards > Sven > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From david.sorokin at gmail.com Sun Oct 5 16:14:46 2014 From: david.sorokin at gmail.com (David Sorokin) Date: Sun, 5 Oct 2014 20:14:46 +0400 Subject: [Haskell-cafe] ANN: Aivika 1.4 - simulation library Message-ID: Hi Cafe, I'm glad to announce version 1.4 of my simulation library Aivika. The main improvement is that the main package aivika[1] contains a new module now, which is destined for simplifying an export of simulation results. Also the module can print in a text form the results of simulation. It recognizes queues, servers, arrival timers as well as references, variables and ordinary simulation variables. All this can help you to work on the simulation model directly from terminal if you like it, although, as before, my library provides powerful charting components that can automatically plot charts, save the CSV files, gather statistics, build histograms and unite them all in a single HTML file that can be then observed in your favorite Internet browser. I believe that all this must simplify much the process of modeling, simulation and analysis. At least, the deviation charts (using the rule of 3 sigma) cannot be underestimated as a tool of sensitivity analysis for the Monte-Carlo simulation. Another improvement is that the main package aivika can be compiled to JavaScript with help of Haste. I didn't check yet how it works in the browser but the package itself can be installed with help of haste-inst. I think this is a very interesting direction as it allows creating online flight simulators using Aivika. I hope you will find this information helpful. Best regards, David Sorokin [1] http://hackage.haskell.org/package/aivika From spam at scientician.net Sun Oct 5 16:27:39 2014 From: spam at scientician.net (Bardur Arantsson) Date: Sun, 05 Oct 2014 18:27:39 +0200 Subject: [Haskell-cafe] Cryptographically secure random numbers? Message-ID: Hi all, I'm in a situation where I have to generate cryptographically secure random UUIDs, i.e. ones that cannot feasibly be guessed/predicted. Does anyone know what options there are in this space? Ideally, I'd like to fulfill as many of these points as possible: - Few big/complicated dependencies. - Avoid native C if possible (ditto for non-base dependencies). - Avoid RDRAND if possible. - Non-opaque UUID type. - Cross-platform if possible, but the main platform would be Linux. (Generating a UUID from a random stream would be trivial, so obviously a library for secure random numbers would be a-okay too.) Any suggestions? From nick.vanderweit at gmail.com Sun Oct 5 16:38:23 2014 From: nick.vanderweit at gmail.com (Nicholas Vanderweit) Date: Sun, 5 Oct 2014 11:38:23 -0500 Subject: [Haskell-cafe] Cryptographically secure random numbers? In-Reply-To: References: Message-ID: I've used this wrapper around the NaCl crypto library to generate random numbers: http://thoughtpolice.github.io/salt/ Nick On Sunday, October 5, 2014, Bardur Arantsson wrote: > Hi all, > > I'm in a situation where I have to generate cryptographically secure > random UUIDs, i.e. ones that cannot feasibly be guessed/predicted. > > Does anyone know what options there are in this space? > > Ideally, I'd like to fulfill as many of these points as possible: > > - Few big/complicated dependencies. > - Avoid native C if possible (ditto for non-base dependencies). > - Avoid RDRAND if possible. > - Non-opaque UUID type. > - Cross-platform if possible, but the main platform would be Linux. > > (Generating a UUID from a random stream would be trivial, so obviously a > library for secure random numbers would be a-okay too.) > > Any suggestions? > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.dubuisson at gmail.com Sun Oct 5 17:21:47 2014 From: thomas.dubuisson at gmail.com (Thomas DuBuisson) Date: Sun, 5 Oct 2014 10:21:47 -0700 Subject: [Haskell-cafe] Cryptographically secure random numbers? In-Reply-To: References: Message-ID: I've reviewed a few of the crypto RNGs on my blog: http://tommd.github.io/posts/RNG-Bench.html - DRBG (disclaimer: my package) Three generators, HMAC, Hash, and CTR. All standards based and all using the Crypto.Random class interface from crypto-api. - cprng-aes One generator, afaict its an ad hoc creation of the author. - intel-aes Another ad hoc creation, but its more straight-forward (AES in counter mode) and has impressive performance. > Ideally, I'd like to fulfill as many of these points as possible: > > - Few big/complicated dependencies. True for threse packages, though my DRBG package does pull in crypto-api. > - Avoid native C if possible (ditto for non-base dependencies). Avoid native C or avoid external C libraries? The DRBG generators could be paired with Adam's SHA package or Vincent's Haskell AES to give you a Haskell-only generator, but it will be slower than using the C implementations of AES or SHA2. This seems like a rather odd requirement. > - Avoid RDRAND if possible. That's about the seed and not the generator. The `entropy` package now produces data that is an xor of urandom (or Windows cryptapi) and RDRAND (when available). RDRAND can be completely disabled by a flag in the cabal. I'm not sure what the `crypto-random` package does here, which is the entropy source typically used by `cprng-aes`, but I'd avoid it just because its lack of referential transparency. > - Cross-platform if possible, but the main platform would be Linux. I think all of these are cross platform and in the past all the authors have been fairly responsive so send in any issues. Cheers Thomas From trebla at vex.net Sun Oct 5 22:27:12 2014 From: trebla at vex.net (Albert Y. C. Lai) Date: Sun, 05 Oct 2014 18:27:12 -0400 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: References: Message-ID: <5431C5C0.3050807@vex.net> On 14-10-05 05:40 AM, Alberto G. Corona wrote: > Sorry if this has been asked/discussed previously > > It seems that there are many packages in which the documentation is not > generated. That is the visible effect since there is no indication if > the build process failed or not. My recollection: One or two weeks ago, Hackage doc building was disabled because it was making the server really slow. (The same server had to serve you Hackage downloads. You don't want slow downloads.) It probably is still disabled. From allbery.b at gmail.com Mon Oct 6 00:30:00 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 5 Oct 2014 20:30:00 -0400 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <5431C5C0.3050807@vex.net> References: <5431C5C0.3050807@vex.net> Message-ID: On Sun, Oct 5, 2014 at 6:27 PM, Albert Y. C. Lai wrote: > My recollection: One or two weeks ago, Hackage doc building was disabled > because it was making the server really slow. (The same server had to serve > you Hackage downloads. You don't want slow downloads.) Wasbn't Hackage emergency relocated to a new server about a week ago? Possibly something is still not quite set up right --- or it copied over the settings from the old including docs being disabled, and nobody remembered to re-enable them. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlo at carlo-hamalainen.net Mon Oct 6 07:59:25 2014 From: carlo at carlo-hamalainen.net (Carlo Hamalainen) Date: Mon, 6 Oct 2014 07:59:25 +0000 Subject: [Haskell-cafe] Wreq: use basic auth and also change the response timeout Message-ID: <00000148e4785941-7d038c39-ad9a-4b19-beb4-52c754796559-000000@email.amazonses.com> Hi, I am using Wreq with basic authentication. I also want to change the response timeout. The following code compiles but the user authentication fails: import Network.HTTP.Client (defaultManagerSettings, managerResponseTimeout) opts = defaults & manager .~ Left (defaultManagerSettings { managerResponseTimeout = Just 3000000000 } ) & auth .~ basicAuth "user" "pass" Perhaps I'm not using the lens onto the manager correctly? If I use just opts = defaults & auth .~ basicAuth "user" "pass" then my program runs fine. But I need the longer timeout for some large downloads. Thanks, -- Carlo Hamalainen http://carlo-hamalainen.net From magnus at therning.org Mon Oct 6 10:22:06 2014 From: magnus at therning.org (Magnus Therning) Date: Mon, 6 Oct 2014 12:22:06 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <5431C5C0.3050807@vex.net> References: <5431C5C0.3050807@vex.net> Message-ID: <20141006102206.GA28531@mtcomp.evidente.local> On Sun, Oct 05, 2014 at 06:27:12PM -0400, Albert Y. C. Lai wrote: > On 14-10-05 05:40 AM, Alberto G. Corona wrote: > >Sorry if this has been asked/discussed previously > > > >It seems that there are many packages in which the documentation is not > >generated. That is the visible effect since there is no indication if > >the build process failed or not. > > My recollection: One or two weeks ago, Hackage doc building was disabled > because it was making the server really slow. (The same server had to serve > you Hackage downloads. You don't want slow downloads.) > > It probably is still disabled. Wasn't there also an announcement of the possibility of uploading generated docs where Hackage fails? Indeed: - http://fuuzetsu.co.uk/blog/posts/2014-01-06-Fix-your-Hackage-documentation.html - http://fuuzetsu.co.uk/blog/posts/2014-01-06-Hackage-documentation-v2.html Hopefully those two posts are still valid and useful. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Perl is another example of filling a tiny, short-term need, and then being a real problem in the longer term. -- Alan Kay -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From agocorona at gmail.com Mon Oct 6 11:18:30 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Mon, 6 Oct 2014 13:18:30 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <20141006102206.GA28531@mtcomp.evidente.local> References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> Message-ID: Thanks. Looking at the log, using the above links, mine has not been processed since it was uploaded at October 1 (there is no build log). https://hackage.haskell.org/package/haste-perch-0.1.0.4/reports/ According with the logs, there are packages that are not build since the end of September For example: http://hackage.haskell.org/package/haste-perch-0.1.0.4/reports/ It is not a question of documentation build, but the whole build process 2014-10-06 12:22 GMT+02:00 Magnus Therning : > On Sun, Oct 05, 2014 at 06:27:12PM -0400, Albert Y. C. Lai wrote: > > On 14-10-05 05:40 AM, Alberto G. Corona wrote: > > >Sorry if this has been asked/discussed previously > > > > > >It seems that there are many packages in which the documentation is not > > >generated. That is the visible effect since there is no indication if > > >the build process failed or not. > > > > My recollection: One or two weeks ago, Hackage doc building was disabled > > because it was making the server really slow. (The same server had to > serve > > you Hackage downloads. You don't want slow downloads.) > > > > It probably is still disabled. > > Wasn't there also an announcement of the possibility of uploading > generated docs where Hackage fails? > > Indeed: > > - > http://fuuzetsu.co.uk/blog/posts/2014-01-06-Fix-your-Hackage-documentation.html > - > http://fuuzetsu.co.uk/blog/posts/2014-01-06-Hackage-documentation-v2.html > > Hopefully those two posts are still valid and useful. > > /M > > -- > Magnus Therning OpenPGP: 0xAB4DFBA4 > email: magnus at therning.org jabber: magnus at therning.org > twitter: magthe http://therning.org/magnus > > Perl is another example of filling a tiny, short-term need, and then > being a real problem in the longer term. > -- Alan Kay > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carlo at carlo-hamalainen.net Mon Oct 6 12:34:06 2014 From: carlo at carlo-hamalainen.net (Carlo Hamalainen) Date: Mon, 6 Oct 2014 12:34:06 +0000 Subject: [Haskell-cafe] Wreq: use basic auth and also change the response timeout In-Reply-To: <00000148e4785941-7d038c39-ad9a-4b19-beb4-52c754796559-000000@email.amazonses.com> References: <00000148e4785941-7d038c39-ad9a-4b19-beb4-52c754796559-000000@email.amazonses.com> Message-ID: <00000148e573d4ef-ae9aaecb-592b-46e3-905f-e937ad638d95-000000@email.amazonses.com> On 06/10/14 09:59, Carlo Hamalainen wrote: > opts = defaults & manager .~ Left (defaultManagerSettings { > managerResponseTimeout = Just 3000000000 } ) > & auth .~ basicAuth "user" "pass" > > Perhaps I'm not using the lens onto the manager correctly? Sorry for the noise, the code I wrote above does work, I was running into problems due to my own configuration of a number of different development environments :-/ -- Carlo Hamalainen http://carlo-hamalainen.net From spam at scientician.net Mon Oct 6 14:21:17 2014 From: spam at scientician.net (Bardur Arantsson) Date: Mon, 06 Oct 2014 16:21:17 +0200 Subject: [Haskell-cafe] Cryptographically secure random numbers? In-Reply-To: References: Message-ID: On 2014-10-05 19:21, Thomas DuBuisson wrote: > I've reviewed a few of the crypto RNGs on my blog: > > http://tommd.github.io/posts/RNG-Bench.html > [--snip--] It looks like I have a little reading to do :). Thanks to both of you! Regards, From sean at functionaljobs.com Mon Oct 6 16:00:01 2014 From: sean at functionaljobs.com (Functional Jobs) Date: Mon, 6 Oct 2014 12:00:01 -0400 Subject: [Haskell-cafe] New Functional Programming Job Opportunities Message-ID: <5432bc83b3020@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Full Stack Functional Web Engineer at Front Row Education http://functionaljobs.com/jobs/8745-full-stack-functional-web-engineer-at-front-row-education Senior Software Engineer at McGraw-Hill Education http://functionaljobs.com/jobs/8744-senior-software-engineer-at-mcgraw-hill-education Cheers, Sean Murphy FunctionalJobs.com From eir at cis.upenn.edu Mon Oct 6 17:19:07 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Mon, 6 Oct 2014 13:19:07 -0400 Subject: [Haskell-cafe] Fwd: Increasing Haskell modularity In-Reply-To: <54305847.9030304@gesh.uni.cx> References: <542BFE49.6020306@gesh.uni.cx> <20867A9D-0FCE-4CB2-8156-2232366F65E1@cis.upenn.edu> <542C0FFD.6070303@gesh.uni.cx> <542C7AAF.2010501@gesh.uni.cx> <058950D2-6414-4C3F-BF20-CD8FFB405627@cis.upenn.edu> <542D9B80.7000605@gesh.uni.cx> <54305847.9030304@gesh.uni.cx> Message-ID: <995FAB6D-A536-4E11-BB3A-B6188E618D6A@cis.upenn.edu> On Oct 4, 2014, at 4:27 PM, Gesh wrote: > * There are only three type-safe ways of using instances of open type > families: > * As a specialization of a polymorphic function > * If the open type family is an associated type and an appropriate > instance is in scope > * If all possible instances are known, i.e. no more instances can be > defined without overlapping. This is only possible when there > exists a catchall instance. As far as I know, all uses of type families are (in 7.8) type-safe. I assume you mean "there are only three ways of using instances of open type families." Also, just to make the point clear: an open type family with a catchall instance *must* have only that one instance. For exactly the reasons I've been describing in this thread, *any* overlap among type family instances puts the type system in jeopardy. As a counter-example to your claim above about the allowable uses of open type families: > type family SwapIntBool a > type instance SwapIntBool Int = Bool > type instance SwapIntBool Bool = Int > > data G1 a where > MkG1Int :: G1 Int > MkG1Bool :: G1 Bool > > swapIntBool :: G1 a -> G1 (SwapIntBool a) > swapIntBool MkG1Int = MkG1Bool > swapIntBool MkG1Bool = MkG1Int This example may be contrived, but it follows the well-established pattern of using type families in concert with GADTs. I'll admit that it may seem that the type family could be closed, but it's also conceivable that the author of this code wants to allow `SwapIntBool` to be able to work with as-yet-unwritten types, in perhaps a GADT similar to G1 but with more constructors. > * The above example, if `F` is taken to be a closed type family and > the declarations are modified accordingly, shows that in the event > that we allow local closed type family declarations, then in order > to keep things type-safe, the local type family and the global one > may not be considered equal. Otherwise, `unsafeCoerce` would be > possible. > > But upon further reflection, this point is quite trivial. If by that, you mean that this is just a simple case of shadowing, then I agree. It still doesn't address local type instances, which seem at issue here. (For what it's worth, local closed type families would be great. In fact, all manner of local type-level definitions would be nice... except instances!) Richard From roma at ro-che.info Mon Oct 6 19:08:16 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Mon, 06 Oct 2014 22:08:16 +0300 Subject: [Haskell-cafe] Need help with scrap-your-boilerplate In-Reply-To: References: <542DC5BE.8000508@ro-che.info> Message-ID: <5432E8A0.4020805@ro-che.info> On 06/10/14 21:24, Michael Sperber wrote: > Would using a different generic-programming framework help me do this > without the unsafe stuff? Yes. For example, using my traverse-with-class library: {-# LANGUAGE TemplateHaskell, MultiParamTypeClasses, FlexibleInstances, ConstraintKinds, UndecidableInstances, ImplicitParams, OverlappingInstances #-} import Data.Generics.Traversable import Data.Generics.Traversable.TH import Data.Proxy data Foo a = Foo a deriveGTraversable ''Foo -- define a class around our generic operation class Bar b where bar :: b -> b -- default case instance Bar a where bar x = x -- Foo-specific case instance Bar (Foo a) where bar x = x -- deep traversal recursiveBar :: (Bar a, GTraversable (Rec Bar) a) => a -> a recursiveBar x = let ?c = Proxy :: Proxy Bar -- traversal with the Bar dictionary in everywhere bar x Roman From matteo.ferrando2 at gmail.com Tue Oct 7 02:57:08 2014 From: matteo.ferrando2 at gmail.com (Matteo Ferrando) Date: Mon, 6 Oct 2014 22:27:08 -0430 Subject: [Haskell-cafe] `zip` doesn't work with infinite `Seq`s Message-ID: Hello, We are writing a compiler[1] for a course and found that the `zip` function included in the `Data.Sequence` module, `zip :: Seq a -> Seq b -> Seq (a, b)` would hang on the following code: > -- using the `zip` from `Data.Sequence` > zip ys (fomList $ repeat x) We checked the implementation[2] in the source of `Data.Sequence` and found the following: > zip :: Seq a -> Seq b -> Seq (a, b) > zip = zipWith (,) > -- Here `zipWith` assumes *non-infinite `Seq`s* > zipWith :: (a -> b -> c) -> Seq a -> Seq b -> Seq c > zipWith f xs ys > | length xs <= length ys = zipWith' f xs ys > | otherwise = zipWith' (flip f) ys xs > -- Function not exported by `Data.Seq`, assumes `length xs <= length ys` > zipWith' :: (a -> b -> c) -> Seq a -> Seq b -> Seq c > zipWith' f xs ys = snd (mapAccumL k ys xs) > where > k kys x = case viewl kys of > (z :< zs) -> (zs, f x z) EmptyL -> error "zipWith': unexpected EmptyL" In the lazy reading of the documentation we did, we didn't find any warning of using infinite `Seq`s for zips. (Maybe there are warings that we didn't see). But looking at the code of `zip` in the `Prelude`: > zip :: [a] -> [b] -> [(a,b)] > zip (a:as) (b:bs) = (a,b) : zip as bs > zip _ _ = [] We see that we could just *pattern-match* both heads, instead of making assumptions. Maybe this should be better explained in the documentation[3] of `zip` for `Seq`s: > zip :: Seq a -> Seq b -> Seq (a, b) > O(min(n1,n2)). zip takes two sequences and returns a sequence of > corresponding pairs. If one input is short, excess elements are discarded > from the right end of the longer sequence. Or just change the implementation for it to work with infinite `Seq`s. For those of you who are curious, we ended up using the following code to fix the *infinite `Seq`s problem*: > -- using the `zip` from `Prelude` > zip (toList ys) (repeat x) [1] https://github.com/chamini2/sapphire [2] http://hackage.haskell.org/package/containers-0.5.5.1/docs/src/Data-Sequence.html#zip [3] http://hackage.haskell.org/package/containers-0.5.5.1/docs/Data-Sequence.html#v:zip -------------- next part -------------- An HTML attachment was scrubbed... URL: From lambda.fairy at gmail.com Tue Oct 7 03:27:30 2014 From: lambda.fairy at gmail.com (Chris Wong) Date: Tue, 7 Oct 2014 16:27:30 +1300 Subject: [Haskell-cafe] `zip` doesn't work with infinite `Seq`s In-Reply-To: References: Message-ID: Hi Matteo, Data.Sequence provides a general-purpose *finite* sequence. There is no such thing as an infinite Seq! In fact, you'll find that while head $ repeat 'a' results in 'a', Seq.head . Seq.fromList $ repeat 'a' never returns. Chris On Tue, Oct 7, 2014 at 3:57 PM, Matteo Ferrando wrote: > Hello, > > We are writing a compiler[1] for a course and found that the `zip` function > included in the `Data.Sequence` module, `zip :: Seq a -> Seq b -> Seq (a, > b)` would hang on the following code: > >> -- using the `zip` from `Data.Sequence` >> zip ys (fomList $ repeat x) > > We checked the implementation[2] in the source of `Data.Sequence` and found > the following: > >> zip :: Seq a -> Seq b -> Seq (a, b) >> zip = zipWith (,) > >> -- Here `zipWith` assumes *non-infinite `Seq`s* >> zipWith :: (a -> b -> c) -> Seq a -> Seq b -> Seq c >> zipWith f xs ys >> | length xs <= length ys = zipWith' f xs ys >> | otherwise = zipWith' (flip f) ys xs > >> -- Function not exported by `Data.Seq`, assumes `length xs <= length ys` >> zipWith' :: (a -> b -> c) -> Seq a -> Seq b -> Seq c >> zipWith' f xs ys = snd (mapAccumL k ys xs) >> where >> k kys x = case viewl kys of >> (z :< zs) -> (zs, f x z) > EmptyL -> error "zipWith': unexpected EmptyL" > > In the lazy reading of the documentation we did, we didn't find any warning > of using infinite `Seq`s for zips. (Maybe there are warings that we didn't > see). But looking at the code of `zip` in the `Prelude`: > >> zip :: [a] -> [b] -> [(a,b)] >> zip (a:as) (b:bs) = (a,b) : zip as bs >> zip _ _ = [] > > We see that we could just *pattern-match* both heads, instead of making > assumptions. > > Maybe this should be better explained in the documentation[3] of `zip` for > `Seq`s: > >> zip :: Seq a -> Seq b -> Seq (a, b) >> O(min(n1,n2)). zip takes two sequences and returns a sequence of >> corresponding pairs. If one input is short, excess elements are discarded >> from the right end of the longer sequence. > > Or just change the implementation for it to work with infinite `Seq`s. > > For those of you who are curious, we ended up using the following code to > fix the *infinite `Seq`s problem*: > >> -- using the `zip` from `Prelude` >> zip (toList ys) (repeat x) > > [1] https://github.com/chamini2/sapphire > [2] > http://hackage.haskell.org/package/containers-0.5.5.1/docs/src/Data-Sequence.html#zip > [3]http://hackage.haskell.org/package/containers-0.5.5.1/docs/Data-Sequence.html#v:zip > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From matteo.ferrando2 at gmail.com Tue Oct 7 03:49:13 2014 From: matteo.ferrando2 at gmail.com (Matteo Ferrando) Date: Mon, 6 Oct 2014 23:19:13 -0430 Subject: [Haskell-cafe] `zip` doesn't work with infinite `Seq`s In-Reply-To: References: Message-ID: Thanks to Chris and Sam for the explanation! That explains it. On Mon, Oct 6, 2014 at 10:57 PM, Chris Wong wrote: > Hi Matteo, > > Data.Sequence provides a general-purpose *finite* sequence. There is > no such thing as an infinite Seq! > > In fact, you'll find that while > > head $ repeat 'a' > > results in 'a', > > Seq.head . Seq.fromList $ repeat 'a' > > never returns. > > Chris > > On Tue, Oct 7, 2014 at 3:57 PM, Matteo Ferrando > wrote: > > Hello, > > > > We are writing a compiler[1] for a course and found that the `zip` > function > > included in the `Data.Sequence` module, `zip :: Seq a -> Seq b -> Seq (a, > > b)` would hang on the following code: > > > >> -- using the `zip` from `Data.Sequence` > >> zip ys (fomList $ repeat x) > > > > We checked the implementation[2] in the source of `Data.Sequence` and > found > > the following: > > > >> zip :: Seq a -> Seq b -> Seq (a, b) > >> zip = zipWith (,) > > > >> -- Here `zipWith` assumes *non-infinite `Seq`s* > >> zipWith :: (a -> b -> c) -> Seq a -> Seq b -> Seq c > >> zipWith f xs ys > >> | length xs <= length ys = zipWith' f xs ys > >> | otherwise = zipWith' (flip f) ys xs > > > >> -- Function not exported by `Data.Seq`, assumes `length xs <= length ys` > >> zipWith' :: (a -> b -> c) -> Seq a -> Seq b -> Seq c > >> zipWith' f xs ys = snd (mapAccumL k ys xs) > >> where > >> k kys x = case viewl kys of > >> (z :< zs) -> (zs, f x z) > > EmptyL -> error "zipWith': unexpected EmptyL" > > > > In the lazy reading of the documentation we did, we didn't find any > warning > > of using infinite `Seq`s for zips. (Maybe there are warings that we > didn't > > see). But looking at the code of `zip` in the `Prelude`: > > > >> zip :: [a] -> [b] -> [(a,b)] > >> zip (a:as) (b:bs) = (a,b) : zip as bs > >> zip _ _ = [] > > > > We see that we could just *pattern-match* both heads, instead of making > > assumptions. > > > > Maybe this should be better explained in the documentation[3] of `zip` > for > > `Seq`s: > > > >> zip :: Seq a -> Seq b -> Seq (a, b) > >> O(min(n1,n2)). zip takes two sequences and returns a sequence of > >> corresponding pairs. If one input is short, excess elements are > discarded > >> from the right end of the longer sequence. > > > > Or just change the implementation for it to work with infinite `Seq`s. > > > > For those of you who are curious, we ended up using the following code to > > fix the *infinite `Seq`s problem*: > > > >> -- using the `zip` from `Prelude` > >> zip (toList ys) (repeat x) > > > > [1] https://github.com/chamini2/sapphire > > [2] > > > http://hackage.haskell.org/package/containers-0.5.5.1/docs/src/Data-Sequence.html#zip > > [3] > http://hackage.haskell.org/package/containers-0.5.5.1/docs/Data-Sequence.html#v:zip > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lambda.fairy at gmail.com Tue Oct 7 03:49:14 2014 From: lambda.fairy at gmail.com (Chris Wong) Date: Tue, 7 Oct 2014 16:49:14 +1300 Subject: [Haskell-cafe] `zip` doesn't work with infinite `Seq`s In-Reply-To: References: Message-ID: > Data.Sequence provides a general-purpose *finite* sequence. There is > no such thing as an infinite Seq! > > In fact, you'll find that while > > head $ repeat 'a' > > results in 'a', > > Seq.head . Seq.fromList $ repeat 'a' > > never returns. To add to my previous comment: the key feature of Seq is constant-time access to both ends of the sequence. It does this by caching the the first and last few elements in the constructor. Given these constraints, the behavior you observe makes sense. To construct a Seq (as the call to fromList does), we must find the last element in the list so that we can cache it. But an infinite list doesn't have a last element (by definition). So fromList never terminates. I don't think there's a way to allow infinite sequences while also having efficient access to both ends. The Halting Problem probably comes into it somewhere. The solution you gave is likely the best one. Chris From carter.schonwald at gmail.com Tue Oct 7 04:29:27 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 7 Oct 2014 00:29:27 -0400 Subject: [Haskell-cafe] `zip` doesn't work with infinite `Seq`s In-Reply-To: References: Message-ID: the halting problem has nothing to do with it. Simply you can't cache the tail if no finite number of steps will get you there :) (halting problem style impossibility results tend to be wayyyy niftier) On Mon, Oct 6, 2014 at 11:49 PM, Chris Wong wrote: > > Data.Sequence provides a general-purpose *finite* sequence. There is > > no such thing as an infinite Seq! > > > > In fact, you'll find that while > > > > head $ repeat 'a' > > > > results in 'a', > > > > Seq.head . Seq.fromList $ repeat 'a' > > > > never returns. > > To add to my previous comment: the key feature of Seq is constant-time > access to both ends of the sequence. It does this by caching the the > first and last few elements in the constructor. > > Given these constraints, the behavior you observe makes sense. To > construct a Seq (as the call to fromList does), we must find the last > element in the list so that we can cache it. But an infinite list > doesn't have a last element (by definition). So fromList never > terminates. > > I don't think there's a way to allow infinite sequences while also > having efficient access to both ends. The Halting Problem probably > comes into it somewhere. The solution you gave is likely the best one. > > Chris > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Tue Oct 7 08:21:00 2014 From: michael at snoyman.com (Michael Snoyman) Date: Tue, 7 Oct 2014 11:21:00 +0300 Subject: [Haskell-cafe] New mailing list: haskell-wai Message-ID: After some discussion[1] on a Github issue, it became apparent that a number of people using WAI[2] could definitely benefit from having a shared discussion area. One obvious area of collaboration is discussing more efficient route dispatch algorithms, but there are likely many other topics worth discussing. Since none of the existing mailing lists seem appropriate for this, I've created a new mailing list: https://groups.google.com/d/forum/haskell-wai If you're using WAI- especially using it to write a web framework or coding applications directly against it, but even just indirectly via an existing framework- I'd highly recommend you join the discussion. [1] https://github.com/philopon/apiary-benchmark/pull/2 [2] http://hackage.haskell.org/package/wai -------------- next part -------------- An HTML attachment was scrubbed... URL: From redneb8888 at gmail.com Tue Oct 7 18:59:50 2014 From: redneb8888 at gmail.com (Marios Titas) Date: Tue, 7 Oct 2014 19:59:50 +0100 Subject: [Haskell-cafe] ANN: islink 0.1.0.0: check if an HTML element is a link (useful for web scraping) Message-ID: Hello everybody, I'd like to announce the first public release of islink. It's library that basically provides a list of combinations of HTML tag names and attributes that correspond to links to external resources. This includes things like ("a", "href"), ("img", "src"), ("script", "src") etc. It also comes with a convenience function to check if a particular pair (tag, attribute) corresponds to a link. This can be useful for web scraping. Here's an example how to use it to extract all (external) links from an HTML document (with the help of hxt): {-# LANGUAGE Arrows #-} import Text.Html.IsLink import Text.XML.HXT.Core -- returns a list of tuples containing the tag name, attribute name, -- attribute value of all links getAllLinks :: FilePath -> IO [(String, String, String)] getAllLinks path = runX $ doc >>> multi getLink where doc = readDocument [withParseHTML yes, withWarnings no] path getLink :: ArrowXml a => a XmlTree (String, String, String) getLink = proc node -> do tag <- getName -< node attrbNode <- getAttrl -< node attrb <- getName -< attrbNode val <- xshow getChildren -< attrbNode isLinkA -< (tag, attrb, val) where isLinkA = isLink `guardsP` this isLink (tag, attrb, _) = isLinkAttr tag attrb From ozataman at gmail.com Tue Oct 7 20:30:38 2014 From: ozataman at gmail.com (Ozgun Ataman) Date: Tue, 7 Oct 2014 16:30:38 -0400 Subject: [Haskell-cafe] Fingerprinting Haskell Objects Message-ID: Hello everybody, I have a little question I wanted to run by the folks here. I've run into it several times over the past few years and would love to lock down a good answer. What's the best way to "fingerprint" a Haskell object into, say, ByteString, so that this fingerprint can be used as the "lookup key" in a database (for example) and be trusted that it will remain constant over time even as the underlying libraries evolve? Here's a simple example: - Say I'm building a manual index on top of a key-value store (redis, dynamodb, etc.) - I want my keys to be arbitrary tuples (or similar records) that may contain various fields in them - I would like to avoid ad-hoc, hand-written MyTuple -> ByteString and ByteString -> MyTuple conversions. However, Generic derivations, template-haskell, etc. are acceptable - Notice how your fingerprint, which is used as a lookup key in the database, has to remain stationary. If it changes even by a single bit over time for the same MyTuple, the key-value store will NOT be able to find the index associated with MyTuple at this later time Here are some ideas (and related concepts) I've considered and used over the years: - Hand-write a "Prism' MyTuple ByteString". This works, but is tedious and error-prone. - Use Serialize/Binary and trust that the encode/decode pair will produce results consistently in 5 years (dangerous territory!) - Use SafeCopy, which is great for ensuring timeless decoding of the *value* in the index, but can we be sure that fingerprint (MyTuple -> ByteString) conversion is persistent? What if SafeCopy authors one day decide to encode tuples differently? They would write the migrations to transparently handle legacy code for *values*, but not for *keys*. Also notice here how migrations help with the ByteString -> MyTuple leg, but do not ensure MyTuple -> ByteString produces the same ByteString over time. - Hashable would've been nice, but there is NO guarantee of persistent results, even across multiple runs of the same code What would be your preferred solution? Thank you, Oz -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.kjeldaas at gmail.com Tue Oct 7 21:15:55 2014 From: alexander.kjeldaas at gmail.com (Alexander Kjeldaas) Date: Tue, 7 Oct 2014 23:15:55 +0200 Subject: [Haskell-cafe] Fingerprinting Haskell Objects In-Reply-To: References: Message-ID: Assuming the Generic instance is a stable interface, I would create a traversal of that, feeding directly into a Blake2b-implementation (a fast SHA3 finalist, tweaked). This gives you a cryptographically strong fingerprint, space usage is flexible (extract as many bytes as you want), is fast (~1GB/s), and with low complexity/external dependencies. Alexander On Tue, Oct 7, 2014 at 10:30 PM, Ozgun Ataman wrote: > Hello everybody, > > I have a little question I wanted to run by the folks here. I've run into > it several times over the past few years and would love to lock down a good > answer. > > What's the best way to "fingerprint" a Haskell object into, say, > ByteString, so that this fingerprint can be used as the "lookup key" in a > database (for example) and be trusted that it will remain constant over > time even as the underlying libraries evolve? > > Here's a simple example: > > - Say I'm building a manual index on top of a key-value store (redis, > dynamodb, etc.) > > - I want my keys to be arbitrary tuples (or similar records) that may > contain various fields in them > > - I would like to avoid ad-hoc, hand-written MyTuple -> ByteString and > ByteString -> MyTuple conversions. However, Generic derivations, > template-haskell, etc. are acceptable > > - Notice how your fingerprint, which is used as a lookup key in the > database, has to remain stationary. If it changes even by a single bit over > time for the same MyTuple, the key-value store will NOT be able to find the > index associated with MyTuple at this later time > > > Here are some ideas (and related concepts) I've considered and used over > the years: > > - Hand-write a "Prism' MyTuple ByteString". This works, but is tedious > and error-prone. > > - Use Serialize/Binary and trust that the encode/decode pair will > produce results consistently in 5 years (dangerous territory!) > > - Use SafeCopy, which is great for ensuring timeless decoding of the > *value* in the index, but can we be sure that fingerprint (MyTuple -> > ByteString) conversion is persistent? What if SafeCopy authors one day > decide to encode tuples differently? They would write the migrations to > transparently handle legacy code for *values*, but not for *keys*. Also > notice here how migrations help with the ByteString -> MyTuple leg, but do > not ensure MyTuple -> ByteString produces the same ByteString over time. > > - Hashable would've been nice, but there is NO guarantee of persistent > results, even across multiple runs of the same code > > What would be your preferred solution? > > Thank you, > Oz > > > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.gigante at gmail.com Tue Oct 7 21:25:20 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Tue, 7 Oct 2014 23:25:20 +0200 Subject: [Haskell-cafe] IO Exceptions through monad transformers stack Message-ID: <1C5A8E02-2A18-4D1A-8A7A-4FEE5D255C47@gmail.com> Hi, I?m not sure if this is the right list for ?base? questions like this, if there are any more specific lists please let me know. I?m writing a parser and it works in a stack of monad transformers defined in this way: type Parser = StateT ParserState (ExceptT ParserError IO) The base monad is IO because the parse could have the need to load other files included by the file that?s being parsed. The ExceptT transformer make it easy for the lexer and the parser to signal errors. At the end I have a runParser function that compose runExceptT and evalStateT and provides me with a nice Either that contains the parsed result or a value of type ParserError. The ParserError data type is the following: data ParserError = LexingError | ParsingError Currently, whenever the parser encounter an error I simply do throwError $ ParsingError something?, for example. What I would like to do is to report in this way also the possible IO errors that can occur, by adding a IOError constructor to the datatype above and having runParser return such a value if any operation on the underlying IO monad throws an exception. How can I do something like that? The root of the problem is that I still have to grasp how the IO exceptions relate to all the other ExceptT, ErrorT, MonadError, types and how all the functions like throwError, catchError, catch, try, and so on work together, in a stack of transformers. Any clarification or pointer would be very appreciated Thank you very much, Nicola From kyle.marek.spartz at gmail.com Tue Oct 7 22:21:34 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Tue, 7 Oct 2014 17:21:34 -0500 Subject: [Haskell-cafe] Fingerprinting Haskell Objects In-Reply-To: References: Message-ID: <72b40578-fcf8-42f7-96df-df4da08f52e2@highlander> I?m not sure hashing is what is desired due to the ByteString -> MyTuple conversion that was mentioned. ? Kyle Marek-Spartz On Oct 7, 2014, 4:15:55 PM, Alexander Kjeldaas wrote: Assuming the Generic instance is a stable interface, I would create a traversal of that, feeding directly into a Blake2b-implementation (a fast SHA3 finalist, tweaked). This gives you a cryptographically strong fingerprint, space usage is flexible (extract as many bytes as you want), is fast (~1GB/s), and with low complexity/external dependencies. Alexander -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.kjeldaas at gmail.com Tue Oct 7 22:28:08 2014 From: alexander.kjeldaas at gmail.com (Alexander Kjeldaas) Date: Wed, 8 Oct 2014 00:28:08 +0200 Subject: [Haskell-cafe] Fingerprinting Haskell Objects In-Reply-To: <72b40578-fcf8-42f7-96df-df4da08f52e2@highlander> References: <72b40578-fcf8-42f7-96df-df4da08f52e2@highlander> Message-ID: I think the two problems should be separated. MyTuple -> ByteString should have the properties that the encoding is stable and 1:1. ByteString -> MyTuple should have the property that old data is readable, but it does not need to be 1:1. So any library that supports backwards compatibility can be used for the ByteString -> MyTuple conversion, including SafeCopy. If SafeCopy implements a new, faster encoding, that does not affect this conversion. For a key/value store, the hash of the object can be used as key, and the SafeCopy serialization can be stored in the value together with whatever else is required. Alexander On Wed, Oct 8, 2014 at 12:21 AM, Kyle Marek-Spartz < kyle.marek.spartz at gmail.com> wrote: > I?m not sure hashing is what is desired due to the ByteString -> MyTuple > conversion that was mentioned. > > > ? > Kyle Marek-Spartz > > > > > > On Oct 7, 2014, 4:15:55 PM, Alexander Kjeldaas < > alexander.kjeldaas at gmail.com> wrote: > ------------------------------ > > Assuming the Generic instance is a stable interface, I would create a > traversal of that, feeding directly into a Blake2b-implementation (a fast > SHA3 finalist, tweaked). > > > This gives you a cryptographically strong fingerprint, space usage is > flexible (extract as many bytes as you want), is fast (~1GB/s), and with > low complexity/external dependencies. > > > Alexander > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nukasu.kanaka at gmail.com Tue Oct 7 22:44:33 2014 From: nukasu.kanaka at gmail.com (Nikita Volkov) Date: Wed, 8 Oct 2014 02:44:33 +0400 Subject: [Haskell-cafe] IO Exceptions through monad transformers stack In-Reply-To: <1C5A8E02-2A18-4D1A-8A7A-4FEE5D255C47@gmail.com> References: <1C5A8E02-2A18-4D1A-8A7A-4FEE5D255C47@gmail.com> Message-ID: Hi Nicola, Exceptions are a completely unrelated mechanism to all the monad transformers. Roughly speaking, it?s a dirty low level hack into Haskell?s type system. The error-transformer solutions on the other hand are just libraries, which utilize Haskell?s standard features. So there is no relation between the two, other then that they approach the same set of problems. Concerning your specific problem, the try function is there to help you. In your final solution you may utilize a function in the spirit of the following: data ParserError = IOError IOException | LexingError | ParsingError safeLiftIO :: IO a -> Parser a safeLiftIO io = liftIO (try io) >>= either (throwError . IOError) return Best regards, Nikita Volkov ? 2014-10-08 1:25 GMT+04:00 Nicola Gigante : > Hi, > > I?m not sure if this is the right list for ?base? questions like this, > if there are any more specific lists please let me know. > > I?m writing a parser and it works in a stack of monad transformers > defined in this way: > > type Parser = StateT ParserState (ExceptT ParserError IO) > > The base monad is IO because the parse could have the need to load > other files included by the file that?s being parsed. > > The ExceptT transformer make it easy for the lexer and the parser > to signal errors. At the end I have a runParser function that compose > runExceptT and evalStateT and provides me with a nice Either that > contains the parsed result or a value of type ParserError. > > The ParserError data type is the following: > > data ParserError = LexingError | ParsingError > > Currently, whenever the parser encounter an error I simply do > throwError $ ParsingError something?, for example. > > What I would like to do is to report in this way also the possible > IO errors that can occur, by adding a IOError constructor to the > datatype above and having runParser return such a value if > any operation on the underlying IO monad throws an exception. > > How can I do something like that? The root of the problem is that > I still have to grasp how the IO exceptions relate to all the other > ExceptT, ErrorT, MonadError, types and how all the functions like > throwError, catchError, catch, try, and so on work together, in a > stack of transformers. > > Any clarification or pointer would be very appreciated > > Thank you very much, > Nicola > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From donn at avvanta.com Wed Oct 8 00:08:05 2014 From: donn at avvanta.com (Donn Cave) Date: Tue, 7 Oct 2014 17:08:05 -0700 (PDT) Subject: [Haskell-cafe] IO Exceptions through monad transformers stack In-Reply-To: <1C5A8E02-2A18-4D1A-8A7A-4FEE5D255C47@gmail.com> References: <1C5A8E02-2A18-4D1A-8A7A-4FEE5D255C47@gmail.com> Message-ID: <20141008000805.04611F3936@mail.avvanta.com> quoth Nicola Gigante > I'm writing a parser and it works in a stack of monad transformers > defined in this way: > > type Parser = StateT ParserState (ExceptT ParserError IO) > > The base monad is IO because the parse could have the need to load > other files included by the file that's being parsed. ... > What I would like to do is to report in this way also the possible > IO errors that can occur, by adding a IOError constructor to the > datatype above and having runParser return such a value if > any operation on the underlying IO monad throws an exception. I don't have a real answer for your question, but I can tell you that I don't have this problem in my parser, even though it depends on I/O in a similar way. The need for more input data is just one of the errors or exceptions that it returns. So to use this parser, the application gets data by whatever means, such as input from a file, and applies the parser to it. The parser returns a parse result, a parse error, or an incomplete specifying the required input. The application gets that input and reapplies the parser ... etc. I have a sort of degenerate case of the problem, inasmuch as the stuff I'm parsing (IMAP4) is a one-liner expression that may be followed by a counted large data block - so the parsing per se is a very trivial computation and can simply be repeated on each iteration - and since the counted large data blocks aren't for the parser, I can copy them straight into a file, not into memory. Your application would likely be quite different. But in any case, in my opinion it's worth a little extra trouble to separate I/O from parsing, because it makes the parser more adaptable to circumstances the application might be equipped to deal with. Maybe for example, certain input needs a password? Who knows. And then it can do what it wants with IOError. Donn From joel.hermanns at gmail.com Wed Oct 8 07:18:37 2014 From: joel.hermanns at gmail.com (Joel Hermanns) Date: Wed, 8 Oct 2014 09:18:37 +0200 Subject: [Haskell-cafe] cabal sandbox: Can't load .so/.DLL for... Message-ID: Hi all, I have some trouble with cabal sandboxes. I used `cabal sandbox add-source` to add a library. When I add the library as a dependency for my project and try to build I?m always getting : can't load .so/.DLL for: /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib (dlopen(/Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib, 9): Symbol not found: _googlezmmapszm0zi1zi0zi0_WebziGoogleziMapsziInternal_queryAPI_closure Referenced from: /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib Expected in: flat namespace in /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib) I couldn?t find a solution so far. Anyone can help me? I?m using ghc-7.8.3 on OS X 10.9.5 and cabal-install version 1.20.0.3 using version 1.20.0.1 of the Cabal library. Thanks, Joel From nicola.gigante at gmail.com Wed Oct 8 09:12:42 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Wed, 8 Oct 2014 11:12:42 +0200 Subject: [Haskell-cafe] IO Exceptions through monad transformers stack In-Reply-To: References: <1C5A8E02-2A18-4D1A-8A7A-4FEE5D255C47@gmail.com> Message-ID: <94A909C1-745A-4185-AE5A-28C47BF54E77@gmail.com> Il giorno 08/ott/2014, alle ore 00:44, Nikita Volkov ha scritto: > Hi Nicola, > Hi! > Exceptions are a completely unrelated mechanism to all the monad transformers. Roughly speaking, it?s a dirty low level hack into Haskell?s type system. The error-transformer solutions on the other hand are just libraries, which utilize Haskell?s standard features. So there is no relation between the two, other then that they approach the same set of problems. > > Concerning your specific problem, the try function is there to help you. In your final solution you may utilize a function in the spirit of the following: > > data ParserError = > IOError IOException | LexingError | ParsingError > > safeLiftIO :: IO a -> Parser a > safeLiftIO io = > liftIO (try io) >>= either (throwError . IOError) return Thank you, this solves my problem. I understand that exceptions are a different mechanism from ExceptT and similar, but I?m still trying to understand how exceptions are supposed to be integrated with the other error handling mechanisms (or vice versa). Any pointers to better understand what components are involved and best practices for addressing this problems? > Best regards, > Nikita Volkov > > ? Thank you, Nicola -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug at cs.dartmouth.edu Wed Oct 8 12:28:05 2014 From: doug at cs.dartmouth.edu (Doug McIlroy) Date: Wed, 08 Oct 2014 08:28:05 -0400 Subject: [Haskell-cafe] type families with non-type indices Message-ID: <201410081228.s98CS54r011413@coolidge.cs.dartmouth.edu> Is there an analog or variant of type families that is indexed by values rather than by types? An example of such a family is integers mod p. One wants to define the operations once for all p, so that a type for any particular p can be introduced by a one-line declaration. Of course this can be done with p being a run-time parameter: data Modp = Modp Integer Int instance Num (Modp) where (Modp x p) + (Modp y q) = if p==q then Modp ((x+y) 'mod' p) p else error "unequal moduli in Modp operation" But it would be better to catch the error at compile time and not have to check at every operation. Doug From gesh at gesh.uni.cx Wed Oct 8 12:54:50 2014 From: gesh at gesh.uni.cx (Gesh) Date: Wed, 08 Oct 2014 15:54:50 +0300 Subject: [Haskell-cafe] type families with non-type indices In-Reply-To: <201410081228.s98CS54r011413@coolidge.cs.dartmouth.edu> References: <201410081228.s98CS54r011413@coolidge.cs.dartmouth.edu> Message-ID: <5435341A.3050307@gesh.uni.cx> On 2014-10-08 15:28, Doug McIlroy wrote: > Is there an analog or variant of type families that is indexed > by values rather than by types? It depends on what you want from your indices. If all you want is to lift values to types and back, then the 'reflection' package is what you want[0]. This suffices to define modulo-bearing numbers and local typeclass instances, for example. You might also want to look into the 'singletons' package[1], which to my understanding provides lifted functions and Template Haskell to lift values to the type level. However, I haven't investigated this package in any depth, so take this paragraph with a grain of salt. HTH, Gesh [0] - https://hackage.haskell.org/package/reflection [1] - https://hackage.haskell.org/package/singletons From carter.schonwald at gmail.com Wed Oct 8 13:29:50 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 8 Oct 2014 09:29:50 -0400 Subject: [Haskell-cafe] cabal sandbox: Can't load .so/.DLL for... In-Reply-To: References: Message-ID: Is your ~/.cabal/config file from pre 1.18 era? Sounds like the dylibs aren't being built. On Oct 8, 2014 3:19 AM, "Joel Hermanns" wrote: > Hi all, > > I have some trouble with cabal sandboxes. I used `cabal sandbox > add-source` to add a library. When I add the library as a dependency for my > project and try to build I?m always getting > > : can't load .so/.DLL for: > /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib > (dlopen(/Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib, > 9): Symbol not found: > _googlezmmapszm0zi1zi0zi0_WebziGoogleziMapsziInternal_queryAPI_closure > Referenced from: > /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib > Expected in: flat namespace > in > /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib) > > I couldn?t find a solution so far. Anyone can help me? > > I?m using ghc-7.8.3 on OS X 10.9.5 and cabal-install version 1.20.0.3 > using version 1.20.0.1 of the Cabal library. > > Thanks, > Joel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joel.hermanns at gmail.com Wed Oct 8 13:46:21 2014 From: joel.hermanns at gmail.com (Joel Hermanns) Date: Wed, 8 Oct 2014 15:46:21 +0200 Subject: [Haskell-cafe] cabal sandbox: Can't load .so/.DLL for... In-Reply-To: References: Message-ID: <249D1072-A45F-43F2-8C6B-47535F8FE1DE@gmail.com> I figured out that I forgot to add to module to `exposed-modules`. Now it works? Sorry for the noise. On 08 Oct 2014, at 15:29, Carter Schonwald wrote: > Is your ~/.cabal/config file from pre 1.18 era? Sounds like the dylibs aren't being built. > > On Oct 8, 2014 3:19 AM, "Joel Hermanns" wrote: > Hi all, > > I have some trouble with cabal sandboxes. I used `cabal sandbox add-source` to add a library. When I add the library as a dependency for my project and try to build I?m always getting > > : can't load .so/.DLL for: /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib (dlopen(/Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib, 9): Symbol not found: _googlezmmapszm0zi1zi0zi0_WebziGoogleziMapsziInternal_queryAPI_closure > Referenced from: /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib > Expected in: flat namespace > in /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib) > > I couldn?t find a solution so far. Anyone can help me? > > I?m using ghc-7.8.3 on OS X 10.9.5 and cabal-install version 1.20.0.3 using version 1.20.0.1 of the Cabal library. > > Thanks, > Joel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Oct 8 14:47:58 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 8 Oct 2014 10:47:58 -0400 Subject: [Haskell-cafe] cabal sandbox: Can't load .so/.DLL for... In-Reply-To: <249D1072-A45F-43F2-8C6B-47535F8FE1DE@gmail.com> References: <249D1072-A45F-43F2-8C6B-47535F8FE1DE@gmail.com> Message-ID: No, its fine! Forgetting to list all your exposed modules Is the leading cause of crazy linker errors! On Oct 8, 2014 9:46 AM, "Joel Hermanns" wrote: > I figured out that I forgot to add to module to `exposed-modules`. Now it > works? > > Sorry for the noise. > On 08 Oct 2014, at 15:29, Carter Schonwald > wrote: > > Is your ~/.cabal/config file from pre 1.18 era? Sounds like the dylibs > aren't being built. > On Oct 8, 2014 3:19 AM, "Joel Hermanns" wrote: > >> Hi all, >> >> I have some trouble with cabal sandboxes. I used `cabal sandbox >> add-source` to add a library. When I add the library as a dependency for my >> project and try to build I?m always getting >> >> : can't load .so/.DLL for: >> /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib >> (dlopen(/Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib, >> 9): Symbol not found: >> _googlezmmapszm0zi1zi0zi0_WebziGoogleziMapsziInternal_queryAPI_closure >> Referenced from: >> /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib >> Expected in: flat namespace >> in >> /Users/joel/workspace/haskell/bookingsystem/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.3/google-maps-0.1.0.0/libHSgoogle-maps-0.1.0.0-ghc7.8.3.dylib) >> >> I couldn?t find a solution so far. Anyone can help me? >> >> I?m using ghc-7.8.3 on OS X 10.9.5 and cabal-install version 1.20.0.3 >> using version 1.20.0.1 of the Cabal library. >> >> Thanks, >> Joel >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew at operationaldynamics.com Thu Oct 9 01:26:05 2014 From: andrew at operationaldynamics.com (Andrew Cowie) Date: Thu, 09 Oct 2014 12:26:05 +1100 Subject: [Haskell-cafe] Jop opening: web developers (with a taste for Haskell!) at Anchor Message-ID: <1412817965.14224.2.camel@operationaldynamics.com> ?Web Developers and Web Designers ================================ The engineering department at Anchor is building the analytics capabilities, internal systems, cloud infrastructure, deployment tooling, and operations practices that will be needed to take the company to the next level. These things all need front-ends. It goes without saying that the web is the platform for bringing new products to market, but we're a hosting company; most of our staff are operations-focused and our customers are too. What they really want are better tools to manipulate infrastructure. And even though Real Sysadmins? prefer command-line tools (we build those too) there's still the need to cleanly present and visualize information, and the web is the place to do that. Haskell is the working language for internal development; the benefits of type safety, resilience when refactoring, and stability over time added to the power of functional programming has already paid dividends. An open question is how far we can push strongly-typed functional programming out to the edge. JavaScript is unavoidable browser-side, but does it need to be written by hand? The plethora of alt-js implementations clearly say ?no!?, but _they_ all seem to force you into contortions. If you're going to be working in something other than JavaScript, then why not a real language? Having the codebase be common on both sides of the network would really be something; are haste or ghcjs up to the challenge? It's an exciting time. We have every intention of changing the hosting industry to make developing applications ? and operating them at scale ? easier for people facing massive growth. Interested in helping? Requirements ------------ A solid knowledge of HTML, JavaScript, and CSS is a prerequisite, obviously. Experience with ? and hatred of ? a number of different server-side frameworks (hack 'n slash PHP, enterprisey JSP, hipster RoR, unmaintainable PyThings, etc) is necessary to give you an appropriately jaded outlook on just how hard the web problem is. Understanding (or at least strong opinions about) how to build sites where content and presentation, design and implementation are separated is paramount. Can your designers make it beautiful without needing to run the entire stack? Can your systems developers improve performance without needing to run the website to find out if it works? Exposure to the harsh realities of IT operations and experience of the thrill of Linux systems administration will stand you in good stead. Knowledge of the history, progress, and problems in configuration management will be helpful. Familiarity with open source development practices, and the ability to tolerate other people refactoring your code is something we'll want you to demonstrate. Experience programming in Haskell would be a definite asset. We need to see a track record of working well in the open (regardless of language or project). Good documentation is as important as good code, and command of written English is necessary both to collaborate with your peers and to describe and promote your results. A Bachelor's in science, engineering, or computational biology will be well thought of. Your specific field of study doesn't matter, but how you've used computing to solve problems in your chosen field does. A degree in engineering will be a distinct plus. An undergraduate degree in computer science will not be held against you (much). Applying -------- Anchor Systems, based in Sydney Australia, has successfully been providing managed hosting and infrastructure to clients around the world for almost 15 years. The critical difference in the service we offer our customers often boils down to providing operations expertise and infrastructure configuration balancing the short term needs to get a new installation running with the long term imperatives of security, scalability, and flexibility. If you're interested in applying, send a PDF copy of your CV to , along with the URL to your GitHub account. We also invite you to include a pointer to something that shows you in a good light: a mailing list thread where you argued a contentious position, a piece of particularly thorny code in which you found an elegant solution to a problem, or even an essay or article you've written. We don't do international relocations (sorry everyone who wants to work remotely from Hawaii; I all want to work remotely from Hawaii too), but we are willing to sponsor work visas for new hires. So whether you've just moved to Australia or have been here for generations, give us a shout next time you're in Sydney. AfC Sydney -- Andrew Frederick Cowie Head of Engineering Anchor Systems https://twitter.com/afcowie https://github.com/anchor/ https://www.anchor.com.au/ From thoth_amon at mac.com Thu Oct 9 03:01:42 2014 From: thoth_amon at mac.com (Steven Arnold) Date: Wed, 08 Oct 2014 21:01:42 -0600 Subject: [Haskell-cafe] Looking for a Google Hangouts tutor/advisor on Haskell Message-ID: <2FDC986A-0B52-4FEC-AA75-C3C278936D94@mac.com> I am looking for a Haskell developer who can review my code, suggest improvements, and generally help me become a better Haskell programmer more quickly. As such, you should be very proficient with Haskell yourself. Maybe you do Haskell work professionally; maybe you have contributed to a couple open-source projects, maybe you're a well-known Haskell blogger, writer or teacher. I am a beginner, although I have been programming professionally for many years. I do have a basic foundation in functional programming languages, including Haskell, but most of my background is with dynamic languages like Ruby and Python. I'm thinking we would meet once a week on a Google Hangout (or other technology) for an hour or so and I'd show you my code and have you review it. (Take it away and mark it up if you want.) I'd ask questions and we can discuss them. You can tell me about anything you think I might need to know to be more effective. I might also email questions to you or ask for more time than described above. You would help me as your schedule allows. (I understand you no doubt have a day job.) I am willing to pay for your time. Please let me know your hourly rate. I can compensate you with Paypal, a check....whatever works. Please feel free to contact me off-list if you're interested in helping. Thanks for taking the time to read this. Best Regards, steven From ozataman at gmail.com Thu Oct 9 03:16:18 2014 From: ozataman at gmail.com (Ozgun Ataman) Date: Wed, 8 Oct 2014 23:16:18 -0400 Subject: [Haskell-cafe] Fingerprinting Haskell Objects In-Reply-To: References: Message-ID: On Tue, Oct 7, 2014 at 5:15 PM, Alexander Kjeldaas < alexander.kjeldaas at gmail.com> wrote: > > Assuming the Generic instance is a stable interface, I would create a > traversal of that, feeding directly into a Blake2b-implementation (a fast > SHA3 finalist, tweaked). > > > This gives you a cryptographically strong fingerprint, space usage is > flexible (extract as many bytes as you want), is fast (~1GB/s), and with > low complexity/external dependencies. > > > Alexander > Thank you for the reply. My own thinking has been along similar lines of finding a stable serialization for the record. Hashing is certainly a nice way to compress the result - one I've used myself in the past. However, can we really consider Generic a stable interface? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstcruz at gmail.com Thu Oct 9 04:07:13 2014 From: dstcruz at gmail.com (Daniel Santa Cruz) Date: Wed, 8 Oct 2014 22:07:13 -0600 Subject: [Haskell-cafe] Haskell Weekly News: Issue 309 Message-ID: Welcome to issue 309 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from September 28 to October 4, 2014 Quotes of the Week * Uh... I'ma have to read the IRC logs... No good quotes @remember'd Top Reddit Stories * Announcing needle: ASCII-fied arrow notation Domain: scrambledeggsontoast.github.io, Score: 103, Comments: 119 Original: [1] http://goo.gl/wCPh8K On Reddit: [2] http://goo.gl/UwTJSt * How we might abolish Cabal Hell, part 1 Domain: well-typed.com, Score: 95, Comments: 69 Original: [3] http://goo.gl/N19hPq On Reddit: [4] http://goo.gl/CQQRF0 * After some failed attempts to learn Parsec I came across this incredibly patient tutorial and now I'm writing parsers! Domain: github.com, Score: 79, Comments: 17 Original: [5] http://goo.gl/msqtkb On Reddit: [6] http://goo.gl/p3EgqQ * Neil Mitchell's Haskell Blog: Why Traversable/Foldable should not be in the Prelude Domain: neilmitchell.blogspot.co.il, Score: 71, Comments: 289 Original: [7] http://goo.gl/sykNse On Reddit: [8] http://goo.gl/4wIxBX * Tutorial: Implementing highly efficient data structures with Monoids and Fingertrees Domain: codementor.io, Score: 47, Comments: 37 Original: [9] http://goo.gl/WB7Jwg On Reddit: [10] http://goo.gl/jGrLX1 * There is No Haskell Topology Domain: immanence.org, Score: 45, Comments: 32 Original: [11] http://goo.gl/JAoEDw On Reddit: [12] http://goo.gl/wuuF4i * Introduction to Low Level Haskell Optimization - Dan Doel Domain: youtu.be, Score: 44, Comments: 2 Original: [13] http://goo.gl/vYS1Hy On Reddit: [14] http://goo.gl/dG9Pn5 * Turn an optparse-applicative program into a CGI program! Domain: github.com, Score: 39, Comments: 10 Original: [15] http://goo.gl/sjCqsb On Reddit: [16] http://goo.gl/BXxeno * Yesod 1.4 released Domain: yesodweb.com, Score: 36, Comments: 1 Original: [17] http://goo.gl/T5Vqe8 On Reddit: [18] http://goo.gl/977ey0 * Updating Auto-Update Domain: yesodweb.com, Score: 36, Comments: 20 Original: [19] http://goo.gl/OwOrGZ On Reddit: [20] http://goo.gl/J2zr5n * Type-safe Routing for Spock Web Framework released Domain: github.com, Score: 32, Comments: 39 Original: [21] http://goo.gl/QZS9gU On Reddit: [22] http://goo.gl/BokvJ8 * Lattice-Based Data Structures for Deterministic Parallel and Distributed Programming (related to CRDTs; implementation in Haskell) Domain: composition.al, Score: 30, Comments: 9 Original: [23] http://goo.gl/mVQqqX On Reddit: [24] http://goo.gl/tZ0XrW * A non-recursive sorting algorithm Domain: haskellexists.blogspot.com, Score: 27, Comments: 36 Original: [25] http://goo.gl/jD0z0K On Reddit: [26] http://goo.gl/3HpTBy * Dijkstra monads Domain: why-lambda.blogspot.co.uk, Score: 25, Comments: 4 Original: [27] http://goo.gl/kx1Q6w On Reddit: [28] http://goo.gl/C86igH * Improving Haskell-related documentation Domain: self.haskell, Score: 23, Comments: 62 Original: [29] http://goo.gl/rQeuUT On Reddit: [30] http://goo.gl/rQeuUT * Haskell, Monads and Purity ? via Hacker News Domain: jelv.is, Score: 23, Comments: 11 Original: [31] http://goo.gl/vm7juH On Reddit: [32] http://goo.gl/1P5OgF * FP Complete is hiring: Systems engineer for cloud and cluster work Domain: fpcomplete.com, Score: 21, Comments: 11 Original: [33] http://goo.gl/MLT5Ud On Reddit: [34] http://goo.gl/Ql8uIX * The future of the haskell2010/haskell98 packages for GHC 7.10 Domain: haskell.org, Score: 21, Comments: 22 Original: [35] http://goo.gl/94bnK3 On Reddit: [36] http://goo.gl/0c80JU * ANN: Nomyx V0.7, the only game where you can change the rules Domain: self.haskell, Score: 20, Comments: 7 Original: [37] http://goo.gl/1gGtqb On Reddit: [38] http://goo.gl/1gGtqb * Let's Build a Browser Engine in Haskell: part 5 Domain: hrothen.github.io, Score: 19, Comments: 6 Original: [39] http://goo.gl/zzSF2D On Reddit: [40] http://goo.gl/9xzqdR Top StackOverflow Questions * How fundamentaly different push-pull and arrowized FRP are? votes: 10, answers: 0 Read on SO: [41] http://goo.gl/XbbbVW * What are hashes (#) used for in Haskell's library's source? votes: 10, answers: 1 Read on SO: [42] http://goo.gl/mvNNlb * What is the inverse of a promise? votes: 9, answers: 3 Read on SO: [43] http://goo.gl/usQIiW * Is there a default polymorphic unit type haskell votes: 7, answers: 1 Read on SO: [44] http://goo.gl/5Ozy9G * nvcc + c2hs on OS X 10.9.5 votes: 7, answers: 1 Read on SO: [45] http://goo.gl/0XMNFu * How to sort a list using partial order in Haskell? votes: 7, answers: 2 Read on SO: [46] http://goo.gl/GLMiwA * Relationship between forward and backward map in Isomorphism (Lens package) votes: 6, answers: 1 Read on SO: [47] http://goo.gl/icIdIR * How to implement a generic neural network efficiently in Haskell? votes: 6, answers: 0 Read on SO: [48] http://goo.gl/HIHY8e * How do I unify two or more Signals in elerea? votes: 6, answers: 1 Read on SO: [49] http://goo.gl/jacb0r * Ambiguous type variable fixed with type equality constraint votes: 6, answers: 1 Read on SO: [50] http://goo.gl/JADmBj Until next time, [51]+Daniel Santa Cruz References 1. http://scrambledeggsontoast.github.io/2014/09/28/needle-announce/ 2. http://www.reddit.com/r/haskell/comments/2hpzpu/announcing_needle_asciified_arrow_notation/ 3. http://www.well-typed.com/blog/2014/09/how-we-might-abolish-cabal-hell-part-1/ 4. http://www.reddit.com/r/haskell/comments/2hvm59/how_we_might_abolish_cabal_hell_part_1/ 5. https://github.com/JakeWheat/intro_to_parsing 6. http://www.reddit.com/r/haskell/comments/2ia5u2/after_some_failed_attempts_to_learn_parsec_i_came/ 7. http://neilmitchell.blogspot.co.il/2014/10/why-traversablefoldable-should-not-be.html 8. http://www.reddit.com/r/haskell/comments/2hzqii/neil_mitchells_haskell_blog_why/ 9. https://www.codementor.io/haskell-tutorial/monoids-fingertrees-implement-abstract-data?utm_source=reddit-tutorial&utm_medium=tutorial&utm_term=haskell-tutorial-apfelmus&utm_content=tutorial&utm_campaign=reddit-tutorial 10. http://www.reddit.com/r/haskell/comments/2i3ttm/tutorial_implementing_highly_efficient_data/ 11. http://immanence.org/post/there-is-no-haskell-topology/ 12. http://www.reddit.com/r/haskell/comments/2i85k7/there_is_no_haskell_topology/ 13. http://youtu.be/McFNkLPTOSY 14. http://www.reddit.com/r/haskell/comments/2hy6cp/introduction_to_low_level_haskell_optimization/ 15. https://github.com/maxpow4h/webcloud#webcloud 16. http://www.reddit.com/r/haskell/comments/2huhrg/turn_an_optparseapplicative_program_into_a_cgi/ 17. http://www.yesodweb.com/blog/2014/09/announcing-yesod-1-4 18. http://www.reddit.com/r/haskell/comments/2hvoxb/yesod_14_released/ 19. http://www.yesodweb.com/blog/2014/10/updating-auto-update 20. http://www.reddit.com/r/haskell/comments/2i5d7m/updating_autoupdate/ 21. https://github.com/agrafix/Spock 22. http://www.reddit.com/r/haskell/comments/2i2zfw/typesafe_routing_for_spock_web_framework_released/ 23. http://composition.al/blog/2014/09/29/my-thesis-defense-talk/ 24. http://www.reddit.com/r/haskell/comments/2i17zj/latticebased_data_structures_for_deterministic/ 25. http://haskellexists.blogspot.com/2014/09/a-non-recursive-sorting-algorithm.html 26. http://www.reddit.com/r/haskell/comments/2hsea9/a_nonrecursive_sorting_algorithm/ 27. http://why-lambda.blogspot.co.uk/2014/09/dijkstra-monads.html 28. http://www.reddit.com/r/haskell/comments/2hzu5b/dijkstra_monads/ 29. http://www.reddit.com/r/haskell/comments/2i1z9u/improving_haskellrelated_documentation/ 30. http://www.reddit.com/r/haskell/comments/2i1z9u/improving_haskellrelated_documentation/ 31. http://jelv.is/blog/Haskell-Monads-and-Purity/ 32. http://www.reddit.com/r/haskell/comments/2i8tnl/haskell_monads_and_purity_via_hacker_news/ 33. https://www.fpcomplete.com/page/systems-engineer 34. http://www.reddit.com/r/haskell/comments/2hz6ue/fp_complete_is_hiring_systems_engineer_for_cloud/ 35. http://www.haskell.org/pipermail/glasgow-haskell-users/2014-September/025280.html 36. http://www.reddit.com/r/haskell/comments/2i0bhr/the_future_of_the_haskell2010haskell98_packages/ 37. http://www.reddit.com/r/haskell/comments/2hw529/ann_nomyx_v07_the_only_game_where_you_can_change/ 38. http://www.reddit.com/r/haskell/comments/2hw529/ann_nomyx_v07_the_only_game_where_you_can_change/ 39. http://hrothen.github.io/2014/10/01/lets-build-a-browser-engine-in-haskell-part-5/ 40. http://www.reddit.com/r/haskell/comments/2i0wnr/lets_build_a_browser_engine_in_haskell_part_5/ 41. http://stackoverflow.com/questions/26164135/how-fundamentaly-different-push-pull-and-arrowized-frp-are 42. http://stackoverflow.com/questions/26169990/what-are-hashes-used-for-in-haskells-librarys-source 43. http://stackoverflow.com/questions/26084439/what-is-the-inverse-of-a-promise 44. http://stackoverflow.com/questions/26097797/is-there-a-default-polymorphic-unit-type-haskell 45. http://stackoverflow.com/questions/26125870/nvcc-c2hs-on-os-x-10-9-5 46. http://stackoverflow.com/questions/26158233/how-to-sort-a-list-using-partial-order-in-haskell 47. http://stackoverflow.com/questions/26082221/relationship-between-forward-and-backward-map-in-isomorphism-lens-package 48. http://stackoverflow.com/questions/26092063/how-to-implement-a-generic-neural-network-efficiently-in-haskell 49. http://stackoverflow.com/questions/26104735/how-do-i-unify-two-or-more-signals-in-elerea 50. http://stackoverflow.com/questions/26146983/ambiguous-type-variable-fixed-with-type-equality-constraint 51. https://plus.google.com/105107667630152149014/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg at okmij.org Thu Oct 9 08:20:58 2014 From: oleg at okmij.org (oleg at okmij.org) Date: Thu, 9 Oct 2014 04:20:58 -0400 (EDT) Subject: [Haskell-cafe] type families with non-type indices Message-ID: <20141009082058.4E489C3829@www1.g3.pair.com> Doug McIlroy wrote: > An example of such a family is integers mod p. One wants to define the > operations once for all p, so that a type for any particular p can be > introduced by a one-line declaration. That was precisely the motivating example for the 2004 Haskell Workshop paper Implicit configurations -- or, type classes reflect the values of types ftp://ftp.deas.harvard.edu/techreports/tr-15-04.pdf (The Technical Report is the extended version of the paper) which discusses several solutions to the problem. From byorgey at gmail.com Thu Oct 9 13:23:25 2014 From: byorgey at gmail.com (Brent Yorgey) Date: Thu, 9 Oct 2014 09:23:25 -0400 Subject: [Haskell-cafe] `zip` doesn't work with infinite `Seq`s In-Reply-To: References: Message-ID: http://hackage.haskell.org/package/fmlist-0.8/docs/Data-FMList.html On Tue, Oct 7, 2014 at 12:29 AM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > the halting problem has nothing to do with it. Simply you can't cache the > tail if no finite number of steps will get you there :) > > (halting problem style impossibility results tend to be wayyyy niftier) > > On Mon, Oct 6, 2014 at 11:49 PM, Chris Wong > wrote: > >> > Data.Sequence provides a general-purpose *finite* sequence. There is >> > no such thing as an infinite Seq! >> > >> > In fact, you'll find that while >> > >> > head $ repeat 'a' >> > >> > results in 'a', >> > >> > Seq.head . Seq.fromList $ repeat 'a' >> > >> > never returns. >> >> To add to my previous comment: the key feature of Seq is constant-time >> access to both ends of the sequence. It does this by caching the the >> first and last few elements in the constructor. >> >> Given these constraints, the behavior you observe makes sense. To >> construct a Seq (as the call to fromList does), we must find the last >> element in the list so that we can cache it. But an infinite list >> doesn't have a last element (by definition). So fromList never >> terminates. >> >> I don't think there's a way to allow infinite sequences while also >> having efficient access to both ends. The Halting Problem probably >> comes into it somewhere. The solution you gave is likely the best one. >> >> Chris >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon at joyful.com Thu Oct 9 16:54:08 2014 From: simon at joyful.com (Simon Michael) Date: Thu, 09 Oct 2014 09:54:08 -0700 Subject: [Haskell-cafe] ANN: FunGEn game engine 0.4.6 released, now on github Message-ID: FunGEn 0.4.3 was uninstallable from hackage for a long time (and no-one noticed). Now, thanks to gelisam's bug report and some further cleanup work, I'm happy to announce that FunGEn 0.4.6 is available! I've also moved it from darcs hub to github. FunGEn (Functional Game Engine) is a BSD-licensed, cross-platform, OpenGL/GLUT-based, non-FRP game engine/framework written in Haskell. Created by Andre Furtado in 2002, it's the oldest Haskell game engine, and with very few dependencies and two example games, it's one of the easiest ways to get started with Haskell game development. It provides: - Initialization, updating, removing, rendering and grouping routines for game objects - Definition of a game background (or map), including texture-based maps and tile maps - Reading and interpretation of the player's keyboard and mouse input - Collision detection - Time-based functions and predefined game actions - Loading and displaying of 24-bit bitmap files - Some debugging and game performance evaluation facilities If you'd like to take over this package and run with it, or co-maintain, contact me. Best! -Simon From simon at joyful.com Thu Oct 9 17:06:00 2014 From: simon at joyful.com (Simon Michael) Date: Thu, 09 Oct 2014 10:06:00 -0700 Subject: [Haskell-cafe] ANN: FunGEn game engine 0.4.6 released, now on github In-Reply-To: References: Message-ID: PS, Home: http://joyful.com/fungen Reddit: http://www.reddit.com/r/haskellgamedev/comments/2irtxy/ann_fungen_game_engine_046_released_now_on_github Examples: cabal update [cabal sandbox init] cabal install FunGEn fungen-hello; fungen-pong; fungen-worms On 10/9/14 9:54 AM, Simon Michael wrote: > FunGEn 0.4.3 was uninstallable from hackage for a long time (and no-one > noticed). Now, thanks to gelisam's bug report and some further cleanup > work, I'm happy to announce that FunGEn 0.4.6 is available! I've also > moved it from darcs hub to github. > > FunGEn (Functional Game Engine) is a BSD-licensed, cross-platform, > OpenGL/GLUT-based, non-FRP game engine/framework written in Haskell. > Created by Andre Furtado in 2002, it's the oldest Haskell game engine, > and with very few dependencies and two example games, it's one of the > easiest ways to get started with Haskell game development. It provides: > > - Initialization, updating, removing, rendering and grouping routines > for game objects > - Definition of a game background (or map), including texture-based > maps and tile maps > - Reading and interpretation of the player's keyboard and mouse input > - Collision detection > - Time-based functions and predefined game actions > - Loading and displaying of 24-bit bitmap files > - Some debugging and game performance evaluation facilities > > If you'd like to take over this package and run with it, or co-maintain, > contact me. > > Best! > -Simon > From KAction at gnu.org Thu Oct 9 17:12:59 2014 From: KAction at gnu.org (Dmitry Bogatov) Date: Thu, 9 Oct 2014 21:12:59 +0400 Subject: [Haskell-cafe] Combine type family return value Message-ID: <20141009171259.GA16640@self.lan> Hello! Following code is my attempt to comprehend type families and data kinds. I want to annotate boolean formula with variables it contains, so I get function `value` checked at compile time. `value` should return Bool, if no variables are present in formula, list of variables otherwise. Of course, `value` can just return Either [Var] Bool, but I want to get Type-level programming-fu. {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE UndecidableInstances #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE DataKinds #-} data Nat = Zero | Succ Nat type family Plus (x :: Nat) (y :: Nat) :: Nat type instance Plus Zero x = x type instance Plus (Succ x) y = Plus x (Succ y) type family Multi (x :: Nat) (y :: Nat) :: Nat type instance Multi Zero x = Zero type instance Multi (Succ x) y = Plus y (Multi x y) type One = Succ Zero type Two = Succ One type Three = Succ Two type Power2 a = Power Two a type family Power (n :: Nat) (k :: Nat) :: Nat type instance Power n Zero = One type instance Power n (Succ x) = Multi n (Power n x) data Var = Pv | Qv | Rv type family PEncode (v :: Var) :: Nat type instance PEncode Pv = Power2 Zero type instance PEncode Qv = Power2 One type instance PEncode Rv = Power2 Two -- type instance PDecode (v :: Nat) :: * data Formula (n :: Nat) where P :: Formula (PEncode Pv) Q :: Formula (PEncode Qv) R :: Formula (PEncode Rv) Const :: Bool -> Formula Zero Conj :: Formula n -> Formula m -> Formula (Plus n m) type family FormulaValue (x :: Nat) :: * type instance FormulaValue Zero = Bool type instance FormulaValue (Succ n) = [Var] value :: Formula n -> FormulaValue n value (Const v) = v value P = [Pv] value Q = [Pv] value R = [Pv] value (Conj x y) = {- I have no idea -} deriving instance Show (Formula n) main = print $ Conj P Q -- Best regards, Dmitry Bogatov , Free Software supporter, esperantisto and netiquette guardian. GPG: 54B7F00D -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From icfp.publicity at googlemail.com Thu Oct 9 22:32:24 2014 From: icfp.publicity at googlemail.com (David Van Horn) Date: Thu, 9 Oct 2014 18:32:24 -0400 Subject: [Haskell-cafe] ICFP 2015 Call for Workshop and Co-located Event Proposals Message-ID: CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS ICFP 2015 20th ACM SIGPLAN International Conference on Functional Programming August 30 - September 5, 2015 Vancouver, Canada http://icfpconference.org/icfp2015/ The 120th ACM SIGPLAN International Conference on Functional Programming will be held in Vancouver, British Columbia, Canada on August 30-September 5, 2015. 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 tutorials) to be affiliated with ICFP 2015 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 30 (the day before ICFP) and September 3-5 (the three days after ICFP). ---------------------------------------------------------------------- Submission details Deadline for submission: November 16, 2014 Notification of acceptance: December 15, 2014 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 2015 workshop co-chairs (Tom Schrijvers and Nicolas Wu), via email to icfp2015-workshops at cs.kuleuven.be by November 16, 2014. (For proposals of co-located events other than workshops, please fill in the workshop proposal form and just leave blank any sections that do not apply.) Please note that this is a firm deadline. Organizers will be notified if their event proposal is accepted by December 15, 2014, 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/icfp2015/icfp15-workshops-form.txt Further information about SIGPLAN sponsorship is available at: http://www.sigplan.org/Resources/Guidelines/Workshops ---------------------------------------------------------------------- Selection committee The proposals will be evaluated by a committee comprising the following members of the ICFP 2015 organizing committee, together with the members of the SIGPLAN executive committee. Workshop Co-Chair: Tom Schrijvers (KU Leuven) Workshop Co-Chair: Nicolas Wu (University of Oxford) General Chair: Kathleen Fisher (Tufts University) Program Chair: John Reppy (University of Chicago) ---------------------------------------------------------------------- Further information Any queries should be addressed to the workshop co-chairs (Tom Schrijvers and Nicolas Wu), via email to icfp2015-workshops at cs.kuleuven.be. From alistair at abayley.org Fri Oct 10 01:15:13 2014 From: alistair at abayley.org (Alistair Bayley) Date: Fri, 10 Oct 2014 14:15:13 +1300 Subject: [Haskell-cafe] Current state-of-the-art in getting a dev env set up (windows 8) Message-ID: What is the current advice for getting a haskell dev env set up on windows? There's a lot of options, and it can be hard to quickly determine which are current and which are deprecated/bit-rotted. For example, apparently cabal sandbox is preferred over cabal-dev these days. I've read: http://onoffswitch.net/started-haskell/ http://stackoverflow.com/questions/304614/haskell-on-windows-setup http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html http://bob.ippoli.to/archives/2013/01/11/getting-started-with-haskell/ I've installed the latest haskell platform (2014.2), and am using Sublime Text 2 as my editor. SublimeHaskell is installed, but apparently it needs aeson, haskell-src-ext, and haddock. cabal install aeson indicates that it will break unordered-containers-0.2.4.0 and case-insensitive-1.1.0.3, so I must use --force-reinstalls to get it. I'm doing this in a sandbox, in case it is a terrible idea. https://github.com/SublimeHaskell/SublimeHaskell Not yet sure how I'm going to get the sandbox install of these tools to work with SublimeHaskell. Presumably some PATH magic? hdevtools looks cool and seems like it can be used from SublimeHaskell, although a windows install is from a fork. Will install ghc-mod too. What else am I missing? Thanks, Alistair -------------- next part -------------- An HTML attachment was scrubbed... URL: From mantkiew at gsd.uwaterloo.ca Fri Oct 10 01:57:57 2014 From: mantkiew at gsd.uwaterloo.ca (Michal Antkiewicz) Date: Thu, 9 Oct 2014 21:57:57 -0400 Subject: [Haskell-cafe] Current state-of-the-art in getting a dev env set up (windows 8) In-Reply-To: References: Message-ID: This is a question I am often asking myself as well. Here are a few points: 1. definitely install MSYS2 see links here http://www.haskell.org/haskellwiki/Windows 2. I used Sublime Text 2 as well, switched to 3 now and it works great so far 3. Yes, installing the dev tools is a pain on Windows. It almost never just works. I install dev tools into the user space and always use sandboxes for projects. Currently I managed to install the following versions. You have to use these specific versions. aeson-0.7.0.6 ghc-mod-4.1.6 haddock-2.14.3 haskell-docs-4.2.2 haskell-src-exts-1.15.0.1 hasktags-0.69.0 hlint-1.9.4 I could never get codex to work on Windows with Haskell Platform. 4. I also recommend ghc-vis package, which only today I managed to successfully install: http://felsin9.de/nnis/ghc-vis/installing-windows/ -- do not use `--enable-shared` in the last command ghc-heap-view-0.5.3 ghc-vis-0.7.2.5 5. with hdevtools, you have to get the windows fork and pull one of the branches which makes it work with GHC-7.8.3 (I forgot exactly which one I pulled from). The fork is not maintained. I am hoping that `ghc-modi` will eventually replace `hdevtools` for SublimeHaskell. Hope that helps to get you going. On Linux everything just works when you get GHC and cabal-install. Cheers, Michal On Thu, Oct 9, 2014 at 9:15 PM, Alistair Bayley wrote: > What is the current advice for getting a haskell dev env set up on > windows? There's a lot of options, and it can be hard to quickly determine > which are current and which are deprecated/bit-rotted. > > For example, apparently cabal sandbox is preferred over cabal-dev these > days. > > I've read: > http://onoffswitch.net/started-haskell/ > http://stackoverflow.com/questions/304614/haskell-on-windows-setup > http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html > http://bob.ippoli.to/archives/2013/01/11/getting-started-with-haskell/ > > > I've installed the latest haskell platform (2014.2), and am using Sublime > Text 2 as my editor. SublimeHaskell is installed, but apparently it needs > aeson, haskell-src-ext, and haddock. cabal install aeson indicates that it > will break unordered-containers-0.2.4.0 and case-insensitive-1.1.0.3, so I > must use --force-reinstalls to get it. I'm doing this in a sandbox, in case > it is a terrible idea. > > https://github.com/SublimeHaskell/SublimeHaskell > > Not yet sure how I'm going to get the sandbox install of these tools to > work with SublimeHaskell. Presumably some PATH magic? > > hdevtools looks cool and seems like it can be used from SublimeHaskell, > although a windows install is from a fork. Will install ghc-mod too. > > What else am I missing? > > Thanks, > Alistair > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gershomb at gmail.com Fri Oct 10 02:04:14 2014 From: gershomb at gmail.com (Gershom B) Date: Thu, 9 Oct 2014 22:04:14 -0400 Subject: [Haskell-cafe] What happened to hugs? In-Reply-To: References: <-3701248786196244697@unknownmsgid> Message-ID: I?m happy to announce that http://www.haskell.org/hugs has now been resuscitated, and should contain complete documentation and downloads for the Hugs system. ?Furthermore we?re working on putting put in place a redirect so that http://cvs.haskell.org will be able to point to the new location to keep older links intact. If there are any other stale links anyone would like patched up or binary releases that people feel should be pointed to, please let us know at admin at haskell.org. -gershom On September 25, 2014 at 11:57:58 PM, Rustom Mody (rustompmody at gmail.com) wrote: > On Thu, Sep 11, 2014 at 2:03 AM, Thorsten Rangwich > > wrote: > > > Hi, > > > > I suppose this question is not new, but neither google nor a manual search > > file be file through the archives brought enlightement. > > > > www.haskell.org/hugs > > > > still exists, but none of the links there does work. Documentation and > > source point to cvs.haskell.org ("server does not exist") and development > > points to http://hackage.haskell.org/trac/hugs ("page does not exist"). > > > > Was it migrated to somewhere else or is it dead - in latter case the page > > would not make sense any more. > > > > > > Sad that hugs links are now dead. > > There is still gofer (the predecessor to hugs). > The original of Mark Jones and modifications made by me in the early 90s > and the whys of these modifications are at > http://blog.languager.org/2014/09/pugofer.html > > > > "Raskell" (iPad app) provided a development environment usinh hugs, so I > > would at least like to install hugs on my Mac as well... > > > > Dont know about macs but last I knew it was compiling with gcc on linux > (in all of 10 seconds!) > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From mantkiew at gsd.uwaterloo.ca Fri Oct 10 02:05:52 2014 From: mantkiew at gsd.uwaterloo.ca (Michal Antkiewicz) Date: Thu, 9 Oct 2014 22:05:52 -0400 Subject: [Haskell-cafe] Current state-of-the-art in getting a dev env set up (windows 8) In-Reply-To: References: Message-ID: Ah, forgot to add that you have to fix the PATH. By default, the platform installer creates a user variable PATH, which windows 8 automatically appends at the end of the system PATH. This way doing `cabal install cabal-install` will update cabal in user space but the platform one will always be used. So you must "prepend" the path to `c:\users\....\AppData\Roaming\cabal\bin` at the beginning of the system PATH to give user space executables priority over platform and global executables. In MSYS, get friendly with `hash -r` command when you fiddle with PATHs. Michal On Thu, Oct 9, 2014 at 9:57 PM, Michal Antkiewicz wrote: > This is a question I am often asking myself as well. Here are a few points: > > 1. definitely install MSYS2 > see links here http://www.haskell.org/haskellwiki/Windows > > 2. I used Sublime Text 2 as well, switched to 3 now and it works great so > far > > 3. Yes, installing the dev tools is a pain on Windows. It almost never > just works. I install dev tools into the user space and always use > sandboxes for projects. Currently I managed to install the following > versions. You have to use these specific versions. > > aeson-0.7.0.6 > ghc-mod-4.1.6 > haddock-2.14.3 > haskell-docs-4.2.2 > haskell-src-exts-1.15.0.1 > hasktags-0.69.0 > hlint-1.9.4 > > I could never get codex to work on Windows with Haskell Platform. > > 4. I also recommend ghc-vis package, which only today I managed to > successfully install: > http://felsin9.de/nnis/ghc-vis/installing-windows/ > -- do not use `--enable-shared` in the last command > > ghc-heap-view-0.5.3 > ghc-vis-0.7.2.5 > > 5. with hdevtools, you have to get the windows fork and pull one of the > branches which makes it work with GHC-7.8.3 (I forgot exactly which one I > pulled from). The fork is not maintained. I am hoping that `ghc-modi` will > eventually replace `hdevtools` for SublimeHaskell. > > Hope that helps to get you going. On Linux everything just works when you > get GHC and cabal-install. > > Cheers, > Michal > > On Thu, Oct 9, 2014 at 9:15 PM, Alistair Bayley > wrote: > >> What is the current advice for getting a haskell dev env set up on >> windows? There's a lot of options, and it can be hard to quickly determine >> which are current and which are deprecated/bit-rotted. >> >> For example, apparently cabal sandbox is preferred over cabal-dev these >> days. >> >> I've read: >> http://onoffswitch.net/started-haskell/ >> http://stackoverflow.com/questions/304614/haskell-on-windows-setup >> http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html >> http://bob.ippoli.to/archives/2013/01/11/getting-started-with-haskell/ >> >> >> I've installed the latest haskell platform (2014.2), and am using Sublime >> Text 2 as my editor. SublimeHaskell is installed, but apparently it needs >> aeson, haskell-src-ext, and haddock. cabal install aeson indicates that it >> will break unordered-containers-0.2.4.0 and case-insensitive-1.1.0.3, so I >> must use --force-reinstalls to get it. I'm doing this in a sandbox, in case >> it is a terrible idea. >> >> https://github.com/SublimeHaskell/SublimeHaskell >> >> Not yet sure how I'm going to get the sandbox install of these tools to >> work with SublimeHaskell. Presumably some PATH magic? >> >> hdevtools looks cool and seems like it can be used from SublimeHaskell, >> although a windows install is from a fork. Will install ghc-mod too. >> >> What else am I missing? >> >> Thanks, >> Alistair >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alistair at abayley.org Fri Oct 10 02:18:45 2014 From: alistair at abayley.org (Alistair Bayley) Date: Fri, 10 Oct 2014 15:18:45 +1300 Subject: [Haskell-cafe] Current state-of-the-art in getting a dev env set up (windows 8) In-Reply-To: References: Message-ID: Forgot to say that I have git with git-bash installed, which seems to come with a msys bundle. Is this sufficient, or should I install msys too? On 10 October 2014 15:05, Michal Antkiewicz wrote: > Ah, forgot to add that you have to fix the PATH. By default, the platform > installer creates a user variable PATH, which windows 8 automatically > appends at the end of the system PATH. This way doing `cabal install > cabal-install` will update cabal in user space but the platform one will > always be used. So you must "prepend" the path to > `c:\users\....\AppData\Roaming\cabal\bin` at the beginning of the system > PATH to give user space executables priority over platform and global > executables. > > In MSYS, get friendly with `hash -r` command when you fiddle with PATHs. > > Michal > > > On Thu, Oct 9, 2014 at 9:57 PM, Michal Antkiewicz < > mantkiew at gsd.uwaterloo.ca> wrote: > >> This is a question I am often asking myself as well. Here are a few >> points: >> >> 1. definitely install MSYS2 >> see links here http://www.haskell.org/haskellwiki/Windows >> >> 2. I used Sublime Text 2 as well, switched to 3 now and it works great so >> far >> >> 3. Yes, installing the dev tools is a pain on Windows. It almost never >> just works. I install dev tools into the user space and always use >> sandboxes for projects. Currently I managed to install the following >> versions. You have to use these specific versions. >> >> aeson-0.7.0.6 >> ghc-mod-4.1.6 >> haddock-2.14.3 >> haskell-docs-4.2.2 >> haskell-src-exts-1.15.0.1 >> hasktags-0.69.0 >> hlint-1.9.4 >> >> I could never get codex to work on Windows with Haskell Platform. >> >> 4. I also recommend ghc-vis package, which only today I managed to >> successfully install: >> http://felsin9.de/nnis/ghc-vis/installing-windows/ >> -- do not use `--enable-shared` in the last command >> >> ghc-heap-view-0.5.3 >> ghc-vis-0.7.2.5 >> >> 5. with hdevtools, you have to get the windows fork and pull one of the >> branches which makes it work with GHC-7.8.3 (I forgot exactly which one I >> pulled from). The fork is not maintained. I am hoping that `ghc-modi` will >> eventually replace `hdevtools` for SublimeHaskell. >> >> Hope that helps to get you going. On Linux everything just works when you >> get GHC and cabal-install. >> >> Cheers, >> Michal >> >> On Thu, Oct 9, 2014 at 9:15 PM, Alistair Bayley >> wrote: >> >>> What is the current advice for getting a haskell dev env set up on >>> windows? There's a lot of options, and it can be hard to quickly determine >>> which are current and which are deprecated/bit-rotted. >>> >>> For example, apparently cabal sandbox is preferred over cabal-dev these >>> days. >>> >>> I've read: >>> http://onoffswitch.net/started-haskell/ >>> http://stackoverflow.com/questions/304614/haskell-on-windows-setup >>> http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html >>> http://bob.ippoli.to/archives/2013/01/11/getting-started-with-haskell/ >>> >>> >>> I've installed the latest haskell platform (2014.2), and am using >>> Sublime Text 2 as my editor. SublimeHaskell is installed, but apparently it >>> needs aeson, haskell-src-ext, and haddock. cabal install aeson indicates >>> that it will break unordered-containers-0.2.4.0 and >>> case-insensitive-1.1.0.3, so I must use --force-reinstalls to get it. I'm >>> doing this in a sandbox, in case it is a terrible idea. >>> >>> https://github.com/SublimeHaskell/SublimeHaskell >>> >>> Not yet sure how I'm going to get the sandbox install of these tools to >>> work with SublimeHaskell. Presumably some PATH magic? >>> >>> hdevtools looks cool and seems like it can be used from SublimeHaskell, >>> although a windows install is from a fork. Will install ghc-mod too. >>> >>> What else am I missing? >>> >>> Thanks, >>> Alistair >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mantkiew at gsd.uwaterloo.ca Fri Oct 10 03:39:48 2014 From: mantkiew at gsd.uwaterloo.ca (Michal Antkiewicz) Date: Thu, 9 Oct 2014 23:39:48 -0400 Subject: [Haskell-cafe] Current state-of-the-art in getting a dev env set up (windows 8) In-Reply-To: References: Message-ID: The one you have with git might work as well. I used to use GetMinGWInstaller to install MSYS before. MSYS2 is a "modern" version of MSYS and it's recommended on HaskellWiki, so I'm going with that. Michal On Thu, Oct 9, 2014 at 10:18 PM, Alistair Bayley wrote: > Forgot to say that I have git with git-bash installed, which seems to come > with a msys bundle. Is this sufficient, or should I install msys too? > > On 10 October 2014 15:05, Michal Antkiewicz > wrote: > >> Ah, forgot to add that you have to fix the PATH. By default, the platform >> installer creates a user variable PATH, which windows 8 automatically >> appends at the end of the system PATH. This way doing `cabal install >> cabal-install` will update cabal in user space but the platform one will >> always be used. So you must "prepend" the path to >> `c:\users\....\AppData\Roaming\cabal\bin` at the beginning of the system >> PATH to give user space executables priority over platform and global >> executables. >> >> In MSYS, get friendly with `hash -r` command when you fiddle with PATHs. >> >> Michal >> >> >> On Thu, Oct 9, 2014 at 9:57 PM, Michal Antkiewicz < >> mantkiew at gsd.uwaterloo.ca> wrote: >> >>> This is a question I am often asking myself as well. Here are a few >>> points: >>> >>> 1. definitely install MSYS2 >>> see links here http://www.haskell.org/haskellwiki/Windows >>> >>> 2. I used Sublime Text 2 as well, switched to 3 now and it works great >>> so far >>> >>> 3. Yes, installing the dev tools is a pain on Windows. It almost never >>> just works. I install dev tools into the user space and always use >>> sandboxes for projects. Currently I managed to install the following >>> versions. You have to use these specific versions. >>> >>> aeson-0.7.0.6 >>> ghc-mod-4.1.6 >>> haddock-2.14.3 >>> haskell-docs-4.2.2 >>> haskell-src-exts-1.15.0.1 >>> hasktags-0.69.0 >>> hlint-1.9.4 >>> >>> I could never get codex to work on Windows with Haskell Platform. >>> >>> 4. I also recommend ghc-vis package, which only today I managed to >>> successfully install: >>> http://felsin9.de/nnis/ghc-vis/installing-windows/ >>> -- do not use `--enable-shared` in the last command >>> >>> ghc-heap-view-0.5.3 >>> ghc-vis-0.7.2.5 >>> >>> 5. with hdevtools, you have to get the windows fork and pull one of the >>> branches which makes it work with GHC-7.8.3 (I forgot exactly which one I >>> pulled from). The fork is not maintained. I am hoping that `ghc-modi` will >>> eventually replace `hdevtools` for SublimeHaskell. >>> >>> Hope that helps to get you going. On Linux everything just works when >>> you get GHC and cabal-install. >>> >>> Cheers, >>> Michal >>> >>> On Thu, Oct 9, 2014 at 9:15 PM, Alistair Bayley >>> wrote: >>> >>>> What is the current advice for getting a haskell dev env set up on >>>> windows? There's a lot of options, and it can be hard to quickly determine >>>> which are current and which are deprecated/bit-rotted. >>>> >>>> For example, apparently cabal sandbox is preferred over cabal-dev these >>>> days. >>>> >>>> I've read: >>>> http://onoffswitch.net/started-haskell/ >>>> http://stackoverflow.com/questions/304614/haskell-on-windows-setup >>>> http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html >>>> http://bob.ippoli.to/archives/2013/01/11/getting-started-with-haskell/ >>>> >>>> >>>> I've installed the latest haskell platform (2014.2), and am using >>>> Sublime Text 2 as my editor. SublimeHaskell is installed, but apparently it >>>> needs aeson, haskell-src-ext, and haddock. cabal install aeson indicates >>>> that it will break unordered-containers-0.2.4.0 and >>>> case-insensitive-1.1.0.3, so I must use --force-reinstalls to get it. I'm >>>> doing this in a sandbox, in case it is a terrible idea. >>>> >>>> https://github.com/SublimeHaskell/SublimeHaskell >>>> >>>> Not yet sure how I'm going to get the sandbox install of these tools to >>>> work with SublimeHaskell. Presumably some PATH magic? >>>> >>>> hdevtools looks cool and seems like it can be used from SublimeHaskell, >>>> although a windows install is from a fork. Will install ghc-mod too. >>>> >>>> What else am I missing? >>>> >>>> Thanks, >>>> Alistair >>>> >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >>> >>> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Fri Oct 10 07:43:18 2014 From: david.feuer at gmail.com (David Feuer) Date: Fri, 10 Oct 2014 03:43:18 -0400 Subject: [Haskell-cafe] Need help testing hGetContents modification Message-ID: I uploaded a change to hGetContents as D327 on Phabricator to address TRAC #9236. In particular, this generates an error when attempting to read from a closed handle instead of silently returning an empty string. I would love to get some help testing this against code that uses lazy I/O heavily, *especially* with pipes, sockets, and other such weirdness, if such things exist in the wild. I don't usually read haskell-cafe, so please send responses to my address as well as the list. Thanks a lot, David Feuer -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.gigante at gmail.com Fri Oct 10 13:51:07 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Fri, 10 Oct 2014 15:51:07 +0200 Subject: [Haskell-cafe] Chaining a map over lists with lenses Message-ID: Hi! I?m sure the answer to this question is under my eyes but I can?t understand it only from the docs. Suppose a data type like this: data Type1 = Type1 { _myField :: [Type2] } makeLenses ??Type1 data Type2 = Type2 { _otherField :: String } Then with t^.myField I get access to the [Type2] list. Now, i would like to go through each element of the list, apply the otherField lens to each element, and get the list of the results. Of course this means: map (view otherField) (t^.myField) but I?m sure there?s some combinator to do the same thing by chaining lenses/prisms/traversals/whatever, right? E.g. something like t^.myField.something.otherField I?m still trying to understand the full picture about lenses, but afaik what I need is a prism, because a list is a sum type, right? Thank you for your help, Nicola From vlatko.basic at gmail.com Fri Oct 10 14:14:27 2014 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Fri, 10 Oct 2014 16:14:27 +0200 Subject: [Haskell-cafe] cabal sandbox using absolute path on symlinked dir Message-ID: <5437E9C3.60705@gmail.com> Hello Cafe, On Ubuntu, after creating a sandboxed project in a symlinked directory, cabal.sandbox.config contains absolute (canonical) paths of the directory, and not the symlinked paths. Is this a bug, and is there a way to correct that behavior? There is no way to move the project to a different place without recreating the whole sandbox. Best regards, vlatko From targen at gmail.com Fri Oct 10 13:58:06 2014 From: targen at gmail.com (=?UTF-8?Q?Manuel_G=C3=B3mez?=) Date: Fri, 10 Oct 2014 09:28:06 -0430 Subject: [Haskell-cafe] Chaining a map over lists with lenses In-Reply-To: References: Message-ID: On Fri, Oct 10, 2014 at 9:21 AM, Nicola Gigante wrote: > t^.myField.something.otherField > > I?m still trying to understand the full picture about lenses, > but afaik what I need is a prism, because a list is a sum type, > right? `traverse` should do the trick. A traversal is like a lens, except it isn?t constrained to exactly one target. A prism is a traversal constrained to having exactly zero or one targets. `traverse` from `Data.Traversable` targets everything ?in? the value. If you use `(^.)` with a traversal, though, that?ll require an instance of `Monoid` and it will in essence apply `mconcat` to the list of results. If you want them separately, try `(^..)` (pronounced `toListOf`, I believe). From allbery.b at gmail.com Fri Oct 10 14:29:53 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 10 Oct 2014 10:29:53 -0400 Subject: [Haskell-cafe] cabal sandbox using absolute path on symlinked dir In-Reply-To: <5437E9C3.60705@gmail.com> References: <5437E9C3.60705@gmail.com> Message-ID: On Fri, Oct 10, 2014 at 10:14 AM, Vlatko Basic wrote: > There is no way to move the project to a different place without > recreating the whole sandbox. It would be nice if there were a tool to do this. It should not be difficult to programmatically adjust those paths and the ones in the ghc package directory, and reindex the latter. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From corentin.dupont at gmail.com Fri Oct 10 14:34:27 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Fri, 10 Oct 2014 16:34:27 +0200 Subject: [Haskell-cafe] cabal sandbox using absolute path on symlinked dir In-Reply-To: References: <5437E9C3.60705@gmail.com> Message-ID: This project seems to do what you want (I didn't test it): https://github.com/philopon/sandbox-move Although I think it would be better to have relative file paths in cabal.sandbox.config... On Fri, Oct 10, 2014 at 4:29 PM, Brandon Allbery wrote: > On Fri, Oct 10, 2014 at 10:14 AM, Vlatko Basic > wrote: > >> There is no way to move the project to a different place without >> recreating the whole sandbox. > > > It would be nice if there were a tool to do this. It should not be > difficult to programmatically adjust those paths and the ones in the ghc > package directory, and reindex the latter. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.trstenjak at gmail.com Fri Oct 10 14:36:49 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Fri, 10 Oct 2014 16:36:49 +0200 Subject: [Haskell-cafe] Chaining a map over lists with lenses In-Reply-To: References: Message-ID: <20141010143648.GA14176@machine> Hi Nicola, there's 'traversed' to access every entry of a traversable structure, e.g. appending a "X" at the end of each 'otherField': t & myField . traversed . otherField %~ (++ "X") And there's '^..' to return a list of each entry of a traversable structure: t ^.. myField . traversed . otherField Greetings, Daniel From nicola.gigante at gmail.com Fri Oct 10 15:03:16 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Fri, 10 Oct 2014 17:03:16 +0200 Subject: [Haskell-cafe] Chaining a map over lists with lenses In-Reply-To: <20141010143648.GA14176@machine> References: <20141010143648.GA14176@machine> Message-ID: <82C10147-F7C8-4405-96BC-B630858164B4@gmail.com> Il giorno 10/ott/2014, alle ore 16:36, Daniel Trstenjak ha scritto: > > Hi Nicola, > > there's 'traversed' to access every entry of a traversable structure, > e.g. appending a "X" at the end of each 'otherField': > > t & myField . traversed . otherField %~ (++ "X") > > > And there's '^..' to return a list of each entry of a traversable structure: > > t ^.. myField . traversed . otherField > Thank you for both the answers! So my error was to presume that everything can be done with (^.) (which is view, if I?m correct). So I have to understand now, what is the & operator? > > Greetings, > Daniel Thank you, Nicola From mantkiew at gsd.uwaterloo.ca Fri Oct 10 15:09:46 2014 From: mantkiew at gsd.uwaterloo.ca (Michal Antkiewicz) Date: Fri, 10 Oct 2014 11:09:46 -0400 Subject: [Haskell-cafe] Chaining a map over lists with lenses In-Reply-To: <82C10147-F7C8-4405-96BC-B630858164B4@gmail.com> References: <20141010143648.GA14176@machine> <82C10147-F7C8-4405-96BC-B630858164B4@gmail.com> Message-ID: The & is the same as $ with arguments inverted. So instead of t & myField . traversed . otherField %~ (++ "X") you could write myField . traversed . otherField %~ (++ "X") $ t (if I recall correctly...) Michal On Fri, Oct 10, 2014 at 11:03 AM, Nicola Gigante wrote: > > Il giorno 10/ott/2014, alle ore 16:36, Daniel Trstenjak < > daniel.trstenjak at gmail.com> ha scritto: > > > > > Hi Nicola, > > > > there's 'traversed' to access every entry of a traversable structure, > > e.g. appending a "X" at the end of each 'otherField': > > > > t & myField . traversed . otherField %~ (++ "X") > > > > > > And there's '^..' to return a list of each entry of a traversable > structure: > > > > t ^.. myField . traversed . otherField > > > > Thank you for both the answers! > > So my error was to presume that everything can be > done with (^.) (which is view, if I?m correct). > > So I have to understand now, what is the & operator? > > > > > Greetings, > > Daniel > > Thank you, > Nicola > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From markus.l2ll at gmail.com Fri Oct 10 19:00:22 2014 From: markus.l2ll at gmail.com (=?UTF-8?B?TWFya3VzIEzDpGxs?=) Date: Fri, 10 Oct 2014 21:00:22 +0200 Subject: [Haskell-cafe] cabal sandbox using absolute path on symlinked dir In-Reply-To: References: <5437E9C3.60705@gmail.com> Message-ID: I would also prefer relative paths for sandboxes. On Fri, Oct 10, 2014 at 4:34 PM, Corentin Dupont wrote: > This project seems to do what you want (I didn't test it): > https://github.com/philopon/sandbox-move > > Although I think it would be better to have relative file paths in > cabal.sandbox.config... > > On Fri, Oct 10, 2014 at 4:29 PM, Brandon Allbery > wrote: > >> On Fri, Oct 10, 2014 at 10:14 AM, Vlatko Basic >> wrote: >> >>> There is no way to move the project to a different place without >>> recreating the whole sandbox. >> >> >> It would be nice if there were a tool to do this. It should not be >> difficult to programmatically adjust those paths and the ones in the ghc >> package directory, and reindex the latter. >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Markus L?ll -------------- next part -------------- An HTML attachment was scrubbed... URL: From britt.mathis at gmail.com Fri Oct 10 19:09:08 2014 From: britt.mathis at gmail.com (Britt Mathis) Date: Fri, 10 Oct 2014 15:09:08 -0400 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: Message-ID: Hello everyone, I'm not sure if something like this already exists so I figured I would ask here first before I reinvent the wheel. What I need is a data structure that behaves like Data.Map, but is serialized to disk incrementally so I only have the overhead of writing what has changed every time. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nukasu.kanaka at gmail.com Fri Oct 10 19:29:15 2014 From: nukasu.kanaka at gmail.com (Nikita Volkov) Date: Fri, 10 Oct 2014 23:29:15 +0400 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: Message-ID: There's "acid-state", which provides a log-based persistence model. I.e., it persists the modifications you make to the data structure. 2014-10-10 23:09 GMT+04:00 Britt Mathis : > Hello everyone, I'm not sure if something like this already exists so I > figured I would ask here first before I reinvent the wheel. What I need is > a data structure that behaves like Data.Map, but is serialized to disk > incrementally so I only have the overhead of writing what has changed every > time. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicolas at incubaid.com Fri Oct 10 19:37:30 2014 From: nicolas at incubaid.com (Nicolas Trangez) Date: Fri, 10 Oct 2014 21:37:30 +0200 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: Message-ID: <1412969850.2876.18.camel@chi.nicolast.be> On Fri, 2014-10-10 at 23:29 +0400, Nikita Volkov wrote: > There's "acid-state", which provides a log-based persistence model. I.e., > it persists the modifications you make to the data structure. You might also be interested in the paper 'Generic Storage in Haskell' by Sebastiaan Visser, and his thesis about the same subject. Nicolas > > 2014-10-10 23:09 GMT+04:00 Britt Mathis : > > > Hello everyone, I'm not sure if something like this already exists so I > > figured I would ask here first before I reinvent the wheel. What I need is > > a data structure that behaves like Data.Map, but is serialized to disk > > incrementally so I only have the overhead of writing what has changed every > > time. > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From britt.mathis at gmail.com Fri Oct 10 19:55:23 2014 From: britt.mathis at gmail.com (Britt Mathis) Date: Fri, 10 Oct 2014 15:55:23 -0400 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: <1412969850.2876.18.camel@chi.nicolast.be> References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: I was told about acid-state on irc, but I wasn't sure if it did the incremental part - it looks like it will be perfect, thank you. And I will definitely check out that paper as well. On Oct 10, 2014 3:37 PM, "Nicolas Trangez" wrote: > On Fri, 2014-10-10 at 23:29 +0400, Nikita Volkov wrote: > > There's "acid-state", which provides a log-based persistence model. I.e., > > it persists the modifications you make to the data structure. > > You might also be interested in the paper 'Generic Storage in Haskell' > by Sebastiaan Visser, and his thesis about the same subject. > > Nicolas > > > > > 2014-10-10 23:09 GMT+04:00 Britt Mathis : > > > > > Hello everyone, I'm not sure if something like this already exists so > I > > > figured I would ask here first before I reinvent the wheel. What I > need is > > > a data structure that behaves like Data.Map, but is serialized to disk > > > incrementally so I only have the overhead of writing what has changed > every > > > time. > > > > > > _______________________________________________ > > > Haskell-Cafe mailing list > > > Haskell-Cafe at haskell.org > > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From djohnson.m at gmail.com Fri Oct 10 20:10:32 2014 From: djohnson.m at gmail.com (David Johnson) Date: Fri, 10 Oct 2014 15:10:32 -0500 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: I recommend looking into Data.Acid.Remote if you plan on using acid-state. Will allow you to inspect your state using ghci. http://hackage.haskell.org/package/acid-state-0.12.2/docs/Data-Acid-Remote.html On Fri, Oct 10, 2014 at 2:55 PM, Britt Mathis wrote: > I was told about acid-state on irc, but I wasn't sure if it did the > incremental part - it looks like it will be perfect, thank you. And I will > definitely check out that paper as well. > On Oct 10, 2014 3:37 PM, "Nicolas Trangez" wrote: > >> On Fri, 2014-10-10 at 23:29 +0400, Nikita Volkov wrote: >> > There's "acid-state", which provides a log-based persistence model. >> I.e., >> > it persists the modifications you make to the data structure. >> >> You might also be interested in the paper 'Generic Storage in Haskell' >> by Sebastiaan Visser, and his thesis about the same subject. >> >> Nicolas >> >> > >> > 2014-10-10 23:09 GMT+04:00 Britt Mathis : >> > >> > > Hello everyone, I'm not sure if something like this already exists >> so I >> > > figured I would ask here first before I reinvent the wheel. What I >> need is >> > > a data structure that behaves like Data.Map, but is serialized to disk >> > > incrementally so I only have the overhead of writing what has changed >> every >> > > time. >> > > >> > > _______________________________________________ >> > > Haskell-Cafe mailing list >> > > Haskell-Cafe at haskell.org >> > > http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > >> > > >> > _______________________________________________ >> > Haskell-Cafe mailing list >> > Haskell-Cafe at haskell.org >> > http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Cell: 1.630.740.8204 -------------- next part -------------- An HTML attachment was scrubbed... URL: From britt.mathis at gmail.com Fri Oct 10 20:15:29 2014 From: britt.mathis at gmail.com (Britt Mathis) Date: Fri, 10 Oct 2014 16:15:29 -0400 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: Someone on irc mentioned acid-state remote (it may have even been you), I will definitely be using it. My only worry is that I only have 512MB of Ram to work with atm, which should be fine until I have several thousand users. I see on the acid state website that I would need to integrate with something else to provide the ability to have a data structure larger than memory (I may be missing or misunderstanding something), would it be trivial to add this in later or should I be worried about it now? On Oct 10, 2014 4:10 PM, "David Johnson" wrote: > I recommend looking into Data.Acid.Remote if you plan on using acid-state. > Will allow you to inspect your state using ghci. > > > http://hackage.haskell.org/package/acid-state-0.12.2/docs/Data-Acid-Remote.html > > On Fri, Oct 10, 2014 at 2:55 PM, Britt Mathis > wrote: > >> I was told about acid-state on irc, but I wasn't sure if it did the >> incremental part - it looks like it will be perfect, thank you. And I will >> definitely check out that paper as well. >> On Oct 10, 2014 3:37 PM, "Nicolas Trangez" wrote: >> >>> On Fri, 2014-10-10 at 23:29 +0400, Nikita Volkov wrote: >>> > There's "acid-state", which provides a log-based persistence model. >>> I.e., >>> > it persists the modifications you make to the data structure. >>> >>> You might also be interested in the paper 'Generic Storage in Haskell' >>> by Sebastiaan Visser, and his thesis about the same subject. >>> >>> Nicolas >>> >>> > >>> > 2014-10-10 23:09 GMT+04:00 Britt Mathis : >>> > >>> > > Hello everyone, I'm not sure if something like this already exists >>> so I >>> > > figured I would ask here first before I reinvent the wheel. What I >>> need is >>> > > a data structure that behaves like Data.Map, but is serialized to >>> disk >>> > > incrementally so I only have the overhead of writing what has >>> changed every >>> > > time. >>> > > >>> > > _______________________________________________ >>> > > Haskell-Cafe mailing list >>> > > Haskell-Cafe at haskell.org >>> > > http://www.haskell.org/mailman/listinfo/haskell-cafe >>> > > >>> > > >>> > _______________________________________________ >>> > Haskell-Cafe mailing list >>> > Haskell-Cafe at haskell.org >>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >>> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Cell: 1.630.740.8204 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agocorona at gmail.com Fri Oct 10 20:36:00 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Fri, 10 Oct 2014 22:36:00 +0200 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: I don?t know the new versions, but acid-state is not incremental. it writes everithing. the package TCache is incremental. it uses HasTables instead of a map. It works in the STM monad. And it is incremental with configurable persistence. https://hackage.haskell.org/package/TCache 2014-10-10 22:15 GMT+02:00 Britt Mathis : > Someone on irc mentioned acid-state remote (it may have even been you), I > will definitely be using it. My only worry is that I only have 512MB of Ram > to work with atm, which should be fine until I have several thousand users. > I see on the acid state website that I would need to integrate with > something else to provide the ability to have a data structure larger than > memory (I may be missing or misunderstanding something), would it be > trivial to add this in later or should I be worried about it now? > On Oct 10, 2014 4:10 PM, "David Johnson" wrote: > >> I recommend looking into Data.Acid.Remote if you plan on using >> acid-state. Will allow you to inspect your state using ghci. >> >> >> http://hackage.haskell.org/package/acid-state-0.12.2/docs/Data-Acid-Remote.html >> >> On Fri, Oct 10, 2014 at 2:55 PM, Britt Mathis >> wrote: >> >>> I was told about acid-state on irc, but I wasn't sure if it did the >>> incremental part - it looks like it will be perfect, thank you. And I will >>> definitely check out that paper as well. >>> On Oct 10, 2014 3:37 PM, "Nicolas Trangez" wrote: >>> >>>> On Fri, 2014-10-10 at 23:29 +0400, Nikita Volkov wrote: >>>> > There's "acid-state", which provides a log-based persistence model. >>>> I.e., >>>> > it persists the modifications you make to the data structure. >>>> >>>> You might also be interested in the paper 'Generic Storage in Haskell' >>>> by Sebastiaan Visser, and his thesis about the same subject. >>>> >>>> Nicolas >>>> >>>> > >>>> > 2014-10-10 23:09 GMT+04:00 Britt Mathis : >>>> > >>>> > > Hello everyone, I'm not sure if something like this already exists >>>> so I >>>> > > figured I would ask here first before I reinvent the wheel. What I >>>> need is >>>> > > a data structure that behaves like Data.Map, but is serialized to >>>> disk >>>> > > incrementally so I only have the overhead of writing what has >>>> changed every >>>> > > time. >>>> > > >>>> > > _______________________________________________ >>>> > > Haskell-Cafe mailing list >>>> > > Haskell-Cafe at haskell.org >>>> > > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> > > >>>> > > >>>> > _______________________________________________ >>>> > Haskell-Cafe mailing list >>>> > Haskell-Cafe at haskell.org >>>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >>>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> >> -- >> Cell: 1.630.740.8204 >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From djohnson.m at gmail.com Fri Oct 10 20:52:33 2014 From: djohnson.m at gmail.com (David Johnson) Date: Fri, 10 Oct 2014 15:52:33 -0500 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: Britt, If you use the remote module you will have the ability to create multiple states that can reside on multiple machines, so you won't be limited by the RAM capacity of just one machine, and you can then use RPC calls to query them from a web server or command line app. In order to minimize your memory footprint and keep things fast you could use an IntMap to store your users (i.e. IntMap User). You could also install ekg on the server that broadcasts your state to get a good idea of just how large your state is. Since acid-state transactions are pure they complement parallelism nicely as well. Alberto, Acid state has two logs on disk, one for events and another for checkpoints. Checkpoints represent the entire serialized state. Events are incremental changes on the state. Writing checkpoints is an expensive operation (since the entire state will be written to disk from the MVar), and shouldn't be done very often. Note on usability: If you have long event files, and you are constantly opening and closing your state you will most likely experience poor performance. Since acid-state will attempt to read the entire event log to recreate the state in memory. Someone can correct me if I'm wrong. On Fri, Oct 10, 2014 at 3:15 PM, Britt Mathis wrote: > Someone on irc mentioned acid-state remote (it may have even been you), I > will definitely be using it. My only worry is that I only have 512MB of Ram > to work with atm, which should be fine until I have several thousand users. > I see on the acid state website that I would need to integrate with > something else to provide the ability to have a data structure larger than > memory (I may be missing or misunderstanding something), would it be > trivial to add this in later or should I be worried about it now? > On Oct 10, 2014 4:10 PM, "David Johnson" wrote: > >> I recommend looking into Data.Acid.Remote if you plan on using >> acid-state. Will allow you to inspect your state using ghci. >> >> >> http://hackage.haskell.org/package/acid-state-0.12.2/docs/Data-Acid-Remote.html >> >> On Fri, Oct 10, 2014 at 2:55 PM, Britt Mathis >> wrote: >> >>> I was told about acid-state on irc, but I wasn't sure if it did the >>> incremental part - it looks like it will be perfect, thank you. And I will >>> definitely check out that paper as well. >>> On Oct 10, 2014 3:37 PM, "Nicolas Trangez" wrote: >>> >>>> On Fri, 2014-10-10 at 23:29 +0400, Nikita Volkov wrote: >>>> > There's "acid-state", which provides a log-based persistence model. >>>> I.e., >>>> > it persists the modifications you make to the data structure. >>>> >>>> You might also be interested in the paper 'Generic Storage in Haskell' >>>> by Sebastiaan Visser, and his thesis about the same subject. >>>> >>>> Nicolas >>>> >>>> > >>>> > 2014-10-10 23:09 GMT+04:00 Britt Mathis : >>>> > >>>> > > Hello everyone, I'm not sure if something like this already exists >>>> so I >>>> > > figured I would ask here first before I reinvent the wheel. What I >>>> need is >>>> > > a data structure that behaves like Data.Map, but is serialized to >>>> disk >>>> > > incrementally so I only have the overhead of writing what has >>>> changed every >>>> > > time. >>>> > > >>>> > > _______________________________________________ >>>> > > Haskell-Cafe mailing list >>>> > > Haskell-Cafe at haskell.org >>>> > > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> > > >>>> > > >>>> > _______________________________________________ >>>> > Haskell-Cafe mailing list >>>> > Haskell-Cafe at haskell.org >>>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >>>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> >> -- >> Cell: 1.630.740.8204 >> > -- Cell: 1.630.740.8204 -------------- next part -------------- An HTML attachment was scrubbed... URL: From britt.mathis at gmail.com Fri Oct 10 21:06:17 2014 From: britt.mathis at gmail.com (Britt Mathis) Date: Fri, 10 Oct 2014 17:06:17 -0400 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: "Acid state has two logs on disk, one for events and another for checkpoints. " - does this mean that I choose which to do (for instance, I want the state to be saved every 10 minutes or so but obviously just the events), or does acid-state handle this internally? Essentially the app should (in a perfect world) never go offline, but I need something stored on disk to handle the event that it crashes, etc. I want the functionality that a map provides (index by a username, get a user, etc.). I know that a traditional database would give me the fault tolerance I want, but I don't need all of the features of a traditional database like postgre. All I need is some data structure that stores key value pairs, but also writes the state to disk at some interval of time (10 minutes, etc.). I could obviously just dump the entire thing every time but this is going to be a ton of overhead I would like to avoid. Let's say the map is currently [("foo", "bar"), ("baz", "quux")] and this is mirrored on disk. If I add another pair ("spam", "eggs") to the map, at the moment this is only in memory. At some time in the future, I need to replicate this addition in the structure on disk. There are two main ways I could do this (that I know of) - I could write all three pairs, or I could only add ("spam", "eggs") to the structure on disk somehow. This is the behavior I want. On Fri, Oct 10, 2014 at 4:52 PM, David Johnson wrote: > Britt, > > If you use the remote module you will have the ability to create multiple > states that can reside on multiple machines, so you won't be limited by the > RAM capacity of just one machine, and you can then use RPC calls to query > them from a web server or command line app. > > In order to minimize your memory footprint and keep things fast you could > use an IntMap to store your users (i.e. IntMap User). You could also install > ekg on the server that broadcasts your state to get a good idea of just how > large your state is. Since acid-state transactions are pure they complement > parallelism nicely as well. > > Alberto, > > Acid state has two logs on disk, one for events and another for checkpoints. > Checkpoints represent the entire serialized state. Events are incremental > changes on the state. Writing checkpoints is an expensive operation (since > the entire state will be written to disk from the MVar), and shouldn't be > done very often. > > Note on usability: > > If you have long event files, and you are constantly opening and closing > your state you will most likely experience poor performance. Since > acid-state will attempt to read the entire event log to recreate the state > in memory. Someone can correct me if I'm wrong. > > On Fri, Oct 10, 2014 at 3:15 PM, Britt Mathis > wrote: >> >> Someone on irc mentioned acid-state remote (it may have even been you), I >> will definitely be using it. My only worry is that I only have 512MB of Ram >> to work with atm, which should be fine until I have several thousand users. >> I see on the acid state website that I would need to integrate with >> something else to provide the ability to have a data structure larger than >> memory (I may be missing or misunderstanding something), would it be trivial >> to add this in later or should I be worried about it now? >> >> On Oct 10, 2014 4:10 PM, "David Johnson" wrote: >>> >>> I recommend looking into Data.Acid.Remote if you plan on using >>> acid-state. Will allow you to inspect your state using ghci. >>> >>> >>> http://hackage.haskell.org/package/acid-state-0.12.2/docs/Data-Acid-Remote.html >>> >>> On Fri, Oct 10, 2014 at 2:55 PM, Britt Mathis >>> wrote: >>>> >>>> I was told about acid-state on irc, but I wasn't sure if it did the >>>> incremental part - it looks like it will be perfect, thank you. And I will >>>> definitely check out that paper as well. >>>> >>>> On Oct 10, 2014 3:37 PM, "Nicolas Trangez" wrote: >>>>> >>>>> On Fri, 2014-10-10 at 23:29 +0400, Nikita Volkov wrote: >>>>> > There's "acid-state", which provides a log-based persistence model. >>>>> > I.e., >>>>> > it persists the modifications you make to the data structure. >>>>> >>>>> You might also be interested in the paper 'Generic Storage in Haskell' >>>>> by Sebastiaan Visser, and his thesis about the same subject. >>>>> >>>>> Nicolas >>>>> >>>>> > >>>>> > 2014-10-10 23:09 GMT+04:00 Britt Mathis : >>>>> > >>>>> > > Hello everyone, I'm not sure if something like this already exists >>>>> > > so I >>>>> > > figured I would ask here first before I reinvent the wheel. What I >>>>> > > need is >>>>> > > a data structure that behaves like Data.Map, but is serialized to >>>>> > > disk >>>>> > > incrementally so I only have the overhead of writing what has >>>>> > > changed every >>>>> > > time. >>>>> > > >>>>> > > _______________________________________________ >>>>> > > Haskell-Cafe mailing list >>>>> > > Haskell-Cafe at haskell.org >>>>> > > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> > > >>>>> > > >>>>> > _______________________________________________ >>>>> > Haskell-Cafe mailing list >>>>> > Haskell-Cafe at haskell.org >>>>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>>>> >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>> >>> >>> >>> -- >>> Cell: 1.630.740.8204 > > > > > -- > Cell: 1.630.740.8204 From 0slemi0 at gmail.com Fri Oct 10 23:38:42 2014 From: 0slemi0 at gmail.com (Andras Slemmer) Date: Sat, 11 Oct 2014 01:38:42 +0200 Subject: [Haskell-cafe] cabal sandbox using absolute path on symlinked dir In-Reply-To: References: <5437E9C3.60705@gmail.com> Message-ID: Cabal sandboxes as it stands right now are not portable at all, global paths are only the beginning. For example you cannot use a sandbox created on another machine by default, unless you have *exactly* the same environment (e.g. use the same build of the Haskell Platform). I wrote a small tool called SandFix that we use internally at my workplace that fixes global paths and tries to fix all package dependencies as well so you can reuse a sandbox created on another machine. I uploaded it now to github: https://github.com/exFalso/sandfix. It works quite well for us. Note that it assumes a ghc environment. On 10 October 2014 21:00, Markus L?ll wrote: > I would also prefer relative paths for sandboxes. > > On Fri, Oct 10, 2014 at 4:34 PM, Corentin Dupont < > corentin.dupont at gmail.com> wrote: > >> This project seems to do what you want (I didn't test it): >> https://github.com/philopon/sandbox-move >> >> Although I think it would be better to have relative file paths in >> cabal.sandbox.config... >> >> On Fri, Oct 10, 2014 at 4:29 PM, Brandon Allbery >> wrote: >> >>> On Fri, Oct 10, 2014 at 10:14 AM, Vlatko Basic >>> wrote: >>> >>>> There is no way to move the project to a different place without >>>> recreating the whole sandbox. >>> >>> >>> It would be nice if there were a tool to do this. It should not be >>> difficult to programmatically adjust those paths and the ones in the ghc >>> package directory, and reindex the latter. >>> >>> -- >>> brandon s allbery kf8nh sine nomine >>> associates >>> allbery.b at gmail.com >>> ballbery at sinenomine.net >>> unix, openafs, kerberos, infrastructure, xmonad >>> http://sinenomine.net >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Markus L?ll > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lambda.fairy at gmail.com Sat Oct 11 08:12:03 2014 From: lambda.fairy at gmail.com (Chris Wong) Date: Sat, 11 Oct 2014 21:12:03 +1300 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: On Sat, Oct 11, 2014 at 10:06 AM, Britt Mathis wrote: > "Acid state has two logs on disk, one for events and another for > checkpoints. " - does this mean that I choose which to do (for > instance, I want the state to be saved every 10 minutes or so but > obviously just the events), or does acid-state handle this internally? It appends events to a journal automatically, but only saves checkpoints when you explicitly tell it to. Usually checkpointing happens when the server shuts down (saveCheckpointAndClose) but you probably want to trigger it manually every night or so. This process runs in the background, so your application can stay online while the checkpoint is saved. Note that saving checkpoints is only an optimization; acid-state can reconstruct your data from the event log alone. Having a recent checkpoint does makes startup/recovery faster though, and saves space on disk. Hackage is a very prominent user of acid-state. You might like to look into how they do things. Chris From ollie at ocharles.org.uk Sat Oct 11 09:52:18 2014 From: ollie at ocharles.org.uk (Oliver Charles) Date: Sat, 11 Oct 2014 10:52:18 +0100 Subject: [Haskell-cafe] Pretty Printing Libraries with an Emphasis on Consistency Message-ID: Hi all, It seems that all of the pretty printing libraries on Hackage at the moment have an emphasis on being compact, but not necessarily consistent. By consistent, I mean that similar blocks of code are indented in the same fashion, even when not strictly necessary. Take for example, the start of "Pretty Printing with Lazy Dequeues". Here, the example is: if True then if True then True else True else if False then False else False I call this inconsistent, because the two sides of the top-level if have been formatted under different rules. A consistent formatting of this would be: if True then if True then True else True else if False then False else False The above can obviously be reached if you *always* format `if` in this style, but that's not what I'm after. If it's possible to format both sides on one-line, then that should be preferred. So an equally desirable output (that meets my "consistency" requirement) is: if True then if True then True else True else if True then True else True It doesn't seem that there is a library on Hackage that lets one express such a pretty printer. It seems that a pretty printer of this nature would need to have some sort of backtracking ability - I can imagine trying to print both sides of the if statement on one-line, and if this fails, try printing *both* on multiple lines. Curious to hear what people have to say on this matter, - ocharles -------------- next part -------------- An HTML attachment was scrubbed... URL: From kyle.marek.spartz at gmail.com Sat Oct 11 14:17:06 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Sat, 11 Oct 2014 09:17:06 -0500 Subject: [Haskell-cafe] Pretty Printing Libraries with an Emphasis on Consistency In-Reply-To: References: Message-ID: Something like this would be useful for making an hsfmt or something similar. Stylish-haskell does some of this, but it is rather opinionated. ? Kyle Marek-Spartz On Oct 11, 2014, 4:52:18 AM, Oliver Charles wrote: Hi all, It seems that all of the pretty printing libraries on Hackage at the moment have an emphasis on being compact, but not necessarily consistent. By consistent, I mean that similar blocks of code are indented in the same fashion, even when not strictly necessary. Take for example, the start of "Pretty Printing with Lazy Dequeues". Here, the example is: if True then if True then True else True else if False then False else False I call this inconsistent, because the two sides of the top-level if have been formatted under different rules. A consistent formatting of this would be: if True then if True then True else True else if False then False else False The above can obviously be reached if you *always* format `if` in this style, but that's not what I'm after. If it's possible to format both sides on one-line, then that should be preferred. So an equally desirable output (that meets my "consistency" requirement) is: if True then if True then True else True else if True then True else True It doesn't seem that there is a library on Hackage that lets one express such a pretty printer. It seems that a pretty printer of this nature would need to have some sort of backtracking ability - I can imagine trying to print both sides of the if statement on one-line, and if this fails, try printing *both* on multiple lines. Curious to hear what people have to say on this matter, - ocharles _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe at haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat Oct 11 14:36:47 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 11 Oct 2014 10:36:47 -0400 Subject: [Haskell-cafe] Map with incremental serialization In-Reply-To: References: <1412969850.2876.18.camel@chi.nicolast.be> Message-ID: Another option would be to use something like sqlite or lmdb as a library. On Oct 11, 2014 4:12 AM, "Chris Wong" wrote: > On Sat, Oct 11, 2014 at 10:06 AM, Britt Mathis > wrote: > > "Acid state has two logs on disk, one for events and another for > > checkpoints. " - does this mean that I choose which to do (for > > instance, I want the state to be saved every 10 minutes or so but > > obviously just the events), or does acid-state handle this internally? > > It appends events to a journal automatically, but only saves > checkpoints when you explicitly tell it to. > > Usually checkpointing happens when the server shuts down > (saveCheckpointAndClose) but you probably want to trigger it manually > every night or so. This process runs in the background, so your > application can stay online while the checkpoint is saved. > > Note that saving checkpoints is only an optimization; acid-state can > reconstruct your data from the event log alone. Having a recent > checkpoint does makes startup/recovery faster though, and saves space > on disk. > > Hackage is a very prominent user of acid-state. You might like to look > into how they do things. > > Chris > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ollie at ocharles.org.uk Sat Oct 11 16:00:39 2014 From: ollie at ocharles.org.uk (Oliver Charles) Date: Sat, 11 Oct 2014 17:00:39 +0100 Subject: [Haskell-cafe] Pretty Printing Libraries with an Emphasis on Consistency In-Reply-To: References: Message-ID: Yes, hindent is exponential in its pretty printing and that's exactly the program I'm trying to speed up ;) To be specific, hindent has `sandbox` which runs a printer and then lets me make decisions on what the resulting state might be. I'm curious if there are other approaches. - ocharles On Sat, Oct 11, 2014 at 12:01 PM, Alan & Kim Zimmerman wrote: > Have you looked at hindent? > On 11 Oct 2014 11:52 AM, "Oliver Charles" wrote: > >> Hi all, >> >> It seems that all of the pretty printing libraries on Hackage at the >> moment have an emphasis on being compact, but not necessarily consistent. >> By consistent, I mean that similar blocks of code are indented in the same >> fashion, even when not strictly necessary. >> >> Take for example, the start of "Pretty Printing with Lazy Dequeues". >> Here, the example is: >> >> if True >> then if True then True else True >> else >> if False >> then False >> else False >> >> I call this inconsistent, because the two sides of the top-level if have >> been formatted under different rules. A consistent formatting of this would >> be: >> >> if True >> then >> if True >> then True >> else True >> else >> if False >> then False >> else False >> >> The above can obviously be reached if you *always* format `if` in this >> style, but that's not what I'm after. If it's possible to format both sides >> on one-line, then that should be preferred. So an equally desirable output >> (that meets my "consistency" requirement) is: >> >> if True >> then if True then True else True >> else if True then True else True >> >> It doesn't seem that there is a library on Hackage that lets one express >> such a pretty printer. It seems that a pretty printer of this nature would >> need to have some sort of backtracking ability - I can imagine trying to >> print both sides of the if statement on one-line, and if this fails, try >> printing *both* on multiple lines. >> >> Curious to hear what people have to say on this matter, >> - ocharles >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at nh2.me Sat Oct 11 22:53:04 2014 From: mail at nh2.me (=?windows-1252?Q?Niklas_Hamb=FCchen?=) Date: Sun, 12 Oct 2014 00:53:04 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> Message-ID: <5439B4D0.6070701@nh2.me> Is anything coming out of this? Will builds come back? From djohnson.m at gmail.com Sat Oct 11 22:58:06 2014 From: djohnson.m at gmail.com (David Johnson) Date: Sat, 11 Oct 2014 17:58:06 -0500 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <5439B4D0.6070701@nh2.me> References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> Message-ID: Niklas, This can be used to manually upload hackage docs in the meantime. https://github.com/ekmett/lens/blob/master/scripts/hackage-docs.sh On Sat, Oct 11, 2014 at 5:53 PM, Niklas Hamb?chen wrote: > Is anything coming out of this? > > Will builds come back? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Cell: 1.630.740.8204 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at nh2.me Sat Oct 11 23:01:49 2014 From: mail at nh2.me (=?UTF-8?B?TmlrbGFzIEhhbWLDvGNoZW4=?=) Date: Sun, 12 Oct 2014 01:01:49 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> Message-ID: <5439B6DD.6000304@nh2.me> On 12/10/14 00:58, David Johnson wrote: > Niklas, This can be used to manually upload hackage docs in the meantime. I know, but I don't need a workaround. I want to know what the current state / plan is. From mikolaj at well-typed.com Sat Oct 11 23:24:26 2014 From: mikolaj at well-typed.com (Mikolaj Konarski) Date: Sun, 12 Oct 2014 01:24:26 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <5439B6DD.6000304@nh2.me> References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> Message-ID: > Will builds come back? Looking at http://hackage.haskell.org/packages/recent I have the impression it works OK now (with some delay, as always). Are you still experiencing problems? For a package uploaded right now or in the preceding weeks? From agocorona at gmail.com Sat Oct 11 23:37:45 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Sun, 12 Oct 2014 01:37:45 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> Message-ID: In my case, the two packages are still not built. I looked at some others which had documentation generated since then, for example: https://hackage.haskell.org/package/haste-compiler-0.4.3 But the documentation seem not to be generated by hackage, since there is no activity log: is empty: https://hackage.haskell.org/package/haste-compiler-0.4.3/reports/ It may have been uploaded. It is not a problem of documentation but the entire build process. That is a big issue. Can we contribute in some way?. computing power should not be a problem today.... 2014-10-12 1:24 GMT+02:00 Mikolaj Konarski : > > Will builds come back? > > Looking at > > http://hackage.haskell.org/packages/recent > > I have the impression it works OK now (with some delay, as always). > Are you still experiencing problems? For a package uploaded > right now or in the preceding weeks? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Oct 12 00:14:26 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 11 Oct 2014 20:14:26 -0400 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> Message-ID: Its a matter of manpower on the entirely volunteers infrastructure team. Talk with them Ti figure out how you can help. A few people are working on setting up some mitigation, but I hesitate to name names until we've gotten the mitigations running live. On Oct 11, 2014 7:38 PM, "Alberto G. Corona" wrote: > In my case, the two packages are still not built. I looked at some others > which had documentation generated since then, for example: > > https://hackage.haskell.org/package/haste-compiler-0.4.3 > > But the documentation seem not to be generated by hackage, since there is > no activity log: is empty: > > https://hackage.haskell.org/package/haste-compiler-0.4.3/reports/ > > It may have been uploaded. > > It is not a problem of documentation but the entire build process. That is > a big issue. Can we contribute in some way?. computing power should not be > a problem today.... > > > > > > 2014-10-12 1:24 GMT+02:00 Mikolaj Konarski : > >> > Will builds come back? >> >> Looking at >> >> http://hackage.haskell.org/packages/recent >> >> I have the impression it works OK now (with some delay, as always). >> Are you still experiencing problems? For a package uploaded >> right now or in the preceding weeks? >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > > -- > Alberto. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Sun Oct 12 08:27:08 2014 From: magnus at therning.org (Magnus Therning) Date: Sun, 12 Oct 2014 10:27:08 +0200 Subject: [Haskell-cafe] Current state-of-the-art in getting a dev env set up (windows 8) In-Reply-To: References: Message-ID: <20141012082708.GD3323@tatooine> On Thu, Oct 09, 2014 at 11:39:48PM -0400, Michal Antkiewicz wrote: > The one you have with git might work as well. I used to use > GetMinGWInstaller to install MSYS before. > > MSYS2 is a "modern" version of MSYS and it's recommended on > HaskellWiki, so I'm going with that. Also note that MSYS2 comes with a recent version of git, so no need to install git-on-windows with its own msys bundle. Unless you want some git gui-ness of course. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Code as if whoever maintains your program is a violent psychopath who knows where you live. -- Anonymous -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From alois.cochard at gmail.com Sun Oct 12 08:45:50 2014 From: alois.cochard at gmail.com (Alois Cochard) Date: Sun, 12 Oct 2014 09:45:50 +0100 Subject: [Haskell-cafe] Current state-of-the-art in getting a dev env set up (windows 8) In-Reply-To: References: Message-ID: Hi Michal, I'm the author of codex and I would love to make it compatible with Windows! It might be an issue related with paths or calling the tagger command... There is few things I have in mind. If you are interested, I would love to continue the discussion on the bug tracker. Do you mind creating a ticket with as much information you can provide (error messages,...)? Thanks a lot! On Oct 10, 2014 2:58 AM, "Michal Antkiewicz" wrote: > This is a question I am often asking myself as well. Here are a few points: > > 1. definitely install MSYS2 > see links here http://www.haskell.org/haskellwiki/Windows > > 2. I used Sublime Text 2 as well, switched to 3 now and it works great so > far > > 3. Yes, installing the dev tools is a pain on Windows. It almost never > just works. I install dev tools into the user space and always use > sandboxes for projects. Currently I managed to install the following > versions. You have to use these specific versions. > > aeson-0.7.0.6 > ghc-mod-4.1.6 > haddock-2.14.3 > haskell-docs-4.2.2 > haskell-src-exts-1.15.0.1 > hasktags-0.69.0 > hlint-1.9.4 > > I could never get codex to work on Windows with Haskell Platform. > > 4. I also recommend ghc-vis package, which only today I managed to > successfully install: > http://felsin9.de/nnis/ghc-vis/installing-windows/ > -- do not use `--enable-shared` in the last command > > ghc-heap-view-0.5.3 > ghc-vis-0.7.2.5 > > 5. with hdevtools, you have to get the windows fork and pull one of the > branches which makes it work with GHC-7.8.3 (I forgot exactly which one I > pulled from). The fork is not maintained. I am hoping that `ghc-modi` will > eventually replace `hdevtools` for SublimeHaskell. > > Hope that helps to get you going. On Linux everything just works when you > get GHC and cabal-install. > > Cheers, > Michal > > On Thu, Oct 9, 2014 at 9:15 PM, Alistair Bayley > wrote: > >> What is the current advice for getting a haskell dev env set up on >> windows? There's a lot of options, and it can be hard to quickly determine >> which are current and which are deprecated/bit-rotted. >> >> For example, apparently cabal sandbox is preferred over cabal-dev these >> days. >> >> I've read: >> http://onoffswitch.net/started-haskell/ >> http://stackoverflow.com/questions/304614/haskell-on-windows-setup >> http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html >> http://bob.ippoli.to/archives/2013/01/11/getting-started-with-haskell/ >> >> >> I've installed the latest haskell platform (2014.2), and am using Sublime >> Text 2 as my editor. SublimeHaskell is installed, but apparently it needs >> aeson, haskell-src-ext, and haddock. cabal install aeson indicates that it >> will break unordered-containers-0.2.4.0 and case-insensitive-1.1.0.3, so I >> must use --force-reinstalls to get it. I'm doing this in a sandbox, in case >> it is a terrible idea. >> >> https://github.com/SublimeHaskell/SublimeHaskell >> >> Not yet sure how I'm going to get the sandbox install of these tools to >> work with SublimeHaskell. Presumably some PATH magic? >> >> hdevtools looks cool and seems like it can be used from SublimeHaskell, >> although a windows install is from a fork. Will install ghc-mod too. >> >> What else am I missing? >> >> Thanks, >> Alistair >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shumovichy at gmail.com Sun Oct 12 10:53:39 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Sun, 12 Oct 2014 13:53:39 +0300 Subject: [Haskell-cafe] Library for URL/URI? Message-ID: <1413111219.7296.0.camel@gmail.com> Hello, Probably a silly question... But do we have good library for URL manipulations? I spent 2 days looking for library, that - has permissive license - doesn't use `String` everywhere - handles query part parsing/rendering - has minimal dependencies (Probably URL lib should not depend on anything outside Haskell Platform.) The best thing I found so far is https://github.com/Soostone/uri-bytestring It has few unnecessary dependencies (like http-types or errors,) but I can fork it and fix for my needs. Unfortunately it has unclear license -- BSD3 according to cabal file, but GPL-3 in source header. Are there better libs I missed? What are you using for URLs? Thanks, Yuras From fuuzetsu at fuuzetsu.co.uk Sun Oct 12 11:50:16 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Sun, 12 Oct 2014 12:50:16 +0100 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> Message-ID: <543A6AF8.5060305@fuuzetsu.co.uk> On 10/12/2014 01:14 AM, Carter Schonwald wrote: > Its a matter of manpower on the entirely volunteers infrastructure team. > Talk with them Ti figure out how you can help. > > A few people are working on setting up some mitigation, but I hesitate to > name names until we've gotten the mitigations running live. The biggest problem is that there is no official statement as to why the builds stopped and an estimate of when they are coming back. > On Oct 11, 2014 7:38 PM, "Alberto G. Corona" wrote: > >> In my case, the two packages are still not built. I looked at some others >> which had documentation generated since then, for example: >> >> https://hackage.haskell.org/package/haste-compiler-0.4.3 >> >> But the documentation seem not to be generated by hackage, since there is >> no activity log: is empty: >> >> https://hackage.haskell.org/package/haste-compiler-0.4.3/reports/ >> >> It may have been uploaded. >> >> It is not a problem of documentation but the entire build process. That is >> a big issue. Can we contribute in some way?. computing power should not be >> a problem today.... >> >> >> >> >> >> 2014-10-12 1:24 GMT+02:00 Mikolaj Konarski : >> >>>> Will builds come back? >>> >>> Looking at >>> >>> http://hackage.haskell.org/packages/recent >>> >>> I have the impression it works OK now (with some delay, as always). >>> Are you still experiencing problems? For a package uploaded >>> right now or in the preceding weeks? >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> >> >> -- >> Alberto. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Mateusz K. From felipe.lessa at gmail.com Sun Oct 12 12:31:03 2014 From: felipe.lessa at gmail.com (Felipe Lessa) Date: Sun, 12 Oct 2014 09:31:03 -0300 Subject: [Haskell-cafe] Library for URL/URI? In-Reply-To: <1413111219.7296.0.camel@gmail.com> References: <1413111219.7296.0.camel@gmail.com> Message-ID: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 A widely used library that may or may not work for your use case is http-types [1]. Cheers, [1] http://hackage.haskell.org/package/http-types - -- Felipe. -----BEGIN PGP SIGNATURE----- iQJXBAEBCABBOhxGZWxpcGUgQWxtZWlkYSBMZXNzYSAobWV0ZWZpY2hhKSA8ZmVs aXBlLmxlc3NhQGdtYWlsLmNvbT4FAlQ6dIcACgkQp2TRhD6WaCmsKhAAmLeLZ7rU M/YjUFo/h/lYWzMzQntThuF7pJsnQ0jGVVAndm8ZpF497gU66mAE6Ep64PTwanaA E/drgBiwpj92ftK1hHCjy0v0B+WVDj+OZXaerIL4nbuC8eoy6QnJlV76V8lM3Dyt RvnnprZChmUyVcA4IjpGOguo9854sS8AXXy5hKtl3I1PA01b+kuuTZ9AukYFwppZ KSXQ2MuC2x26poJn152ChsOhN5iMne1YSCZB8IJzXaVoYgwNxN2JOjYt965jhdO8 1Ewn+PhMJZ0Eu+PRlLEyaNWhddGHF7/WFBM5dvI99JhlECEqU6jU65Qr831CFFB6 Bxy0QmIByBfdmQ2ar8OZhuSqzmVBAVb7054b/yxbPVheSn0CdIAoXk2MEiQ3Pfrd B2YU1TLcJY3ROB8a6gsxTkyGu67i1H/P0OvLAj2ln6YMYHnkw6pIk+UoXiWdmiqA zHhBmxKw8hYhjl55Yq28eWIUd9HJANswg1T6MPIMQoKRJO2eqVLqq+pX0A/tigrD G3qQObBO2IiCBKdNllSSyX0TcpGeWh7uKKocAIRY8fPZz1a9cSEGIzcVZ4sP1/F7 TTRStW7nWSi1cdyEXOrZX768+nwsMDc28Xv8zjth6trZPiftfNQAVFp86XaU/Xcy ld9af+rHTfx8G9zp0L06CawrKmnAdDbQHHE= =/eb7 -----END PGP SIGNATURE----- From oleg at okmij.org Sun Oct 12 13:39:04 2014 From: oleg at okmij.org (oleg at okmij.org) Date: Sun, 12 Oct 2014 09:39:04 -0400 (EDT) Subject: [Haskell-cafe] typed tagless-final interpretation examples broken with recent ghc Message-ID: <20141012133904.15626C38CB@www1.g3.pair.com> Mathijs Kwik wrote more than two months ago, on Aug 2 2014: > I've been reading up on typed tagless-final interpretations [1] and the > accompanying examples. > > It seems the stuff about CPS transformations does no longer compile, > probably because of stricter typing rules. I tried both ghc 7.6 and ghc > 7.8, which both give a different kind of error message. GHC 7.6 has introduced the ambiguity check, which has been causing quite a bit of pain. For an example, please see http://ghc.haskell.org/trac/ghc/ticket/9587 The example in that ticket is a simplified version of the tagless final CPS transformations. >From experience, the best solution to that sort of problems is to re-write the code. Often the result is simpler. This has been the case for CPS transformations. The new version of the tagless-final CPS transformations is notably shorter http://okmij.org/ftp/tagless-final/course/CPS.hs and it should work in any GHC with type families, including GHC 7.8.3. From erantapaa at gmail.com Sun Oct 12 14:30:15 2014 From: erantapaa at gmail.com (Erik Rantapaa) Date: Sun, 12 Oct 2014 09:30:15 -0500 Subject: [Haskell-cafe] Slides for "Adventures with Types" @ Functional Programming Exchange 2013? Message-ID: Hi, Does anyone know if the slides for Simon Peyton Jones' keynote talk at the Skillsmatter Functional Programming Exchange 2013 are available somewhere? Link to the video: https://skillsmatter.com/skillscasts/3842-keynote-3842 Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon at jonmsterling.com Sun Oct 12 17:58:02 2014 From: jon at jonmsterling.com (Jon Sterling) Date: Sun, 12 Oct 2014 10:58:02 -0700 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <543A6AF8.5060305@fuuzetsu.co.uk> References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> <543A6AF8.5060305@fuuzetsu.co.uk> Message-ID: <1413136682.3198333.178062293.3952F003@webmail.messagingengine.com> Indeed; this stuff is pretty much all done by volunteers so far as I know. So I'm not asking it to always work perfectly, but it would be nice to have a better way to find out that this stuff is turned off than just folklore and guessing. Perhaps in the future an announcement that explains the problem could be made? (Forgive me if one was made but I missed it) In the past, whether or not the documentation built for your package was a sort of cheap way to figure out if your package built for people other than you. Kind regards, Jon On Sun, Oct 12, 2014, at 04:50 AM, Mateusz Kowalczyk wrote: > On 10/12/2014 01:14 AM, Carter Schonwald wrote: > > Its a matter of manpower on the entirely volunteers infrastructure team. > > Talk with them Ti figure out how you can help. > > > > A few people are working on setting up some mitigation, but I hesitate to > > name names until we've gotten the mitigations running live. > > The biggest problem is that there is no official statement as to why the > builds stopped and an estimate of when they are coming back. > > > On Oct 11, 2014 7:38 PM, "Alberto G. Corona" wrote: > > > >> In my case, the two packages are still not built. I looked at some others > >> which had documentation generated since then, for example: > >> > >> https://hackage.haskell.org/package/haste-compiler-0.4.3 > >> > >> But the documentation seem not to be generated by hackage, since there is > >> no activity log: is empty: > >> > >> https://hackage.haskell.org/package/haste-compiler-0.4.3/reports/ > >> > >> It may have been uploaded. > >> > >> It is not a problem of documentation but the entire build process. That is > >> a big issue. Can we contribute in some way?. computing power should not be > >> a problem today.... > >> > >> > >> > >> > >> > >> 2014-10-12 1:24 GMT+02:00 Mikolaj Konarski : > >> > >>>> Will builds come back? > >>> > >>> Looking at > >>> > >>> http://hackage.haskell.org/packages/recent > >>> > >>> I have the impression it works OK now (with some delay, as always). > >>> Are you still experiencing problems? For a package uploaded > >>> right now or in the preceding weeks? > >>> _______________________________________________ > >>> Haskell-Cafe mailing list > >>> Haskell-Cafe at haskell.org > >>> http://www.haskell.org/mailman/listinfo/haskell-cafe > >>> > >> > >> > >> > >> -- > >> Alberto. > >> > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > >> > > > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > -- > Mateusz K. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From shumovichy at gmail.com Sun Oct 12 20:39:10 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Sun, 12 Oct 2014 23:39:10 +0300 Subject: [Haskell-cafe] Library for URL/URI? In-Reply-To: References: <1413111219.7296.0.camel@gmail.com> Message-ID: <1413146350.7296.2.camel@gmail.com> I don't know how I overlooked http-types... It is exactly what I need. Thank you a lot! btw, I see it depends on blaze-builder. What pros it has compared to bytestring's built-in Builder? (I'm trying to minimize my dependency chain as much as possible because it run out of control.) On Sun, 2014-10-12 at 09:31 -0300, Felipe Lessa wrote: > A widely used library that may or may not work for your use case is http-types [1]. > > Cheers, > > [1] http://hackage.haskell.org/package/http-types > > -- > Felipe. From magicloud.magiclouds at gmail.com Mon Oct 13 01:03:40 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Mon, 13 Oct 2014 09:03:40 +0800 Subject: [Haskell-cafe] Dependencies missing when building ghc. Message-ID: Hi, I am with my new Ubuntu Trusty box. I have installed ghc by apt-get. Then I wanted to build ghc from git to upgrade to 7.8.3. I did following commands. I tried 'make clean', or reget the source. No luck yet. $ git clone --recursive git://git.haskell.org/ghc.git $ ./sync-all -r git://git.haskell.org remote set-url origin $ git checkout ghc-7.8.3-release $ ./sync-all get $ rm -r libraries/time # as prompted by sync-all $ ./sync-all get $ ./boot $ ./configure $ make ===--- building phase 0 make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds make[1]: Nothing to be done for `phase_0_builds'. ===--- building phase 1 make -r --no-print-directory -f ghc.mk phase=1 phase_1_builds "inplace/bin/ghc-cabal" check libraries/haskell98 "inplace/bin/ghc-cabal" configure libraries/haskell98 dist-install "" --with-ghc="/home/local/ANT/shida/src/git/ghc/inplace/bin/ghc-stage1" --with-ghc-pkg="/home/local/ANT/shida/src/git/ghc/inplace/bin/ghc-pkg" --disable-library-for-ghci --enable-library-vanilla --enable-library-profiling --enable-shared --configure-option=CFLAGS=" -fno-stack-protector " --configure-option=LDFLAGS=" " --configure-option=CPPFLAGS=" " --gcc-options=" -fno-stack-protector " --with-gcc="/usr/bin/gcc" --with-ld="/usr/bin/ld" --configure-option=--with-cc="/usr/bin/gcc" --with-ar="/usr/bin/ar" --with-ranlib="/usr/bin/ranlib" --with-alex="/usr/bin/alex" --with-happy="/usr/bin/happy" Configuring haskell98-2.0.0.4... ghc-cabal: At least the following dependencies are missing: base ==4.8.* make[1]: *** [libraries/haskell98/dist-install/package-data.mk] Error 1 make: *** [all] Error 2 -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From rustompmody at gmail.com Mon Oct 13 03:36:31 2014 From: rustompmody at gmail.com (Rustom Mody) Date: Mon, 13 Oct 2014 09:06:31 +0530 Subject: [Haskell-cafe] value vs object orientation Message-ID: I was trying to explain to a colleague the difference in outlook between value and object orientation. I find some references like C#'s 'value-objects' vs the more usual 'reference-objects' But these kinds of references are very OOP-tilted. OTOH there are a few writings eg by Peter Wegner argung that the millennial philosophy divide between 'rationalism' and 'empiricism' corresponds to the division in programming between FP and OOP. Im looking for some more middle ground stuff -- not too stuck on one technological platform and yet not overly philosophical -------------- next part -------------- An HTML attachment was scrubbed... URL: From shumovichy at gmail.com Mon Oct 13 07:16:11 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Mon, 13 Oct 2014 10:16:11 +0300 Subject: [Haskell-cafe] Dependencies missing when building ghc. In-Reply-To: References: Message-ID: Hello, It is recommended to checkout 7.8 in special way, see https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources#checkout-old-branch That is because repo structure was changed after 7.8 Thanks, Yuras 13 ??? 2014 ?. 4:03 ???????????? "Magicloud Magiclouds" < magicloud.magiclouds at gmail.com> ???????: > Hi, > > I am with my new Ubuntu Trusty box. I have installed ghc by apt-get. > Then I wanted to build ghc from git to upgrade to 7.8.3. > > I did following commands. I tried 'make clean', or reget the source. No > luck yet. > > $ git clone --recursive git://git.haskell.org/ghc.git > $ ./sync-all -r git://git.haskell.org remote set-url origin > $ git checkout ghc-7.8.3-release > $ ./sync-all get > $ rm -r libraries/time # as prompted by sync-all > $ ./sync-all get > $ ./boot > $ ./configure > $ make > ===--- building phase 0 > make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds > make[1]: Nothing to be done for `phase_0_builds'. > ===--- building phase 1 > make -r --no-print-directory -f ghc.mk phase=1 phase_1_builds > "inplace/bin/ghc-cabal" check libraries/haskell98 > "inplace/bin/ghc-cabal" configure libraries/haskell98 dist-install "" > --with-ghc="/home/local/ANT/shida/src/git/ghc/inplace/bin/ghc-stage1" > --with-ghc-pkg="/home/local/ANT/shida/src/git/ghc/inplace/bin/ghc-pkg" > --disable-library-for-ghci --enable-library-vanilla > --enable-library-profiling --enable-shared --configure-option=CFLAGS=" > -fno-stack-protector " --configure-option=LDFLAGS=" " > --configure-option=CPPFLAGS=" " --gcc-options=" -fno-stack-protector > " --with-gcc="/usr/bin/gcc" --with-ld="/usr/bin/ld" > --configure-option=--with-cc="/usr/bin/gcc" --with-ar="/usr/bin/ar" > --with-ranlib="/usr/bin/ranlib" --with-alex="/usr/bin/alex" > --with-happy="/usr/bin/happy" > Configuring haskell98-2.0.0.4... > ghc-cabal: At least the following dependencies are missing: > base ==4.8.* > make[1]: *** [libraries/haskell98/dist-install/package-data.mk] Error 1 > make: *** [all] Error 2 > -- > ??????? > ??????? > > And for G+, please use magiclouds#gmail.com. > > _______________________________________________ > Glasgow-haskell-users mailing list > Glasgow-haskell-users at haskell.org > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apfelmus at quantentunnel.de Mon Oct 13 07:23:12 2014 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Mon, 13 Oct 2014 09:23:12 +0200 Subject: [Haskell-cafe] Pretty Printing Libraries with an Emphasis on Consistency In-Reply-To: References: Message-ID: Oliver Charles wrote: > Yes, hindent is exponential in its pretty printing and that's exactly the > program I'm trying to speed up ;) To be specific, hindent has `sandbox` > which runs a printer and then lets me make decisions on what the resulting > state might be. I'm curious if there are other approaches. I wager you need some kind of context-freeness to pretty print efficiently. At least, Wadler's pretty printer [1] makes use of that in section 2, where he argues that you can efficiently choose a minimal element in a huge set of possible layouts, the latter being represented by the type `Doc`. [1]: http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf If you allow non-context free restrictions on the possible layouts, as you do, then it's no longer clear to me how to efficiently pick an optimal one. To see whether this is a hard problem, you may want to do to the following test: Formalize (a subset of) the restrictions that you want to allow and check whether the problem is NP complete, i.e. whether you can encode solutions to an NP complete problem (knapsack?) as solutions of your desired layout algorithm. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From daniel.trstenjak at gmail.com Mon Oct 13 08:14:44 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Mon, 13 Oct 2014 10:14:44 +0200 Subject: [Haskell-cafe] Dependencies missing when building ghc. In-Reply-To: References: Message-ID: <20141013081444.GA3771@machine> > I am with my new Ubuntu Trusty box. I have installed ghc by apt-get. Then I > wanted to build ghc from git to upgrade to 7.8.3. If you only want to install a newer ghc version on ubuntu or even multiple ghc versions at once, then I can only recommend the excellent PPA of Herbert Valerio Riedel: https://launchpad.net/~hvr/+archive/ubuntu/ghc Greetings, Daniel From vlatko.basic at gmail.com Mon Oct 13 08:50:16 2014 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Mon, 13 Oct 2014 10:50:16 +0200 Subject: [Haskell-cafe] cabal sandbox using absolute path on symlinked dir In-Reply-To: References: <5437E9C3.60705@gmail.com> Message-ID: <543B9248.909@gmail.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: updSandbox.sh Type: application/x-shellscript Size: 2616 bytes Desc: not available URL: From vlatko.basic at gmail.com Mon Oct 13 08:55:22 2014 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Mon, 13 Oct 2014 10:55:22 +0200 Subject: [Haskell-cafe] cabal sandbox using absolute path on symlinked dir In-Reply-To: References: <5437E9C3.60705@gmail.com> Message-ID: <543B937A.7020608@gmail.com> An HTML attachment was scrubbed... URL: From patrick.browne at dit.ie Mon Oct 13 10:16:30 2014 From: patrick.browne at dit.ie (PATRICK BROWNE) Date: Mon, 13 Oct 2014 11:16:30 +0100 Subject: [Haskell-cafe] value vs object orientation In-Reply-To: References: Message-ID: The work of Kumiko Tanaka-Ishii [1,2,3] might interest you. In her book[1] she compares Haskell and Java Pat [1] http://www.cambridge.org/us/academic/subjects/psychology/cognition/semiotics-programming [2] http://french.chass.utoronto.ca/as-sa/ASSA-No20/Article1en.html [3] http://www.degruyter.com/dg/viewarticle/j$002fsemi.2006.2006.issue-158$002fsem.2006.006$002fsem.2006.006.xml;jsessionid=3484B3B2D6C9EA63F20051BCB97786CF On 13 October 2014 04:36, Rustom Mody wrote: > I was trying to explain to a colleague the difference in outlook between > value and object orientation. > > I find some references like C#'s 'value-objects' vs the more usual > 'reference-objects' But these kinds of references are very OOP-tilted. > > OTOH there are a few writings eg by Peter Wegner argung that the > millennial philosophy divide between 'rationalism' and 'empiricism' > corresponds to the division in programming between FP and OOP. > > Im looking for some more middle ground stuff -- not too stuck on one > technological platform and yet not overly philosophical > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- This email originated from DIT. If you received this email in error, please delete it from your system. Please note that if you are not the named addressee, disclosing, copying, distributing or taking any action based on the contents of this email or attachments is prohibited. www.dit.ie Is ? ITB?C a th?inig an r?omhphost seo. M? fuair t? an r?omhphost seo tr? earr?id, scrios de do ch?ras ? le do thoil. Tabhair ar aird, mura t? an seola? ainmnithe, go bhfuil dianchosc ar aon nochtadh, aon ch?ipe?il, aon d?ileadh n? ar aon ghn?omh a dh?anfar bunaithe ar an ?bhar at? sa r?omhphost n? sna hiat?in seo. www.dit.ie T? ITB?C ag aistri? go Gr?inseach Ghorm?in ? DIT is on the move to Grangegorman -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander at plaimi.net Mon Oct 13 10:50:24 2014 From: alexander at plaimi.net (Alexander Berntsen) Date: Mon, 13 Oct 2014 12:50:24 +0200 Subject: [Haskell-cafe] Slides for "Adventures with Types" @ Functional Programming Exchange 2013? In-Reply-To: References: Message-ID: <543BAE70.6020108@plaimi.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 12/10/14 16:30, Erik Rantapaa wrote: > Does anyone know if the slides for Simon Peyton Jones' keynote > talk at the Skillsmatter Functional Programming Exchange 2013 are > available somewhere? Anyone know if the video itself is available somewhere where it may be viewed without using proprietary software? - -- Alexander alexander at plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlQ7rnAACgkQRtClrXBQc7XpigD+JykaAkREvAIujYVc2eX3u9cn hXCpNOau5PmUfD9cSPMBALImLYe9Y2oqNUDy8Jkl1KDpQAepC9JQqCnBIk4jowcT =r+5K -----END PGP SIGNATURE----- From rustompmody at gmail.com Mon Oct 13 12:42:53 2014 From: rustompmody at gmail.com (Rustom Mody) Date: Mon, 13 Oct 2014 18:12:53 +0530 Subject: [Haskell-cafe] value vs object orientation In-Reply-To: References: Message-ID: On Mon, Oct 13, 2014 at 3:46 PM, PATRICK BROWNE wrote: > The work of Kumiko Tanaka-Ishii [1,2,3] might interest you. > In her book[1] she compares Haskell and Java > Pat > [1] > http://www.cambridge.org/us/academic/subjects/psychology/cognition/semiotics-programming > > [2] http://french.chass.utoronto.ca/as-sa/ASSA-No20/Article1en.html > > [3] > http://www.degruyter.com/dg/viewarticle/j$002fsemi.2006.2006.issue-158$002fsem.2006.006$002fsem.2006.006.xml;jsessionid=3484B3B2D6C9EA63F20051BCB97786CF > Thanks the book looks quite interesting; Ive to yet lay my hand son it! The article is on the other hand entirely java-centric. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben at smart-cactus.org Mon Oct 13 14:59:28 2014 From: ben at smart-cactus.org (Ben Gamari) Date: Mon, 13 Oct 2014 10:59:28 -0400 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <1413136682.3198333.178062293.3952F003@webmail.messagingengine.com> References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> <543A6AF8.5060305@fuuzetsu.co.uk> <1413136682.3198333.178062293.3952F003@webmail.messagingengine.com> Message-ID: <87egucvwvj.fsf@gmail.com> Jon Sterling writes: > Indeed; this stuff is pretty much all done by volunteers so far as I > know. So I'm not asking it to always work perfectly, but it would be > nice to have a better way to find out that this stuff is turned off than > just folklore and guessing. Perhaps in the future an announcement that > explains the problem could be made? (Forgive me if one was made but I > missed it) > Perhaps it would make sense for those involved in the infrastructure effort to maintain a status page on the wiki for these sorts of things. It doesn't need to be much, just a quick sentence or two describing what they are currently working on. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 472 bytes Desc: not available URL: From creswick at gmail.com Mon Oct 13 15:25:23 2014 From: creswick at gmail.com (Rogan Creswick) Date: Mon, 13 Oct 2014 08:25:23 -0700 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) Message-ID: On Sun, Oct 12, 2014 at 4:50 AM, Mateusz Kowalczyk wrote: > > The biggest problem is that there is no official statement as to why the > builds stopped and an estimate of when they are coming back. > I agree! My understanding (which is at /least/ 2nd or 3rd hand) is that the doc builds were turned off intentionally because it was a security issue, and that they are unlikely to come back. Now, assuming that is the case, how can we solve the "there is no documentation" issue? Some ideas to kick-start discussion: - Provide an option to include haddocks in the sdist bundle, and extract them on Hackage for display. - Add a 'cabal uploadHaddock' - Run all haddock builds in a VM/docker container / etc.. that mitigates the security concerns. - ??? --Rogan -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at functionaljobs.com Mon Oct 13 16:00:01 2014 From: sean at functionaljobs.com (Functional Jobs) Date: Mon, 13 Oct 2014 12:00:01 -0400 Subject: [Haskell-cafe] New Functional Programming Job Opportunities Message-ID: <543bf7063bb45@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Functional Software Engineer at Cake Solutions Ltd http://functionaljobs.com/jobs/8755-functional-software-engineer-at-cake-solutions-ltd Software Engineer / Developer at Clutch Analytics/ Windhaven Insurance http://functionaljobs.com/jobs/8753-software-engineer-developer-at-clutch-analytics-windhaven-insurance Cheers, Sean Murphy FunctionalJobs.com From michael at orlitzky.com Mon Oct 13 16:02:27 2014 From: michael at orlitzky.com (Michael Orlitzky) Date: Mon, 13 Oct 2014 12:02:27 -0400 Subject: [Haskell-cafe] Slides for "Adventures with Types" @ Functional Programming Exchange 2013? In-Reply-To: <543BAE70.6020108@plaimi.net> References: <543BAE70.6020108@plaimi.net> Message-ID: <543BF793.20906@orlitzky.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 10/13/2014 06:50 AM, Alexander Berntsen wrote: > On 12/10/14 16:30, Erik Rantapaa wrote: >> Does anyone know if the slides for Simon Peyton Jones' keynote >> talk at the Skillsmatter Functional Programming Exchange 2013 are >> available somewhere? > Anyone know if the video itself is available somewhere where it > may be viewed without using proprietary software? Step 1: ACCEPT_KEYWORDS="~amd64" emerge youtube-dl Or get it from github or whatever. Steps 2: Haskell eXchange 2013 - --------------------- a) Lenses: compositional data access and manipulation. $ youtube-dl player.vimeo.com/video/76506719 b) Everyone should use a Generics library - writing HLint with Uniplate (Alas, not working) c) Compiling Haskell to Javascript with Fay (Alas, not working) d) Monads for free! $ youtube-dl player.vimeo.com/video/76519017 e) Embedded domain specific languages at Scrive $ youtube-dl player.vimeo.com/video/76522370 f) Haskell at Erudify $ youtube-dl player.vimeo.com/video/76527164 Haskell eXchange 2014 - --------------------- a) Categories for the Working Haskeller $ youtube-dl player.vimeo.com/video/108449685 b) Performance Measurement and Optimization in Haskell (Alas, not working) c) Coping with change: data schema migration in Haskell $ youtube-dl player.vimeo.com/video/108471328 d) Rest - Building APIs Easily $ youtube-dl player.vimeo.com/video/108574311 e) Structural Typing for Structured Products $ youtube-dl player.vimeo.com/video/108776550 f) Safe, Zero-Cost Coercions in Haskell $ youtube-dl player.vimeo.com/video/108366081 g) Park Bench Panel Discussion $ youtube-dl player.vimeo.com/video/108388729 h) Strongly Typed Publish/Subscribe over Websockets via Singleton Types $ youtube-dl player.vimeo.com/video/108588522 Functional Programming eXchange 2013 - ------------------------------------ a) Adventures with types $ youtube-dl player.vimeo.com/video/61876813 b) Across Time and Address Space: Lift 3.0 (Alas, not working) c) Elnode: the evented IO web server $ youtube-dl player.vimeo.com/video/61881888 d) Comparing Scala and Clojure $ youtube-dl player.vimeo.com/video/61887425 e) Developing with F# in the Cloud $ youtube-dl player.vimeo.com/video/61892489 f) Reducing cognitive bias in design with Scala $ youtube-dl player.vimeo.com/video/61896637 g) LexiFi: describing financial contracts and extending OCaml $ youtube-dl player.vimeo.com/video/61901466 h) F# in the open source world $ youtube-dl player.vimeo.com/video/61906490 i) Functional Data Storage $ youtube-dl player.vimeo.com/video/61910320 Functional Programming eXchange 2014 - ------------------------------------ a) A practical theory of language-integrated query $ youtube-dl player.vimeo.com/video/89089688 b) Build Your Own Lisp for Great Justice $ youtube-dl player.vimeo.com/video/89102823 c) Data Science using Functional Programming $ youtube-dl player.vimeo.com/video/89104639 d) Teaching an old dog new tricks: wrapping an imperative API in a functional one $ youtube-dl player.vimeo.com/video/89109655 e) Railway Oriented Programming $ youtube-dl player.vimeo.com/video/89115848 f) My other operating system is a Mirage (Alas, not working) g) Park Bench Panel at #FPX $ youtube-dl player.vimeo.com/video/89131412 h) QuickChecking Riak $ youtube-dl player.vimeo.com/video/89125615 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0 iQJ8BAEBCgBmBQJUO/eTXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQxNEU5RDcyRDdCMUFGREVGQzBCNDFDMUY2 RjQ4RDNEQTA1QzJEQURCAAoJEG9I09oFwtrbY8QP/jNUOJX+ojCAeIQEZmk1vEkA S1V7/2h0zf19gS7GGJMlJPK6RmSkRGZfX9Wioy59Y46XwgfKGZKy9DRt2e/creny 5GlEuYfiyFUHAJl15Ef1FLXTbjxJxK23f7e57aqCncN8YqUgXEX44OMX4Clnso4l Cci5X0y021fCsYCpOn3usouJ/Xz89bN3WF6D4MFdGwyKTq8djJGQ/TK5LBNPxOiA iOFC/Q0ZkIYPHlsaFo6rPUgnp51I1iahbtA4zztjX5EuJFtDWGyshnYOj3v4snfR GKEoj98QXjKI3UW4eXE5Gu7jlE6ZZ7HP+0XOZkxOw0lYoCFu5tAcpmZ4AdTDfHW3 YSM7aZBORWUC0pSYnrVtgpXiY8Jdn2LnaGKzXhuJqLBY15YWMCltKffne1LJxh1n 60JFxM/HOe0BDD1MESU5F7hSbtog7ZOOvhRJzM4mSc7190E0B/45Smhci6rhyed3 vNDxe7fbFu5MDy19zlEy7ept2ZV8GoAxg1po60fSWtRoB4A/5RzZVSInixwkuS0Y Tj7vG1E/y81BhILam2sq+l0DKzNeuknMcILWnfXwx3OdjOfKc5TVMX5fTeS4fFmk UnJSKThIlFrqGafcECQQHG5ZG1dk+9Uf3b6yrmoQjlTNiki6KfvsrFZLbnCIBFkv JUF5HrpvMWHNziKYd80F =O5uA -----END PGP SIGNATURE----- From fuuzetsu at fuuzetsu.co.uk Mon Oct 13 16:20:11 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Mon, 13 Oct 2014 17:20:11 +0100 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: Message-ID: <543BFBBB.5090809@fuuzetsu.co.uk> On 10/13/2014 04:25 PM, Rogan Creswick wrote: > On Sun, Oct 12, 2014 at 4:50 AM, Mateusz Kowalczyk > wrote: >> >> The biggest problem is that there is no official statement as to why the >> builds stopped and an estimate of when they are coming back. >> > > I agree! > > My understanding (which is at /least/ 2nd or 3rd hand) is that the doc > builds were turned off intentionally because it was a security issue, and > that they are unlikely to come back. > > Now, assuming that is the case, how can we solve the "there is no > documentation" issue? Some ideas to kick-start discussion: > > - Provide an option to include haddocks in the sdist bundle, and extract > them on Hackage for display. > - Add a 'cabal uploadHaddock' > - Run all haddock builds in a VM/docker container / etc.. that mitigates > the security concerns. > - ??? > > --Rogan > What I heard is that it's the combination of the recent server migration and then running out of disk space. It seems that whoever I ask, they always have heard from someone else? AFAIK there is some movement towards having ?cabal uploadHaddock? already. -- Mateusz K. From mikolaj at well-typed.com Mon Oct 13 16:23:27 2014 From: mikolaj at well-typed.com (Mikolaj Konarski) Date: Mon, 13 Oct 2014 18:23:27 +0200 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: <87egucvwvj.fsf@gmail.com> References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> <543A6AF8.5060305@fuuzetsu.co.uk> <1413136682.3198333.178062293.3952F003@webmail.messagingengine.com> <87egucvwvj.fsf@gmail.com> Message-ID: I was wrong and you were right about the halted haddock building. So I asked around and, just as Carter reports, I confirmed a few kind people are currently working on setting up new doc building bots and it doesn't look too bad. If you'd like to offer help to the volunteer infrastructure team, please send a message to the haskell-infrastructure list at http://community.galois.com/pipermail/haskell-infrastructure or keep pinging people on #haskell-infrastructure on freenode IRC. This is also where you can, with some luck, get information about the current status of the infrastructure. Major disruptions are usually reported on https://status.haskell.org/ but the page needs to be manually updated and, as we can see, it's not always accurate when partial disruptions take place. Cheers, Mikolaj From carter.schonwald at gmail.com Mon Oct 13 16:39:43 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 13 Oct 2014 12:39:43 -0400 Subject: [Haskell-cafe] documentation build failing in hackage? In-Reply-To: References: <5431C5C0.3050807@vex.net> <20141006102206.GA28531@mtcomp.evidente.local> <5439B4D0.6070701@nh2.me> <5439B6DD.6000304@nh2.me> <543A6AF8.5060305@fuuzetsu.co.uk> <1413136682.3198333.178062293.3952F003@webmail.messagingengine.com> <87egucvwvj.fsf@gmail.com> Message-ID: Indeed! And I'd like to emphasize that volunteering is really about jumping in and doing legwork to help. This can be things like contributing to core infrastructure, setting up a mirror. Or whatever. A lot of the nice haskell tooling we have is a product of the hard work of many (though relatively small pool of many) volunteers wanting to make things better! Imagine how much nicer things can get with some deliberate carefully aimed work by a few more folks! On Oct 13, 2014 12:23 PM, "Mikolaj Konarski" wrote: > I was wrong and you were right about the halted haddock building. > > So I asked around and, just as Carter reports, I confirmed > a few kind people are currently working on setting up new > doc building bots and it doesn't look too bad. > > If you'd like to offer help to the volunteer infrastructure team, > please send a message to the haskell-infrastructure list at > http://community.galois.com/pipermail/haskell-infrastructure > or keep pinging people on #haskell-infrastructure on freenode IRC. > > This is also where you can, with some luck, get information > about the current status of the infrastructure. > Major disruptions are usually reported on > https://status.haskell.org/ > but the page needs to be manually updated and, > as we can see, it's not always accurate when partial > disruptions take place. > > Cheers, > Mikolaj > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.wobben at home.nl Mon Oct 13 17:13:07 2014 From: r.wobben at home.nl (Roelof Wobben) Date: Mon, 13 Oct 2014 19:13:07 +0200 Subject: [Haskell-cafe] online tutorial Message-ID: <543C0823.8030601@home.nl> Hello, I want to learn haskell by using the fpcomplete site. Now I wonder if this ( https://www.fpcomplete.com/school/starting-with-haskell/haskell-fast-hard) is a good tutorial for a beginner. Roelof From r.wobben at home.nl Mon Oct 13 19:36:27 2014 From: r.wobben at home.nl (Roelof Wobben) Date: Mon, 13 Oct 2014 21:36:27 +0200 Subject: [Haskell-cafe] online tutorial In-Reply-To: References: <543C0823.8030601@home.nl> Message-ID: <543C29BB.10401@home.nl> An HTML attachment was scrubbed... URL: From chrisdone at gmail.com Mon Oct 13 22:51:48 2014 From: chrisdone at gmail.com (Christopher Done) Date: Tue, 14 Oct 2014 00:51:48 +0200 Subject: [Haskell-cafe] Pretty Printing Libraries with an Emphasis on Consistency In-Reply-To: References: Message-ID: On 11 October 2014 18:00, Oliver Charles wrote: > Yes, hindent is exponential in its pretty printing and that's exactly the > program I'm trying to speed up ;) To be specific, hindent has `sandbox` > which runs a printer and then lets me make decisions on what the resulting > state might be. I'm curious if there are other approaches. Indeed, it's slow to backtrack like that. For what it's worth, one trick to speed that up is if the resulting state is OK, then just `put` that state and continue with it, rather than throwing away a rendered result. I doubled the speed of my style like that. But yeah, it's not much consolation. If you compare with the "Fundamental" style: that can pretty print a 60-line function I have here instantly, it takes no time, but my "ChrisDone" style takes over 50 seconds and counting. So there's a massive cost to this, but I haven't profiled it yet or attempted any real optimizations yet (been too busy). Perhaps that can be next on my todo list. Another thing to consider is to turn off this branching of "this style or that style" after a certain depth. Sort of "prune" the results to be smaller. The deeper down the tree, the fewer branches it could make, for example. I haven't tried this, but it could be nice. Good luck! If you find a similarly expressive and faster way to do this I'm all ears. :-) From gagliardi.curtis at gmail.com Mon Oct 13 23:20:13 2014 From: gagliardi.curtis at gmail.com (Curtis Gagliardi) Date: Mon, 13 Oct 2014 16:20:13 -0700 Subject: [Haskell-cafe] online tutorial In-Reply-To: <543C29BB.10401@home.nl> References: <543C0823.8030601@home.nl> <543C29BB.10401@home.nl> Message-ID: Yorgey's course on his upenn website has more lectures + homeworks you can do: http://www.seas.upenn.edu/~cis194/spring13/lectures.html I found the course from this great resource: https://github.com/bitemyapp/learnhaskell On Mon, Oct 13, 2014 at 12:36 PM, Roelof Wobben wrote: > Thanks, > > What I miss there is exercises I have to do for myself so I can pratice > what I have learned. > > Roelof > > > > Michael Steele schreef op 13-10-2014 21:28: > > I haven't read the tutorial you linked to, but someone else should be able > to comment on it. Another beginner tutorial on FP Complete's site is Brent > Yorgey's series [1]. > > [1]: https://www.fpcomplete.com/user/byorgey/introduction-to-haskell > > On Mon, Oct 13, 2014 at 10:13 AM, Roelof Wobben wrote: > >> Hello, >> >> I want to learn haskell by using the fpcomplete site. >> Now I wonder if this ( >> https://www.fpcomplete.com/school/starting-with-haskell/haskell-fast-hard) >> is a good tutorial for a beginner. >> >> Roelof >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > > -- > -- Michael Steele > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Tue Oct 14 01:08:09 2014 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Tue, 14 Oct 2014 14:08:09 +1300 Subject: [Haskell-cafe] value vs object orientation In-Reply-To: References: Message-ID: <23107ACB-0CD4-46B7-A184-1DDB90BE852C@cs.otago.ac.nz> There's a half-fun-and-full-earnest proverb: It is better to have one data type with 100 functions than ten data types with 10 functions each. I have some guidelines that I wrote up for a class this year: http://www.cs.otago.ac.nz/cosc326/resources/data.htm. They were given to students who have been trained in OOP, and the example is in Java, but my perspective was value orientation. One aspect of value orientation that's *not* brought out in those notes but really should be is that value orientation goes hand in hand with thinking of the values as elements of some *ALGEBRA* and a determination that the values and operations should combine in a way that MAKES SENSE and is as easy as practical to reason about. Just today I was looking at a mere 3 pages of OOP code (and in fact if you threw away the comments and test cases there was under 1 page of code) which left me completely baffled. It's basically a zipper, with operations canGoBackward, canGoForward, goBackward, goForward, and goTo, except that goTo adds an element, and a dummy element, and backs up over the dummy element. But if you add three elements in succession with goTo, and back up once, you get the 2nd element, not the 3rd. Presumably in the original context it *does* whatever the author wanted, but I can't figure out what it *means* and certainly would not be able to use it myself. The thing that has me jumping around shouting and looking for someone to bite is that the author *knew* what the intended semantics of the operations was but didn't think it would matter to his readers... Let me offer an example from the ANSI Smalltalk standard.
5.7.8.10 Message: copyReplaceFrom: start to: stop withObject: replacementElement Synopsis Answer a new collection conforming to the same protocols as the receiver, in which the elements of the receiver between start and stop inclusive have been replaced with replacementElement. Definition: This message can be used to insert, append, or replace. There are three cases: 1. If stop = start - 1, and start is less than or equal to the size of the receiver, then replacementElement is inserted between the elements at index stop and start. None of the receiver?s elements are replaced. 2. If stop = the size of the receiver and start = stop + 1, then the operation is an append, and replacementElement is placed at the end of the new collection. 3. Otherwise, the operation is a replacement, and each of the receiver?s elements in the given range is replaced by replacementElement. The parameters start and stop must be non-negative. Collections that by definition enforce an ordering on their elements are permitted to refine this message to reorder the result.
Now, as object-oriented definitions go, there's not much wrong with this. Cases 1 and 2 are really the same case, so the description is more complicated than it needs to be, but that's about it. You can either replace 1 or more existing elements with instances of a new one, or insert exactly 1 element at any position. From a value perspective, it's clear that there are two operations here: seq copyReplaceFrom: start to: stop withObject: newItem -- replace existing elements seq copyAdd: newItem beforeIndex: start -- insert one new element They have different validity conditions: 1 <= start <= stop <= seq size for the first 0 <= start - 1 <= seq size for the second They have different effects on the size: seq size = result size for the first seq size + 1 = result size for the second One is idempotent: if seq1 = seq copyReplaceFrom: a to: z withObject: x and seq2 = seq1 copyReplaceFrom: a to: z withObject: x (under the first reading), then seq1 = seq2 but the other is not: the sizes being different. Oops. I just told a lie. The first reading is NOT idempotent if the receiver is a collection that keeps its elements in sorted order. So it _is_ idempotent for some receivers and it is _not_ idempotent for others. Again, the value perspective would be unhappy with this. I suppose you could summarise it as - the value perspective asks "what does this value MEAN?" and has as its characteristic activity trying to reason about correctness - the object perspective asks "what does this object DO?" and has as its characteristic activity using a debugger. From magicloud.magiclouds at gmail.com Tue Oct 14 02:07:38 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Tue, 14 Oct 2014 10:07:38 +0800 Subject: [Haskell-cafe] Dependencies missing when building ghc. In-Reply-To: References: Message-ID: Works like a charm. Thank you. On Mon, Oct 13, 2014 at 3:16 PM, Yuras Shumovich wrote: > Hello, > > It is recommended to checkout 7.8 in special way, see > https://ghc.haskell.org/trac/ghc/wiki/Building/GettingTheSources#checkout-old-branch > > That is because repo structure was changed after 7.8 > > Thanks, > Yuras > 13 ??? 2014 ?. 4:03 ???????????? "Magicloud Magiclouds" < > magicloud.magiclouds at gmail.com> ???????: > >> Hi, >> >> I am with my new Ubuntu Trusty box. I have installed ghc by apt-get. >> Then I wanted to build ghc from git to upgrade to 7.8.3. >> >> I did following commands. I tried 'make clean', or reget the source. No >> luck yet. >> >> $ git clone --recursive git://git.haskell.org/ghc.git >> $ ./sync-all -r git://git.haskell.org remote set-url origin >> $ git checkout ghc-7.8.3-release >> $ ./sync-all get >> $ rm -r libraries/time # as prompted by sync-all >> $ ./sync-all get >> $ ./boot >> $ ./configure >> $ make >> ===--- building phase 0 >> make -r --no-print-directory -f ghc.mk phase=0 phase_0_builds >> make[1]: Nothing to be done for `phase_0_builds'. >> ===--- building phase 1 >> make -r --no-print-directory -f ghc.mk phase=1 phase_1_builds >> "inplace/bin/ghc-cabal" check libraries/haskell98 >> "inplace/bin/ghc-cabal" configure libraries/haskell98 dist-install "" >> --with-ghc="/home/local/ANT/shida/src/git/ghc/inplace/bin/ghc-stage1" >> --with-ghc-pkg="/home/local/ANT/shida/src/git/ghc/inplace/bin/ghc-pkg" >> --disable-library-for-ghci --enable-library-vanilla >> --enable-library-profiling --enable-shared --configure-option=CFLAGS=" >> -fno-stack-protector " --configure-option=LDFLAGS=" " >> --configure-option=CPPFLAGS=" " --gcc-options=" -fno-stack-protector >> " --with-gcc="/usr/bin/gcc" --with-ld="/usr/bin/ld" >> --configure-option=--with-cc="/usr/bin/gcc" --with-ar="/usr/bin/ar" >> --with-ranlib="/usr/bin/ranlib" --with-alex="/usr/bin/alex" >> --with-happy="/usr/bin/happy" >> Configuring haskell98-2.0.0.4... >> ghc-cabal: At least the following dependencies are missing: >> base ==4.8.* >> make[1]: *** [libraries/haskell98/dist-install/package-data.mk] Error 1 >> make: *** [all] Error 2 >> -- >> ??????? >> ??????? >> >> And for G+, please use magiclouds#gmail.com. >> >> _______________________________________________ >> Glasgow-haskell-users mailing list >> Glasgow-haskell-users at haskell.org >> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users >> >> -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From magicloud.magiclouds at gmail.com Tue Oct 14 02:07:51 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Tue, 14 Oct 2014 10:07:51 +0800 Subject: [Haskell-cafe] Dependencies missing when building ghc. In-Reply-To: <20141013081444.GA3771@machine> References: <20141013081444.GA3771@machine> Message-ID: That is something I did not know. Thank you. On Mon, Oct 13, 2014 at 4:14 PM, Daniel Trstenjak < daniel.trstenjak at gmail.com> wrote: > > > I am with my new Ubuntu Trusty box. I have installed ghc by apt-get. > Then I > > wanted to build ghc from git to upgrade to 7.8.3. > > If you only want to install a newer ghc version on ubuntu or even > multiple ghc versions at once, then I can only recommend the excellent > PPA of Herbert Valerio Riedel: > > https://launchpad.net/~hvr/+archive/ubuntu/ghc > > > Greetings, > Daniel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From o.o.magbagbeola at gmail.com Tue Oct 14 03:31:39 2014 From: o.o.magbagbeola at gmail.com (Pelumi Magbagbeola) Date: Mon, 13 Oct 2014 23:31:39 -0400 Subject: [Haskell-cafe] Wiki account creation Message-ID: Preferred Username is: Looms (I hope I have done this correctly) -------------- next part -------------- An HTML attachment was scrubbed... URL: From alan.zimm at gmail.com Tue Oct 14 06:10:22 2014 From: alan.zimm at gmail.com (Alan & Kim Zimmerman) Date: Tue, 14 Oct 2014 08:10:22 +0200 Subject: [Haskell-cafe] Pretty Printing Libraries with an Emphasis on Consistency In-Reply-To: References: Message-ID: I'm not sure if it is relevant, but in HaRe (or rather haskell-token-utils), I use the dual-tree structure from diagrams. This allows you to push constraints down from the top, but then build the formatting up from the bottom, and you only need to look at one level at a time. So effectively you format the leaves, then move up a level and format there, and so on. On Tue, Oct 14, 2014 at 12:51 AM, Christopher Done wrote: > On 11 October 2014 18:00, Oliver Charles wrote: > > Yes, hindent is exponential in its pretty printing and that's exactly the > > program I'm trying to speed up ;) To be specific, hindent has `sandbox` > > which runs a printer and then lets me make decisions on what the > resulting > > state might be. I'm curious if there are other approaches. > > Indeed, it's slow to backtrack like that. For what it's worth, one > trick to speed that up is if the resulting state is OK, then just > `put` that state and continue with it, rather than throwing away a > rendered result. I doubled the speed of my style like that. But yeah, > it's not much consolation. > > If you compare with the "Fundamental" style: that can pretty print a > 60-line function I have here instantly, it takes no time, but my > "ChrisDone" style takes over 50 seconds and counting. So there's a > massive cost to this, but I haven't profiled it yet or attempted any > real optimizations yet (been too busy). Perhaps that can be next on my > todo list. > > Another thing to consider is to turn off this branching of "this style > or that style" after a certain depth. Sort of "prune" the results to > be smaller. The deeper down the tree, the fewer branches it could > make, for example. I haven't tried this, but it could be nice. > > Good luck! If you find a similarly expressive and faster way to do > this I'm all ears. :-) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apfelmus at quantentunnel.de Tue Oct 14 07:41:23 2014 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Tue, 14 Oct 2014 09:41:23 +0200 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: <543BFBBB.5090809@fuuzetsu.co.uk> References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: Mateusz Kowalczyk wrote: > On 10/13/2014 04:25 PM, Rogan Creswick wrote: >> Mateusz Kowalczyk wrote: >>> The biggest problem is that there is no official statement as to why the >>> builds stopped and an estimate of when they are coming back. Apparently, Haskell.org has a blog since yesterday, where they explain what's up with the documentation builds: https://blog.haskell.org/post/the_new_haskell_org/ Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From alfredo.dinapoli at gmail.com Tue Oct 14 10:41:50 2014 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Tue, 14 Oct 2014 11:41:50 +0100 Subject: [Haskell-cafe] foreign libraries, dylibs, OS X Mavericks and GHC 7.8.3 woes Message-ID: Hello Cafe, I will let this gist talk for me: https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf Even though there is a solution, it seems extremely unsatisfying having to specify such paths manually. I always had very good experiences with FFI, OS X and GHC in the past, so this strikes me as a surprise. I have read a bit here and there about GHC 7.8.3 introducing the -dynamic flag (not sure about the specific problem it aims to solve, though) and changing some internal when it comes to library linking, but information is scattered and fragmented. I would like to: 1) Shed some light on my specific use case: Can I do better here? (aka have GHC figure out automatically all the nitty gritty details) 2) Any sort of pointers to documentation, tutorials, papers, everything to "teach me to fish?? Many thanks, Alfredo -------------- next part -------------- An HTML attachment was scrubbed... URL: From haskell at jschneider.net Tue Oct 14 12:23:17 2014 From: haskell at jschneider.net (Jon Schneider) Date: Tue, 14 Oct 2014 13:23:17 +0100 Subject: [Haskell-cafe] Building cross compiler fails Message-ID: <4961fa2946f3688d8f804c3c3d56191c.squirrel@mail.jschneider.net> I am after a ghc cross compiler. I have been cross compiling stuff for years and also built cross-compiling gcc from time to time but am having trouble building a cross-compiling ghc. I have read https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation and associated pages. In the ghc-7.8.3 directory I do ./configure --target=arm-linux-gnueabi -with-gcc=arm-linux-gnueabi-gcc but make eventually fails (in stage 1) configure: error: in `/home/jon/build/ghc-7.8.3/libraries/terminfo': configure:3386: arm-linux-gnueabi-gcc -o conftest -fno-stack-protector conftest.c -lncurses >&5 /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: cannot find -lncurses Firstly the requirement for termcap is surely unnecessary. We don't need it as the target will just be processing data. We do have an libncurses kicking about and I know _exactly_ what -L option to pass to (in this case) arm-linux-gnueabi-gcc to make this work but where to specify it to ghc's build system escapes me. I have tried setting CFLAGS, LDFLAGS, CONF_GCC_LINKER_OPTS_STAGE1 the configure commandline and also mk/build.mk . >From searching it is clear this has tripped people up time and time again and that there is something missing from the documentation. So in summary please could https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation be updated to show where to specify the CFLAGS and LDFLAGS that should accompany the compiler specified with -with-gcc (or derived from --target). Also more generally could the build documentation show how to omit frills like curses and termcap if at all possible. Jon From carter.schonwald at gmail.com Tue Oct 14 13:59:41 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 14 Oct 2014 09:59:41 -0400 Subject: [Haskell-cafe] foreign libraries, dylibs, OS X Mavericks and GHC 7.8.3 woes In-Reply-To: References: Message-ID: Sounds like snappy isn't doing the right linking on its side. Might be a bug there? On Oct 14, 2014 6:42 AM, "Alfredo Di Napoli" wrote: > Hello Cafe, > > I will let this gist talk for me: > > https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf > > Even though there is a solution, it seems extremely unsatisfying having to > specify such paths manually. > I always had very good experiences with FFI, OS X and GHC in the past, so > this strikes me as a surprise. > I have read a bit here and there about GHC 7.8.3 introducing the -dynamic > flag (not sure about the specific problem it aims to solve, though) and > changing some internal when it > comes to library linking, but information is scattered and fragmented. > I would like to: > > 1) Shed some light on my specific use case: Can I do better here? (aka > have GHC figure out automatically all the nitty gritty details) > 2) Any sort of pointers to documentation, tutorials, papers, everything to > "teach me to fish?? > > Many thanks, > Alfredo > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From waldmann at imn.htwk-leipzig.de Tue Oct 14 14:05:24 2014 From: waldmann at imn.htwk-leipzig.de (Johannes Waldmann) Date: Tue, 14 Oct 2014 14:05:24 +0000 (UTC) Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: Heinrich Apfelmus quantentunnel.de> writes: > Apparently, Haskell.org has a blog since yesterday, where they explain > what's up with the documentation builds: > > https://blog.haskell.org/post/the_new_haskell_org/ Looks good. This post contains: > And, the doc builder is now working again, > and should hopefully stay that way too. What to do if they don't? E.g., I'm getting this: https://hackage.haskell.org/package/satchmo-2.8.1/reports/ - J.W. From rustompmody at gmail.com Tue Oct 14 15:20:42 2014 From: rustompmody at gmail.com (Rustom Mody) Date: Tue, 14 Oct 2014 20:50:42 +0530 Subject: [Haskell-cafe] value vs object orientation In-Reply-To: <23107ACB-0CD4-46B7-A184-1DDB90BE852C@cs.otago.ac.nz> References: <23107ACB-0CD4-46B7-A184-1DDB90BE852C@cs.otago.ac.nz> Message-ID: Thanks Richard for your thoughts, especially I suppose you could summarise it as > - the value perspective asks > "what does this value MEAN?" > - the object perspective asks > "what does this object DO?" > [I usually formulate it as the understanding focus vs the doing focus; probably not much difference] However when you say > and has as its characteristic activity using a debugger. > I am amused. In a sense it is correct I guess but it still seems a tad harsh. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Oct 14 16:04:32 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 14 Oct 2014 12:04:32 -0400 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: use the curl api to "delete the old docs" to try to kick off a new build https://hackage.haskell.org/api On Tue, Oct 14, 2014 at 10:05 AM, Johannes Waldmann < waldmann at imn.htwk-leipzig.de> wrote: > Heinrich Apfelmus quantentunnel.de> writes: > > > Apparently, Haskell.org has a blog since yesterday, where they explain > > what's up with the documentation builds: > > > > https://blog.haskell.org/post/the_new_haskell_org/ > > Looks good. This post contains: > > > And, the doc builder is now working again, > > and should hopefully stay that way too. > > What to do if they don't? E.g., I'm getting this: > https://hackage.haskell.org/package/satchmo-2.8.1/reports/ > > - J.W. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Oct 14 16:04:48 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 14 Oct 2014 12:04:48 -0400 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: OR just upload your own using the fuuzetsu script :) On Tue, Oct 14, 2014 at 12:04 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > use the curl api to "delete the old docs" to try to kick off a new build > > https://hackage.haskell.org/api > > > On Tue, Oct 14, 2014 at 10:05 AM, Johannes Waldmann < > waldmann at imn.htwk-leipzig.de> wrote: > >> Heinrich Apfelmus quantentunnel.de> writes: >> >> > Apparently, Haskell.org has a blog since yesterday, where they explain >> > what's up with the documentation builds: >> > >> > https://blog.haskell.org/post/the_new_haskell_org/ >> >> Looks good. This post contains: >> >> > And, the doc builder is now working again, >> > and should hopefully stay that way too. >> >> What to do if they don't? E.g., I'm getting this: >> https://hackage.haskell.org/package/satchmo-2.8.1/reports/ >> >> - J.W. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Oct 14 16:05:52 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 14 Oct 2014 12:05:52 -0400 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: alternatively: the doc builders could be catching up with the huge backlog :) On Tue, Oct 14, 2014 at 12:04 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > OR just upload your own using the fuuzetsu script :) > > On Tue, Oct 14, 2014 at 12:04 PM, Carter Schonwald < > carter.schonwald at gmail.com> wrote: > >> use the curl api to "delete the old docs" to try to kick off a new build >> >> https://hackage.haskell.org/api >> >> >> On Tue, Oct 14, 2014 at 10:05 AM, Johannes Waldmann < >> waldmann at imn.htwk-leipzig.de> wrote: >> >>> Heinrich Apfelmus quantentunnel.de> writes: >>> >>> > Apparently, Haskell.org has a blog since yesterday, where they explain >>> > what's up with the documentation builds: >>> > >>> > https://blog.haskell.org/post/the_new_haskell_org/ >>> >>> Looks good. This post contains: >>> >>> > And, the doc builder is now working again, >>> > and should hopefully stay that way too. >>> >>> What to do if they don't? E.g., I'm getting this: >>> https://hackage.haskell.org/package/satchmo-2.8.1/reports/ >>> >>> - J.W. >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mikolaj at well-typed.com Tue Oct 14 16:09:58 2014 From: mikolaj at well-typed.com (Mikolaj Konarski) Date: Tue, 14 Oct 2014 18:09:58 +0200 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: >> Apparently, Haskell.org has a blog since yesterday, where they explain >> what's up with the documentation builds: [...] > What to do if they don't? E.g., I'm getting this: > https://hackage.haskell.org/package/satchmo-2.8.1/reports/ Yep, I've seen the doc building failure in another package today, too I guess, despite the comments section, the blog is mostly a one-way communication channel, so we are left with the options I mentioned in http://thread.gmane.org/gmane.comp.lang.haskell.cafe/113239/focus=113269 From mikolaj at well-typed.com Tue Oct 14 16:33:59 2014 From: mikolaj at well-typed.com (Mikolaj Konarski) Date: Tue, 14 Oct 2014 18:33:59 +0200 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: Hmm, actually, if you'd like to be an early adopter, you can file your tickets about haskell insfrastructure here https://phabricator.haskell.org/maniphest/query/open/ and here is some documentation https://phabricator.haskell.org/w/projects/haskell.org_infrastructure/ Contributions are welcome! On Tue, Oct 14, 2014 at 6:09 PM, Mikolaj Konarski wrote: >>> Apparently, Haskell.org has a blog since yesterday, where they explain >>> what's up with the documentation builds: > [...] >> What to do if they don't? E.g., I'm getting this: >> https://hackage.haskell.org/package/satchmo-2.8.1/reports/ > > Yep, I've seen the doc building failure in another package today, too > I guess, despite the comments section, the blog is > mostly a one-way communication channel, so we are > left with the options I mentioned in > > http://thread.gmane.org/gmane.comp.lang.haskell.cafe/113239/focus=113269 From alfredo.dinapoli at gmail.com Tue Oct 14 17:20:43 2014 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Tue, 14 Oct 2014 19:20:43 +0200 Subject: [Haskell-cafe] foreign libraries, dylibs, OS X Mavericks and GHC 7.8.3 woes In-Reply-To: References: Message-ID: Hi Carter, Thanks for answering. It's strange though, as that linker symbol refer to the cbits overlay (aka the foreign code Bryan wrote to call Snappy from Haskell) What am I missing ? Thanks! Alfredo Sent from my iPad > On 14/ott/2014, at 15:59, Carter Schonwald wrote: > > Sounds like snappy isn't doing the right linking on its side. Might be a bug there? > >> On Oct 14, 2014 6:42 AM, "Alfredo Di Napoli" wrote: >> Hello Cafe, >> >> I will let this gist talk for me: >> >> https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf >> >> Even though there is a solution, it seems extremely unsatisfying having to specify such paths manually. >> I always had very good experiences with FFI, OS X and GHC in the past, so this strikes me as a surprise. >> I have read a bit here and there about GHC 7.8.3 introducing the -dynamic flag (not sure about the specific problem it aims to solve, though) and changing some internal when it >> comes to library linking, but information is scattered and fragmented. >> I would like to: >> >> 1) Shed some light on my specific use case: Can I do better here? (aka have GHC figure out automatically all the nitty gritty details) >> 2) Any sort of pointers to documentation, tutorials, papers, everything to "teach me to fish?? >> >> Many thanks, >> Alfredo >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreas.abel at ifi.lmu.de Tue Oct 14 17:29:56 2014 From: andreas.abel at ifi.lmu.de (Andreas Abel) Date: Tue, 14 Oct 2014 19:29:56 +0200 Subject: [Haskell-cafe] ANN: New version of graphmod (1.2.4) In-Reply-To: <542FA31F.3010500@fuuzetsu.co.uk> References: <542EFC57.5080303@fuuzetsu.co.uk> <542FA31F.3010500@fuuzetsu.co.uk> Message-ID: <543D5D94.6090607@ifi.lmu.de> dot crashes for me as well on graphmod's output for Agda, even with option -p to graphmod. dot - graphviz version 2.26.3 (20100126.1600) (Generated .dot file attached) Cheers, Andreas On 04.10.2014 09:34, Mateusz Kowalczyk wrote: > On 10/04/2014 01:33 AM, Iavor Diatchki wrote: >> Hello, >> >> Good idea! I made a little web-page with examples and screenshots. Have a >> look: >> >> https://github.com/yav/graphmod/wiki >> >> Indeed, mutually-recursive modules are not a problem. There is an example >> of some mutually-recursive modules in the screen-shot from GHC's >> type-checker. >> >> By the way, I also added some support for modules that contains CPP, and >> improved the layout of the graphs a bit, so the current version is 1.2.5. >> >> Cheers, >> -Iavor >> >> >> > > That helped a lot. I packaged graphmod (and xdot) on NixOS. It graphviz > kept segfaulting[2] on the file produced for Yi repository but in the > end it worked after I added ?-p? to graphmod. Also --no-cluster view at [3]. > > Is there any plan for graphmod to do rendering itself, such as to PNG? I > also wonder if there's any way to highlight cyclic paths, useful when > trying to get rid of boot files. > > [1]: http://fuuzetsu.co.uk/images/1412407628.png > [2]: > libpath/shortest.c:324: triangulation failed > libpath/shortest.c:192: source point not in any triangle > Error: in routesplines, Pshortestpath failed > out of memory > [3]: http://fuuzetsu.co.uk/images/1412407805.png > >> >> On Fri, Oct 3, 2014 at 12:43 PM, Mateusz Kowalczyk >> wrote: >> >>> On 10/03/2014 07:37 PM, Iavor Diatchki wrote: >>>> Hello, >>>> >>>> I am pleased to announce a new version of `graphmod`---a program that >>> helps >>>> you visualize the import dependencies between the modules in your Haskell >>>> programs. >>>> >>>> The new feature in version 1.2.4 is support for pruning the dependency >>>> graph, which is enabled with the flag -p or --prune-edges. When this >>>> option is selected, `graphmod` will ignore imports to modules that are >>>> already imported by some of the dependencies of the module. >>>> >>>> For example, consider the following modules: >>>> >>>> module A where { import B; import C } >>>> module B where { import C } >>>> module C where { } >>>> >>>> When generated with `--prune-edges`, the resulting graph will be: >>>> >>>> A -> B -> C >>>> >>>> Note that there is no edge from `A` to `C`, because `C` is already >>> imported >>>> by `B`. >>>> >>>> Happy hacking, >>>> -Iavor >>>> >>>> >>> >>> Hi, >>> >>> It'd be great if the project page showed an example use and the >>> generated graph. >>> >>> Does it work with possibly mutually-importing boot files? >>> >>> >>> -- >>> Mateusz K. >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> > > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www2.tcs.ifi.lmu.de/~abel/ -------------- next part -------------- A non-text attachment was scrubbed... Name: moduleDeps.dot Type: application/msword Size: 12477 bytes Desc: not available URL: From fuuzetsu at fuuzetsu.co.uk Tue Oct 14 18:05:33 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Tue, 14 Oct 2014 19:05:33 +0100 Subject: [Haskell-cafe] ANN: yi-0.10.0 , the text editor written in Haskell Message-ID: <543D65ED.7050104@fuuzetsu.co.uk> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 We're glad to announce Yi 0.10.0. Yi is 10 years old today! Our main repository is at [1]. Yi compiles with GHC 7.6.3 all the way up to GHC 7.8.3. There have been many changes since the latest Hackage release (0.8.2). I inline the relevant part of the changelog at the bottom. We are slowly trying to populate the documentation pages: we have recently started using GitHub pages[2] for this purpose. Please have a look! On top of the issues listed in the changelog, a lot of issues were closed separately. If you had a pending issue, please check the issue tracker. As always we're looking for contributors: we have tasks in just about any area. Note that you don't even need to know Haskell to help us. Visit us on #yi on Freenode: be prepared to stay for more than 5 minutes. Installation instructions are available at [2]. If you're using nix, Yi 0.10.0 will be packaged shortly. 0.10.0 - ------ * Unicode syntax highlighting fixed (issue #82) * Hook to GTK Window exposed (#557) * Multiple components moved out to separate packages (oo-prototypes, word-trie, yi-languages, yi-string) * Replace a lot of the API to use YiString/Text instead of String improving performance * Greatly improve performance in the pango front-end as long as line-wrapping is on (default) * Recognise read-only files (#145) * Various Vim keymap improvements and fixes * Use lens instead of uniplate, replace some boilerplate with lens * Improve test framework to handle windows interactions, e.g. scrolling. * Use GHC.Generics instead of derive on GHC 7.8 * Remove bitrotten ghcapi and scion flags. * Support non-qwerty vim users * Support eventlog profiling with -feventlog * Eliminate idle CPU consumption in vty frontend * General cleanup * Make C-w closer to actual emacs behaviour (#612) * Make M-h behave more like emacs (#611) * Hint with buffer names when using C-k with emacs keymap (#606) * Fix display of paths starting with / (#528) * Don't mark buffer as changed if nothing was killed (#618) * Nicer findFile &c behaviour in dired buffers (#149) * Implement C-a for CUA (#167) * Fix dired for directories with unicode files/dirs (#445) * Fix vim indenting under some circumstances (#621) * Allow the font size to be changed per buffer (#608) * Double-click and triple-click selection in pango (#100 and #101) * Count columns properly in presence of tabs (#440) * Extra marking operations in dired Contributors: Alan Zimmerman, Anders Papitto, Anthony Quizon, Ben Armston, Benno F?nfst?ck, Carter Charbonneau, Corey O'Connor, Cray Elliott, Dmitry Ivanov, fiendfan1, Ilya Smelkov, Jakub Arnold, Jared Hance, jetho, Mateusz Kowalczyk, Richard Goulter, Ryan Desfosses, Siddhanathan Shanmugam 0.9.0 - ----- * Vim keymap removed. Vim2 is now called Vim. [1]: https://github.com/yi-editor/yi [2]: http://yi-editor.github.io/ - -- Mateusz K. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUPWXYAAoJEM1mucMq2pqXgzcP/0iljWag1qweflSYIqKa+FOc n/NYTqUV3HIYSGxolUvnm5HMfJ1uFFYmV7BVEtC7VcdntdP/bUCxu2gdOA9XxIrL JFwV3tzvLFqPYsm0bBVwq+lqRaBF2ICK95gmZpE+Osw7lrIK0SwibGAuLL+niRoo Qf5duTZXMBw0gQxay47zAb1XPwUhLYQUThSnbcOAG1raRI3OCV/eyMky+l5WMLTy 3RK5j2ZsWnps9k1XOFBVR/pQ6kJiFrButfLY7c3RBbfY9+uHQDN1ba3hr3wHsXUP fw4PiM6WmHecezH1Q7TSzH0XL+Mh5miM+g2QGphKAjeACOzskiCYRGcBpUCHSPsO EdxHe62oUvonEPAP747lCMRcYURknvoyVCDKjYzNKFBHJPFAizWW+tlv82QKKT1j CKECN7Lkra3nlLKzi11TdLHMUDGmatJeNHUMp4W1EDGG/hRbobrmD+2U2Yt/pRKH f/tSeE5Azk0xjDMNmYZBprqf1O1Q9tve4NrIHgQK0EXRWhkcFAsGIdqQBHP27Z0s JdCXdlMaRs4u2IfYoDevnFadMGF10oqQ1wUJPtIzcVvghgBkZEIMswsqbD5fTtPf Y/DFe2YcJl+lxPqgm/fq3aDnJABGYLftfJ05Rs1BGA909bnW29YqK0Si8JxAoH4R K6YQBTpqWULfHXh/ZQ68 =CAHP -----END PGP SIGNATURE----- From carter.schonwald at gmail.com Tue Oct 14 19:07:39 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 14 Oct 2014 15:07:39 -0400 Subject: [Haskell-cafe] Getting the haddocks back In-Reply-To: <543D72CC.2090001@htwk-leipzig.de> References: <543BFBBB.5090809@fuuzetsu.co.uk> <543D72CC.2090001@htwk-leipzig.de> Message-ID: you have to add your acls curl -X DELETE https://$username:$ pwd at hackage.haskell.org/package/linear-1.10.1.2/docs something like that, suitably adjusted for the libs in question On Tue, Oct 14, 2014 at 3:00 PM, Johannes Waldmann < johannes.waldmann at htwk-leipzig.de> wrote: > Hi Carter, > > > https://hackage.haskell.org/api > > Aha. How do I authenticate? I'm getting this (no surprise) > > [waldmann at R630 ~]$ curl -i -X DELETE -H "Accept: application/json" > https://hackage.haskell.org/package/satchmo-2.8.1/docs > > HTTP/1.1 401 Unauthorized > > - J. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.leather at gmail.com Tue Oct 14 21:03:33 2014 From: sean.leather at gmail.com (Sean Leather) Date: Tue, 14 Oct 2014 23:03:33 +0200 Subject: [Haskell-cafe] foreign libraries, dylibs, OS X Mavericks and GHC 7.8.3 woes In-Reply-To: References: Message-ID: Hi Alfredo, I will let this gist talk for me: > > https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf 1) Shed some light on my specific use case: Can I do better here? (aka have > GHC figure out automatically all the nitty gritty details) You're installing into a cabal sandbox and compiling directly with ghc (not cabal), but ghc doesn't know anything about the sandbox. You need to point it to the package database with -package-db and tell it the package for linking with -package [2]. $ ghc -package-db .cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d -package snappy HelloSnappy.hs Linking HelloSnappy ... $ ./HelloSnappy HelloSnappy: foo.jpg: openBinaryFile: does not exist (No such file or directory) [1] http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html#package-databases [2] http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#options-linker Regards, Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Wed Oct 15 02:55:38 2014 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Wed, 15 Oct 2014 15:55:38 +1300 Subject: [Haskell-cafe] value vs object orientation In-Reply-To: References: <23107ACB-0CD4-46B7-A184-1DDB90BE852C@cs.otago.ac.nz> Message-ID: <48C12723-0FBF-4E60-9849-1EB79A17B131@cs.otago.ac.nz> On 15/10/2014, at 4:20 AM, Rustom Mody wrote: > Thanks Richard for your thoughts, especially > > I suppose you could summarise it as > - the value perspective asks > "what does this value MEAN?" > - the object perspective asks > "what does this object DO?" > > [I usually formulate it as the understanding focus vs the doing focus; probably not much difference] It's interesting that the "semiotics" paper that someone already mentioned also identifies "being -vs doing" as the key question, but to my mind has it backwards. That paper identifies "being" with *internal structure* and "doing" with *interface* (in the Java sense) and to my way of thinking seriously misapplies the term "abstract data type" and makes some criticisms on the basis of a straw man bad design. Let me clarify here that the value perspective is NOT about knowing (still less about _having_ to know) the structure of things. You think about the value (the state of) a thing *represents*, not its implementation. One of my biggest gripes with Java is that students learning it never seem to get the hang of encapsulation; they'll make _everything_ public by default, which means that such an "object" is at the mercy of the whole world and cannot be said to represent anything other than its parts. Maybe that's what formed the perspective of that paper. From rustompmody at gmail.com Wed Oct 15 03:36:29 2014 From: rustompmody at gmail.com (Rustom Mody) Date: Wed, 15 Oct 2014 09:06:29 +0530 Subject: [Haskell-cafe] value vs object orientation In-Reply-To: <48C12723-0FBF-4E60-9849-1EB79A17B131@cs.otago.ac.nz> References: <23107ACB-0CD4-46B7-A184-1DDB90BE852C@cs.otago.ac.nz> <48C12723-0FBF-4E60-9849-1EB79A17B131@cs.otago.ac.nz> Message-ID: On Wed, Oct 15, 2014 at 8:25 AM, Richard A. O'Keefe wrote: > > On 15/10/2014, at 4:20 AM, Rustom Mody wrote: > > > Thanks Richard for your thoughts, especially > > > > I suppose you could summarise it as > > - the value perspective asks > > "what does this value MEAN?" > > - the object perspective asks > > "what does this object DO?" > > > > [I usually formulate it as the understanding focus vs the doing focus; > probably not much difference] > > It's interesting that the "semiotics" paper that someone > already mentioned also identifies "being -vs doing" as the > key question, but to my mind has it backwards. That paper > identifies "being" with *internal structure* and "doing" > with *interface* (in the Java sense) and to my way of > thinking seriously misapplies the term "abstract data type" > and makes some criticisms on the basis of a straw man bad > design. > Heh! I get into arguments on the python list on the same account. Python has an 'is' operator which is basically pointer-equality. I find it silly and inappropriate that a purportedly high level language needs to conflate ontological being with machine representations [On the whole though python is nice (with a few such exceptions) for supporting in an even-handed way, imperative and declarative thinking] > > Let me clarify here that the value perspective is NOT > about knowing (still less about _having_ to know) the > structure of things. You think about the value (the > state of) a thing *represents*, not its implementation. > Yes One of my old favorites is Bird and Wadler (1988 Miranda edition) - concrete types define values - abstract types are defined around operations And then without more ado the book sticks to concrete types. I was looking for something similar but not couched in the framing of FP stlll less some FP language -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfredo.dinapoli at gmail.com Wed Oct 15 06:19:09 2014 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Wed, 15 Oct 2014 07:19:09 +0100 Subject: [Haskell-cafe] foreign libraries, dylibs, OS X Mavericks and GHC 7.8.3 woes In-Reply-To: References: Message-ID: Hi Sean, I suspected sandboxing was involved! Thanks for the pointer :) Alfredo On Tuesday, 14 October 2014, Sean Leather wrote: > Hi Alfredo, >> >> I will let this gist talk for me: >> >> https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf >> >> 1) Shed some light on my specific use case: Can I do better here? (aka have GHC figure out automatically all the nitty gritty details) > > You're installing into a cabal sandbox and compiling directly with ghc (not cabal), but ghc doesn't know anything about the sandbox. You need to point it to the package database with -package-db and tell it the package for linking with -package [2]. > $ ghc -package-db .cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d -package snappy HelloSnappy.hs > Linking HelloSnappy ... > $ ./HelloSnappy > HelloSnappy: foo.jpg: openBinaryFile: does not exist (No such file or directory) > [1] http://www.haskell.org/ghc/docs/latest/html/users_guide/packages.html#package-databases > [2] http://www.haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#options-linker > Regards, > Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From lambda.fairy at gmail.com Wed Oct 15 08:14:15 2014 From: lambda.fairy at gmail.com (Chris Wong) Date: Wed, 15 Oct 2014 21:14:15 +1300 Subject: [Haskell-cafe] foreign libraries, dylibs, OS X Mavericks and GHC 7.8.3 woes In-Reply-To: References: Message-ID: > You're installing into a cabal sandbox and compiling directly with ghc (not > cabal), but ghc doesn't know anything about the sandbox. You need to point > it to the package database with -package-db and tell it the package for > linking with -package [2]. > > $ ghc -package-db .cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d > -package snappy HelloSnappy.hs > Linking HelloSnappy ... > $ ./HelloSnappy > HelloSnappy: foo.jpg: openBinaryFile: does not exist (No such file or > directory) Alternatively, if you've got a recent version of cabal you can use cabal exec -- ghc HelloSnappy.hs instead. You can also load up GHCi in the sandbox using `cabal exec ghci` or `cabal repl`. Chris From gesh at gesh.uni.cx Wed Oct 15 09:43:48 2014 From: gesh at gesh.uni.cx (Gesh) Date: Wed, 15 Oct 2014 12:43:48 +0300 Subject: [Haskell-cafe] Slides for "Adventures with Types" @ Functional Programming Exchange 2013? In-Reply-To: <543BF793.20906@orlitzky.com> References: <543BAE70.6020108@plaimi.net> <543BF793.20906@orlitzky.com> Message-ID: <543E41D4.4020009@gesh.uni.cx> Thanks Michael! I've been looking for videos of these presentations for ages! From alfredo.dinapoli at gmail.com Wed Oct 15 09:47:36 2014 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Wed, 15 Oct 2014 10:47:36 +0100 Subject: [Haskell-cafe] foreign libraries, dylibs, OS X Mavericks and GHC 7.8.3 woes In-Reply-To: References: Message-ID: Cheers Chris, I have added your solution to the gist, for the future-me: https://gist.github.com/adinapoli/d4c33a9d1ea85bcaebdf A. On Wednesday, 15 October 2014, Chris Wong wrote: >> You're installing into a cabal sandbox and compiling directly with ghc (not >> cabal), but ghc doesn't know anything about the sandbox. You need to point >> it to the package database with -package-db and tell it the package for >> linking with -package [2]. >> >> $ ghc -package-db .cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d >> -package snappy HelloSnappy.hs >> Linking HelloSnappy ... >> $ ./HelloSnappy >> HelloSnappy: foo.jpg: openBinaryFile: does not exist (No such file or >> directory) > > Alternatively, if you've got a recent version of cabal you can use > > cabal exec -- ghc HelloSnappy.hs > > instead. > > You can also load up GHCi in the sandbox using `cabal exec ghci` or > `cabal repl`. > > Chris > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svenpanne at gmail.com Wed Oct 15 13:07:57 2014 From: svenpanne at gmail.com (Sven Panne) Date: Wed, 15 Oct 2014 15:07:57 +0200 Subject: [Haskell-cafe] Hiding platform packages in Cabal sandboxes Message-ID: As a maintainer of the various OpenGL-related packages I have the following problem: The Haskell platform has those packages (OpenGLRaw, GLURaw, ...) exposed, which is the right thing to do in general. When I want to work on those packages, I'd like to use Cabal sandboxes to avoid screwing up the platform versions of them, but things get a bit tricky then. Consider e.g. the GLURaw package, which depends on the OpenGLRaw package. Assume that I'd like to add some stuff to the OpenGLRaw package and use that in GLURaw. With cabal sandboxes I'll have to fight a little bit, because versions of these packages are already exposed: ----------------------------------------------------------------------------------------------------------------------- svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal sandbox init Writing a default package environment file to /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/cabal.sandbox.config Creating a new sandbox at /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal sandbox add-source ../OpenGLRaw ----------------------------------------------------------------------------------------------------------------------- No problem so far. But the next step is not so OK: ----------------------------------------------------------------------------------------------------------------------- svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal install --only-dependencies Resolving dependencies... All the requested packages are already installed: Use --reinstall if you want to reinstall anyway. ----------------------------------------------------------------------------------------------------------------------- Hmmm, obviously cabal sees the globally exposed OpenGLRaw and ignores that I've done add-source above. OK, next try with --constraint added: ----------------------------------------------------------------------------------------------------------------------- svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal install --only-dependencies --constraint='OpenGLRaw source' Resolving dependencies... In order, the following would be installed: OpenGLRaw-1.5.0.0 (reinstall) cabal: The following packages are likely to be broken by the reinstalls: OpenGL-2.9.2.0 GLUT-2.5.1.1 GLURaw-1.4.0.1 Use --force-reinstalls if you want to install anyway. ----------------------------------------------------------------------------------------------------------------------- (Is there any documentation about --constraint? I figured that out by actually reading the cabal sources. :-/ ) Better, but still not OK, so let's add --force-reinstalls: ----------------------------------------------------------------------------------------------------------------------- svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal install --only-dependencies --constraint='OpenGLRaw source' --force-reinstalls Resolving dependencies... Warning: The following packages are likely to be broken by the reinstalls: OpenGL-2.9.2.0 GLUT-2.5.1.1 GLURaw-1.4.0.1 Continuing even though the plan contains dangerous reinstalls. Notice: installing into a sandbox located at /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox Configuring OpenGLRaw-1.5.0.0... Building OpenGLRaw-1.5.0.0... Installed OpenGLRaw-1.5.0.0 ----------------------------------------------------------------------------------------------------------------------- That works, so after that I could actually build/install GLURaw. So in a nutshell what I have to do is: cabal sandbox init cabal sandbox add-source ../OpenGLRaw cabal install --constraint='OpenGLRaw source' --force-reinstalls --enable-documentation --haddock-hyperlink-source And for other packages I even have to add several --constraint flags, because they depend on several locally modified packages. This seems a bit weird. Is this the recommended workflow? How do other maintainers of platform packages handle this? What one *actually* wants is hiding some of the globally exposed packages while being in the sandbox (--constraint and --force-reinstalls could go away then), but I've found no way to do that. Cheers, S. From ivan.miljenovic at gmail.com Wed Oct 15 13:42:57 2014 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Thu, 16 Oct 2014 00:42:57 +1100 Subject: [Haskell-cafe] Hiding platform packages in Cabal sandboxes In-Reply-To: References: Message-ID: On 16 October 2014 00:07, Sven Panne wrote: > As a maintainer of the various OpenGL-related packages I have the > following problem: The Haskell platform has those packages (OpenGLRaw, > GLURaw, ...) exposed, which is the right thing to do in general. When > I want to work on those packages, I'd like to use Cabal sandboxes to > avoid screwing up the platform versions of them, but things get a bit > tricky then. Consider e.g. the GLURaw package, which depends on the > OpenGLRaw package. Assume that I'd like to add some stuff to the > OpenGLRaw package and use that in GLURaw. With cabal sandboxes I'll > have to fight a little bit, because versions of these packages are > already exposed: > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal sandbox init > Writing a default package environment file to > /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/cabal.sandbox.config > Creating a new sandbox at > /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > sandbox add-source ../OpenGLRaw > ----------------------------------------------------------------------------------------------------------------------- > > No problem so far. But the next step is not so OK: > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > install --only-dependencies > Resolving dependencies... > All the requested packages are already installed: > Use --reinstall if you want to reinstall anyway. > ----------------------------------------------------------------------------------------------------------------------- > > Hmmm, obviously cabal sees the globally exposed OpenGLRaw and ignores > that I've done add-source above. OK, next try with --constraint added: > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > install --only-dependencies --constraint='OpenGLRaw source' > Resolving dependencies... > In order, the following would be installed: > OpenGLRaw-1.5.0.0 (reinstall) > cabal: The following packages are likely to be broken by the reinstalls: > OpenGL-2.9.2.0 > GLUT-2.5.1.1 > GLURaw-1.4.0.1 > Use --force-reinstalls if you want to install anyway. > ----------------------------------------------------------------------------------------------------------------------- > > (Is there any documentation about --constraint? I figured that out by > actually reading the cabal sources. :-/ ) Better, but still not OK, so > let's add --force-reinstalls: > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > install --only-dependencies --constraint='OpenGLRaw source' > --force-reinstalls > Resolving dependencies... > Warning: The following packages are likely to be broken by the reinstalls: > OpenGL-2.9.2.0 > GLUT-2.5.1.1 > GLURaw-1.4.0.1 > Continuing even though the plan contains dangerous reinstalls. > Notice: installing into a sandbox located at > /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox > Configuring OpenGLRaw-1.5.0.0... > Building OpenGLRaw-1.5.0.0... > Installed OpenGLRaw-1.5.0.0 > ----------------------------------------------------------------------------------------------------------------------- > > That works, so after that I could actually build/install GLURaw. So in > a nutshell what I have to do is: > > cabal sandbox init > cabal sandbox add-source ../OpenGLRaw > cabal install --constraint='OpenGLRaw source' --force-reinstalls > --enable-documentation --haddock-hyperlink-source > > And for other packages I even have to add several --constraint flags, > because they depend on several locally modified packages. This seems a > bit weird. Is this the recommended workflow? How do other maintainers > of platform packages handle this? What one *actually* wants is hiding > some of the globally exposed packages while being in the sandbox > (--constraint and --force-reinstalls could go away then), but I've > found no way to do that. > > Cheers, > S. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe Not the greatest idea, but what about bumping the version numbers of the packages you want to build from source (e.g. append a useless ".1" on the end of their version numbers in their .cabal files)? Then you should be able to do "cabal install OpenGLRaw" instead of needing to do the constraint, etc. -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From haskell at jschneider.net Wed Oct 15 14:23:33 2014 From: haskell at jschneider.net (Jon Schneider) Date: Wed, 15 Oct 2014 15:23:33 +0100 Subject: [Haskell-cafe] Missing or undocumented ARM architecture controls Message-ID: <1fd3779537d5a2aec188d7b7702b75e8.squirrel@mail.jschneider.net> I worked around a problem of a build of a simple cross ghc not finding (shared) libraries by setting the LIBRARY_PATH environment variable. Not ideal. Then I came to a problem with StcCRun.c using vldmia and related instructions which are part of ARMv6. I worked around this by putting #defines for arm_HOST_ARCH_PRE_ARMv6 and arm_HOST_ARCH_PRE_ARMv7 in mk/config.h Now it seems to make use of llvm at a later stage and that fails with "inplace/bin/ghc-stage1" -static -H64m -O0 -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -Irts -Irts/dist/build -DCOMPILING_RTS -package-name rts -dcmm-lint -i -irts -irts/dist/build -irts/dist/build/autogen -Irts/dist/build -Irts/dist/build/autogen -O2 -c rts/Exception.cmm -o rts/dist/build/Exception.o '+v7' is not a recognized feature for this target (ignoring feature) UNREACHABLE executed! UNREACHABLE executed! Stack dump: 0. Program arguments: /usr/bin/llc -O3 -relocation-model=static /tmp/ghc20998_0/ghc20998_4.bc -o /tmp/ghc20998_0/ghc20998_5.lm_s --enable-tbaa=true -mattr=+v7,+vfp3 1. Running pass 'Function Pass Manager' on module '/tmp/ghc20998_0/ghc20998_4.bc'. 2. Running pass 'ARM Instruction Selection' on function '@stg_unmaskAsyncExceptionszh_ret_info' Now the thing that sticks out there is the +v7,+vfp3 option. Again it seems to be making incorrect assumptions about the exact ARM architecture. Ours is a v5TE/926. What is the correct way to specify this ? Thanks, Jon From ivan.perez at keera.co.uk Wed Oct 15 14:43:09 2014 From: ivan.perez at keera.co.uk (Ivan Perez) Date: Wed, 15 Oct 2014 15:43:09 +0100 Subject: [Haskell-cafe] Optimizing Haskell games with minimal changes. Message-ID: <543E87FD.40100@keera.co.uk> Hi Caf?, As you know, we are building Android games in Haskell, and efficiency is crucial. I often find myself trying to explain to other game programmers that the price to be paid in speed in exchange for the robustness and the clarity of the language is minimal; and that optimising and parallelising can be very easy. In our game we only had to apply very basic techniques (RWH, Chapter 25; Parallel & Concurrent Haskell, Chapter 2) to obtain a x7 speedup and reduce memory consumption from hundreds to 3MB on desktop. The number of changes to the codebase was minimal. I hope it helps support the case that using Haskell even for CPU demanding code is worth it. Our game now also runs smoothly on Android. Hopefully this will also help others trying to achieve the same thing. http://keera.co.uk/blog/2014/10/15/from-60-fps-to-500/ Cheers Ivan -- Facebook: https://www.facebook.com/keerastudios Twitter: https://twitter.com/KeeraStudios Web: http://www.keera.co.uk From mantkiew at gsd.uwaterloo.ca Wed Oct 15 14:45:18 2014 From: mantkiew at gsd.uwaterloo.ca (Michal Antkiewicz) Date: Wed, 15 Oct 2014 10:45:18 -0400 Subject: [Haskell-cafe] Hiding platform packages in Cabal sandboxes In-Reply-To: References: Message-ID: AFAIK there's no way to selectively "hide" packages. However, you might be able to use cabal2nix4dev [1]. You'll have to modify the nix expressions to use your packages instead of the existing ones from the platform (in NIX they can happily coexist). Perhaps somebody with direct NIX experience could provide more detailed step by step instructions? Michal [1] https://github.com/dave4420/cabal2nix4dev On Wed, Oct 15, 2014 at 9:07 AM, Sven Panne wrote: > As a maintainer of the various OpenGL-related packages I have the > following problem: The Haskell platform has those packages (OpenGLRaw, > GLURaw, ...) exposed, which is the right thing to do in general. When > I want to work on those packages, I'd like to use Cabal sandboxes to > avoid screwing up the platform versions of them, but things get a bit > tricky then. Consider e.g. the GLURaw package, which depends on the > OpenGLRaw package. Assume that I'd like to add some stuff to the > OpenGLRaw package and use that in GLURaw. With cabal sandboxes I'll > have to fight a little bit, because versions of these packages are > already exposed: > > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > sandbox init > Writing a default package environment file to > > /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/cabal.sandbox.config > Creating a new sandbox at > > /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > sandbox add-source ../OpenGLRaw > > ----------------------------------------------------------------------------------------------------------------------- > > No problem so far. But the next step is not so OK: > > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > install --only-dependencies > Resolving dependencies... > All the requested packages are already installed: > Use --reinstall if you want to reinstall anyway. > > ----------------------------------------------------------------------------------------------------------------------- > > Hmmm, obviously cabal sees the globally exposed OpenGLRaw and ignores > that I've done add-source above. OK, next try with --constraint added: > > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > install --only-dependencies --constraint='OpenGLRaw source' > Resolving dependencies... > In order, the following would be installed: > OpenGLRaw-1.5.0.0 (reinstall) > cabal: The following packages are likely to be broken by the reinstalls: > OpenGL-2.9.2.0 > GLUT-2.5.1.1 > GLURaw-1.4.0.1 > Use --force-reinstalls if you want to install anyway. > > ----------------------------------------------------------------------------------------------------------------------- > > (Is there any documentation about --constraint? I figured that out by > actually reading the cabal sources. :-/ ) Better, but still not OK, so > let's add --force-reinstalls: > > > ----------------------------------------------------------------------------------------------------------------------- > svenpanne at svenpanne[master]:~/repos/haskell-packages/GLURaw$ cabal > install --only-dependencies --constraint='OpenGLRaw source' > --force-reinstalls > Resolving dependencies... > Warning: The following packages are likely to be broken by the reinstalls: > OpenGL-2.9.2.0 > GLUT-2.5.1.1 > GLURaw-1.4.0.1 > Continuing even though the plan contains dangerous reinstalls. > Notice: installing into a sandbox located at > > /usr/local/google/home/svenpanne/repos/haskell-packages/GLURaw/.cabal-sandbox > Configuring OpenGLRaw-1.5.0.0... > Building OpenGLRaw-1.5.0.0... > Installed OpenGLRaw-1.5.0.0 > > ----------------------------------------------------------------------------------------------------------------------- > > That works, so after that I could actually build/install GLURaw. So in > a nutshell what I have to do is: > > cabal sandbox init > cabal sandbox add-source ../OpenGLRaw > cabal install --constraint='OpenGLRaw source' --force-reinstalls > --enable-documentation --haddock-hyperlink-source > > And for other packages I even have to add several --constraint flags, > because they depend on several locally modified packages. This seems a > bit weird. Is this the recommended workflow? How do other maintainers > of platform packages handle this? What one *actually* wants is hiding > some of the globally exposed packages while being in the sandbox > (--constraint and --force-reinstalls could go away then), but I've > found no way to do that. > > Cheers, > S. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Oct 15 14:47:46 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 15 Oct 2014 10:47:46 -0400 Subject: [Haskell-cafe] Hiding platform packages in Cabal sandboxes In-Reply-To: References: Message-ID: On Wed, Oct 15, 2014 at 9:07 AM, Sven Panne wrote: > And for other packages I even have to add several --constraint flags, > because they depend on several locally modified packages. This seems a > bit weird. Is this the recommended workflow? How do other maintainers > of platform packages handle this? What one *actually* wants is hiding > some of the globally exposed packages while being in the sandbox > (--constraint and --force-reinstalls could go away then), but I've > found no way to do that. > As I understand it, ghc doesn't give cabal enough hooks into its package management to do it properly. I'd be looking at hsenv to set up a sandboxed ghc instead. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From sperber at deinprogramm.de Wed Oct 15 14:55:52 2014 From: sperber at deinprogramm.de (Michael Sperber) Date: Wed, 15 Oct 2014 16:55:52 +0200 Subject: [Haskell-cafe] Deriving vs. type constructors Message-ID: I'm struggling with a problem related to generic programming, boiling down to this: ----snip---- {-# LANGUAGE StandaloneDeriving, KindSignatures, UndecidableInstances #-} data Foo (v :: * -> *) = Foo (v Bar) deriving instance (Show (v Bar)) => Show (Foo v) data Bar = Bar deriving Show ----snip---- So the Show instance for Foo v wants the rather specific Show instance for v Bar. But now imagine that v is always something like Maybe, itself done using something like this presumably: instance Show a => Show (Maybe a) where ... Can I somehow state as a constraint that Foo v has a Show instance if v is a type constructor like Maybe, i.e. once with a Show instances for any arguments that has a Show instance? (You can't see *why* I want to do this in this example - I actually have something like 100 nested datatypes which thread v through, and *every single one of them* adds to the context I need for every one of them.) I feel I want to write something like this: deriving instance (Show a => Show (v a)) => Show (Foo v) Is there a way to do this? Help would be much appreciated! -- Regards, Mike From karel.gardas at centrum.cz Wed Oct 15 15:16:26 2014 From: karel.gardas at centrum.cz (Karel Gardas) Date: Wed, 15 Oct 2014 17:16:26 +0200 Subject: [Haskell-cafe] Building cross compiler fails In-Reply-To: <4961fa2946f3688d8f804c3c3d56191c.squirrel@mail.jschneider.net> References: <4961fa2946f3688d8f804c3c3d56191c.squirrel@mail.jschneider.net> Message-ID: <543E8FCA.8090008@centrum.cz> Hi, cross-compilation with GHC is not ideal yet. I've hit your issue in the past to and solved this with wrapper and sysroot[1]. I think this should also work in your case. Karel [1]: https://ghcarm.wordpress.com/tag/cross-compiler/ On 10/14/14 02:23 PM, Jon Schneider wrote: > I am after a ghc cross compiler. I have been cross compiling stuff for > years and also built cross-compiling gcc from time to time but am having > trouble building a cross-compiling ghc. > > I have read https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation and > associated pages. > > In the ghc-7.8.3 directory I do > ./configure --target=arm-linux-gnueabi -with-gcc=arm-linux-gnueabi-gcc > > but make eventually fails (in stage 1) > > configure: error: in `/home/jon/build/ghc-7.8.3/libraries/terminfo': > configure:3386: arm-linux-gnueabi-gcc -o conftest -fno-stack-protector > conftest.c -lncurses>&5 > /usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/bin/ld: > cannot find -lncurses > > Firstly the requirement for termcap is surely unnecessary. We don't need > it as the target will just be processing data. > > We do have an libncurses kicking about and I know _exactly_ what -L option > to pass to (in this case) arm-linux-gnueabi-gcc to make this work but > where to specify it to ghc's build system escapes me. > > I have tried setting CFLAGS, LDFLAGS, CONF_GCC_LINKER_OPTS_STAGE1 the > configure commandline and also mk/build.mk . > >> From searching it is clear this has tripped people up time and time again > and that there is something missing from the documentation. > > So in summary please could > https://ghc.haskell.org/trac/ghc/wiki/CrossCompilation be updated to show > where to specify the CFLAGS and LDFLAGS that should accompany the compiler > specified with -with-gcc (or derived from --target). > > Also more generally could the build documentation show how to omit frills > like curses and termcap if at all possible. > > Jon > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From karel.gardas at centrum.cz Wed Oct 15 15:20:15 2014 From: karel.gardas at centrum.cz (Karel Gardas) Date: Wed, 15 Oct 2014 17:20:15 +0200 Subject: [Haskell-cafe] Missing or undocumented ARM architecture controls In-Reply-To: <1fd3779537d5a2aec188d7b7702b75e8.squirrel@mail.jschneider.net> References: <1fd3779537d5a2aec188d7b7702b75e8.squirrel@mail.jschneider.net> Message-ID: <543E90AF.9080404@centrum.cz> On 10/15/14 04:23 PM, Jon Schneider wrote: > 0. Program arguments: /usr/bin/llc -O3 -relocation-model=static > /tmp/ghc20998_0/ghc20998_4.bc -o /tmp/ghc20998_0/ghc20998_5.lm_s > --enable-tbaa=true -mattr=+v7,+vfp3 > 1. Running pass 'Function Pass Manager' on module > '/tmp/ghc20998_0/ghc20998_4.bc'. > 2. Running pass 'ARM Instruction Selection' on function > '@stg_unmaskAsyncExceptionszh_ret_info' > > Now the thing that sticks out there is the +v7,+vfp3 option. > > Again it seems to be making incorrect assumptions about the exact ARM > architecture. Ours is a v5TE/926. > ARMv7-A is supported by default. If you do have lower spec box, then you can hand edit settings file and switch from ARMv7 to ARMv5 there. Look into compiler/utils/Platform.hs for possible values. Nobody has done this in more user-friendly way yet... Karel From atzeus at gmail.com Wed Oct 15 16:18:14 2014 From: atzeus at gmail.com (Atze van der Ploeg) Date: Wed, 15 Oct 2014 18:18:14 +0200 Subject: [Haskell-cafe] Deriving vs. type constructors In-Reply-To: References: Message-ID: I don't think this currently possible. I think you are asking for the following GHC ticket: https://ghc.haskell.org/trac/ghc/ticket/5927 On Oct 15, 2014 4:56 PM, "Michael Sperber" wrote: > > > I'm struggling with a problem related to generic programming, boiling > down to this: > > ----snip---- > {-# LANGUAGE StandaloneDeriving, KindSignatures, UndecidableInstances #-} > > data Foo (v :: * -> *) = Foo (v Bar) > > deriving instance (Show (v Bar)) => Show (Foo v) > > data Bar = Bar > deriving Show > ----snip---- > > So the Show instance for Foo v wants the rather specific Show instance > for v Bar. > > But now imagine that v is always something like Maybe, itself done using > something like this presumably: > > instance Show a => Show (Maybe a) where ... > > Can I somehow state as a constraint that Foo v has a Show instance if v > is a type constructor like Maybe, i.e. once with a Show instances for > any arguments that has a Show instance? > > (You can't see *why* I want to do this in this example - I actually have > something like 100 nested datatypes which thread v through, and *every > single one of them* adds to the context I need for every one of them.) > > I feel I want to write something like this: > > deriving instance (Show a => Show (v a)) => Show (Foo v) > > Is there a way to do this? > > Help would be much appreciated! > > -- > Regards, > Mike > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From atzeus at gmail.com Wed Oct 15 16:22:33 2014 From: atzeus at gmail.com (Atze van der Ploeg) Date: Wed, 15 Oct 2014 18:22:33 +0200 Subject: [Haskell-cafe] Deriving vs. type constructors In-Reply-To: References: Message-ID: Possibly you can work around this issue uainh the constraints package http://hackage.haskell.org/package/constraints On Oct 15, 2014 6:18 PM, "Atze van der Ploeg" wrote: > I don't think this currently possible. I think you are asking for the > following GHC ticket: https://ghc.haskell.org/trac/ghc/ticket/5927 > > On Oct 15, 2014 4:56 PM, "Michael Sperber" > wrote: > > > > > > I'm struggling with a problem related to generic programming, boiling > > down to this: > > > > ----snip---- > > {-# LANGUAGE StandaloneDeriving, KindSignatures, UndecidableInstances #-} > > > > data Foo (v :: * -> *) = Foo (v Bar) > > > > deriving instance (Show (v Bar)) => Show (Foo v) > > > > data Bar = Bar > > deriving Show > > ----snip---- > > > > So the Show instance for Foo v wants the rather specific Show instance > > for v Bar. > > > > But now imagine that v is always something like Maybe, itself done using > > something like this presumably: > > > > instance Show a => Show (Maybe a) where ... > > > > Can I somehow state as a constraint that Foo v has a Show instance if v > > is a type constructor like Maybe, i.e. once with a Show instances for > > any arguments that has a Show instance? > > > > (You can't see *why* I want to do this in this example - I actually have > > something like 100 nested datatypes which thread v through, and *every > > single one of them* adds to the context I need for every one of them.) > > > > I feel I want to write something like this: > > > > deriving instance (Show a => Show (v a)) => Show (Foo v) > > > > Is there a way to do this? > > > > Help would be much appreciated! > > > > -- > > Regards, > > Mike > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hesselink at gmail.com Wed Oct 15 17:24:45 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Wed, 15 Oct 2014 19:24:45 +0200 Subject: [Haskell-cafe] Deriving vs. type constructors In-Reply-To: References: Message-ID: It's hard to know if this will solve your problem, but sometimes it helps to make your type more generic, and recover the original type using a type synonym. Something like this: {-# LANGUAGE StandaloneDeriving, KindSignatures, UndecidableInstances #-} data FooG a (v :: * -> *) = Foo (v a) type Foo = FooG Bar deriving instance (Show (v a)) => Show (FooG a v) data Bar = Bar deriving Show You don't even need the standalone deriving now, but it shows that the constraint will now be less specific. Another alternative could be to use something like `Show` from `Data.Functor.Classes` in transformers. That would mean you'd have to write your own `Show` instance, though. Erik On Wed, Oct 15, 2014 at 4:55 PM, Michael Sperber wrote: > > I'm struggling with a problem related to generic programming, boiling > down to this: > > ----snip---- > {-# LANGUAGE StandaloneDeriving, KindSignatures, UndecidableInstances #-} > > data Foo (v :: * -> *) = Foo (v Bar) > > deriving instance (Show (v Bar)) => Show (Foo v) > > data Bar = Bar > deriving Show > ----snip---- > > So the Show instance for Foo v wants the rather specific Show instance > for v Bar. > > But now imagine that v is always something like Maybe, itself done using > something like this presumably: > > instance Show a => Show (Maybe a) where ... > > Can I somehow state as a constraint that Foo v has a Show instance if v > is a type constructor like Maybe, i.e. once with a Show instances for > any arguments that has a Show instance? > > (You can't see *why* I want to do this in this example - I actually have > something like 100 nested datatypes which thread v through, and *every > single one of them* adds to the context I need for every one of them.) > > I feel I want to write something like this: > > deriving instance (Show a => Show (v a)) => Show (Foo v) > > Is there a way to do this? > > Help would be much appreciated! > > -- > Regards, > Mike > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From mail at nh2.me Wed Oct 15 19:23:44 2014 From: mail at nh2.me (=?UTF-8?B?TmlrbGFzIEhhbWLDvGNoZW4=?=) Date: Wed, 15 Oct 2014 21:23:44 +0200 Subject: [Haskell-cafe] Unicode symbols in operators Message-ID: <543EC9C0.1010909@nh2.me> (I'm trying to improve Sublime Text's Haskell lexer.) https://www.haskell.org/onlinereport/haskell2010/haskellch10.html says uniSymbol ? any Unicode symbol or punctuation What is meant here, is "Unicode symbol" literally \p{Symbol} in regex, or more? So uniSymbol = \p{Symbol} | \p{Punctuation} Thanks! From travis.cardwell at extellisys.com Wed Oct 15 23:40:21 2014 From: travis.cardwell at extellisys.com (Travis Cardwell) Date: Thu, 16 Oct 2014 08:40:21 +0900 Subject: [Haskell-cafe] Hiding platform packages in Cabal sandboxes In-Reply-To: References: Message-ID: <543F05E5.9030207@extellisys.com> On 2014?10?15? 22:07, Sven Panne wrote: > As a maintainer of the various OpenGL-related packages I have the > following problem: The Haskell platform has those packages (OpenGLRaw, > GLURaw, ...) exposed, which is the right thing to do in general. When > I want to work on those packages, I'd like to use Cabal sandboxes to > avoid screwing up the platform versions of them, but things get a bit > tricky then. Though it is not a general solution, have you tried developing in a "minimal Haskell installation" (just GHC, Cabal, and packages required by those)? The OpenGL-related packages would not be already installed in that case, so you would not need to worry about hiding them. You could then test against Haskell Platform separately. Travis From hpacheco at gmail.com Thu Oct 16 04:06:42 2014 From: hpacheco at gmail.com (Hugo Pacheco) Date: Thu, 16 Oct 2014 00:06:42 -0400 Subject: [Haskell-cafe] Splicing type signature in TH Message-ID: Hi list, I am 99.9% sure that this is currently not possible, but I might as well ask: - Is there a way to lift type variables into Template Haskell type splices? What I had in mind would be something like this (erroneous) code: liftT :: a -> Q Type liftT (_::a) = [t| $a |] I have no idea how hard it would be to implement such a feature, or if it is remotely doable. Naively, it seems to me that TH would have to delay evaluating the splice until the type variable is fully expanded, but all the necessary information would still be available at some point during compilation. Cheers, hugo -- www.cs.cornell.edu/~hpacheco -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwlato at gmail.com Thu Oct 16 05:07:18 2014 From: jwlato at gmail.com (John Lato) Date: Thu, 16 Oct 2014 13:07:18 +0800 Subject: [Haskell-cafe] Splicing type signature in TH In-Reply-To: References: Message-ID: You can create a new forall'd type variable. Would that work? On Thu, Oct 16, 2014 at 12:06 PM, Hugo Pacheco wrote: > Hi list, > > I am 99.9% sure that this is currently not possible, but I might as well > ask: > > - Is there a way to lift type variables into Template Haskell type > splices? > > What I had in mind would be something like this (erroneous) code: > > liftT :: a -> Q Type > liftT (_::a) = [t| $a |] > > I have no idea how hard it would be to implement such a feature, or if it > is remotely doable. > Naively, it seems to me that TH would have to delay evaluating the splice > until the type variable is fully expanded, but all the necessary > information would still be available at some point during compilation. > > Cheers, > hugo > > -- > www.cs.cornell.edu/~hpacheco > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mgsloan at gmail.com Thu Oct 16 05:22:23 2014 From: mgsloan at gmail.com (Michael Sloan) Date: Wed, 15 Oct 2014 22:22:23 -0700 Subject: [Haskell-cafe] Splicing type signature in TH In-Reply-To: References: Message-ID: Here's a hacky solution to this, using haskell-src-meta to parse the type: {-# LANGUAGE TemplateHaskell #-} import Data.Typeable import Language.Haskell.Meta.Parse (parseType) import Language.Haskell.TH liftT :: Typeable a => a -> Type liftT x = either error id $ parseType $ show $ typeOf x This doesn't handle qualification properly, as the instance of Show for TypeRep doesn't qualify names. A proper solution would involve directly writing a (TypeRep -> Type) function. On Wed, Oct 15, 2014 at 9:06 PM, Hugo Pacheco wrote: > Hi list, > > I am 99.9% sure that this is currently not possible, but I might as well > ask: > > Is there a way to lift type variables into Template Haskell type splices? > > What I had in mind would be something like this (erroneous) code: > > liftT :: a -> Q Type > liftT (_::a) = [t| $a |] > > I have no idea how hard it would be to implement such a feature, or if it is > remotely doable. > Naively, it seems to me that TH would have to delay evaluating the splice > until the type variable is fully expanded, but all the necessary information > would still be available at some point during compilation. > > Cheers, > hugo > > -- > www.cs.cornell.edu/~hpacheco > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From the.dead.shall.rise at gmail.com Thu Oct 16 06:22:16 2014 From: the.dead.shall.rise at gmail.com (Mikhail Glushenkov) Date: Thu, 16 Oct 2014 08:22:16 +0200 Subject: [Haskell-cafe] Unicode symbols in operators In-Reply-To: <543EC9C0.1010909@nh2.me> References: <543EC9C0.1010909@nh2.me> Message-ID: Hi, On 15 October 2014 21:23, Niklas Hamb?chen wrote: > (I'm trying to improve Sublime Text's Haskell lexer.) > > https://www.haskell.org/onlinereport/haskell2010/haskellch10.html says > uniSymbol ? any Unicode symbol or punctuation > > What is meant here, is "Unicode symbol" literally \p{Symbol} in regex, > or more? > > So uniSymbol = \p{Symbol} | \p{Punctuation} Looking at the source of GHC's lexer [1], the relevant part seems to be: case generalCategory c of [...] ConnectorPunctuation -> symbol DashPunctuation -> symbol [...] OtherPunctuation -> symbol MathSymbol -> symbol CurrencySymbol -> symbol ModifierSymbol -> symbol OtherSymbol -> symbol [...] [1] https://github.com/ghc/ghc/blob/master/compiler/parser/Lexer.x From ivan.miljenovic at gmail.com Thu Oct 16 10:58:21 2014 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Thu, 16 Oct 2014 21:58:21 +1100 Subject: [Haskell-cafe] Converting a Constraint to Bool Message-ID: Using the Constraint type and the ConstraintKinds extension, is there any way we can determine if a Constraint is satisfied (i.e. a type-level function of type Constraint -> Bool using DataKinds)? -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From miguelimo38 at yandex.ru Thu Oct 16 11:06:07 2014 From: miguelimo38 at yandex.ru (Miguel Mitrofanov) Date: Thu, 16 Oct 2014 15:06:07 +0400 Subject: [Haskell-cafe] Converting a Constraint to Bool In-Reply-To: References: Message-ID: <155621413457567@web30h.yandex.ru> It's a bad idea. See, even if a constraint is not satisfied, there is no reason why it can't be satisfied later, in another module. So, inclusion of another module might change the behaviour of the code that was already compiled. I'm sure that after some oleging you'd find something that is more or less similar to what you want, but it's still a bad idea. 16.10.2014, 14:58, "Ivan Lazar Miljenovic" : > Using the Constraint type and the ConstraintKinds extension, is there > any way we can determine if a Constraint is satisfied (i.e. a > type-level function of type Constraint -> Bool using DataKinds)? > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From hpacheco at gmail.com Thu Oct 16 12:52:20 2014 From: hpacheco at gmail.com (Hugo Pacheco) Date: Thu, 16 Oct 2014 08:52:20 -0400 Subject: [Haskell-cafe] Splicing type signature in TH In-Reply-To: References: Message-ID: Hi, Yes, Michael's hack would do part of the trick, but I forgot to exemplify part of my question in the example code. The whole idea is that I would like to be able to splice the generated Type into a TH quotation. Consider one of the world's most complicated identity functions: {-# LANGUAGE TemplateHaskell #-} import Data.Typeable import Language.Haskell.Meta.Parse (parseType) import Language.Haskell.TH f :: Q Type -> Q Exp f m = m >>= \t -> SigE (VarE 'id) (FunT t t) liftT :: Typeable a => a -> Q Type liftT x = either fail return $ parseType $ show $ typeOf x -- separate files splicef :: Typeable a => a -> a splicef x = $(f (liftT x)) x This code does not work because liftT depends on the value of x, exposing TH's state restrictions, but since we only need the type of x to evaluate liftT, we should be fine. Thanks, hugo On Thu, Oct 16, 2014 at 1:22 AM, Michael Sloan wrote: > Here's a hacky solution to this, using haskell-src-meta to parse the type: > > {-# LANGUAGE TemplateHaskell #-} > > import Data.Typeable > import Language.Haskell.Meta.Parse (parseType) > import Language.Haskell.TH > > liftT :: Typeable a => a -> Type > liftT x = either error id $ parseType $ show $ typeOf x > > This doesn't handle qualification properly, as the instance of Show > for TypeRep doesn't qualify names. A proper solution would involve > directly writing a (TypeRep -> Type) function. > > On Wed, Oct 15, 2014 at 9:06 PM, Hugo Pacheco wrote: > > Hi list, > > > > I am 99.9% sure that this is currently not possible, but I might as well > > ask: > > > > Is there a way to lift type variables into Template Haskell type splices? > > > > What I had in mind would be something like this (erroneous) code: > > > > liftT :: a -> Q Type > > liftT (_::a) = [t| $a |] > > > > I have no idea how hard it would be to implement such a feature, or if > it is > > remotely doable. > > Naively, it seems to me that TH would have to delay evaluating the splice > > until the type variable is fully expanded, but all the necessary > information > > would still be available at some point during compilation. > > > > Cheers, > > hugo > > > > -- > > www.cs.cornell.edu/~hpacheco > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > -- www.cs.cornell.edu/~hpacheco -------------- next part -------------- An HTML attachment was scrubbed... URL: From nukasu.kanaka at gmail.com Thu Oct 16 13:52:23 2014 From: nukasu.kanaka at gmail.com (Nikita Volkov) Date: Thu, 16 Oct 2014 17:52:23 +0400 Subject: [Haskell-cafe] Converting a Constraint to Bool In-Reply-To: References: Message-ID: I recently experimented with that kinda stuff. See the following: type family SelectPrivilege a :: Bool type instance SelectPrivilege ReadTransaction = True type instance SelectPrivilege WriteTransaction = True type family UpdatePrivilege a :: Bool type instance UpdatePrivilege ReadTransaction = False type instance UpdatePrivilege WriteTransaction = True data Read data Write data Transaction t r executeUpdateTransaction :: UpdatePrivilege t ~ True => Transaction t r -> IO r executeUpdateTransaction = undefined ? The above code ensures that transactions of type Transaction Read r cannot be executed using the executeUpdateTransaction function. However then the same type level logic can be encoded using an existence of a type class instance: class SelectPrivilege t instance SelectPrivilege ReadTransaction instance SelectPrivilege WriteTransaction class UpdatePrivilege t instance UpdatePrivilege WriteTransaction data Read data Write data Transaction t r executeUpdateTransaction :: UpdatePrivilege t => Transaction t r -> IO r executeUpdateTransaction = undefined ? 2014-10-16 14:58 GMT+04:00 Ivan Lazar Miljenovic : > Using the Constraint type and the ConstraintKinds extension, is there > any way we can determine if a Constraint is satisfied (i.e. a > type-level function of type Constraint -> Bool using DataKinds)? > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eir at cis.upenn.edu Thu Oct 16 18:12:03 2014 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Thu, 16 Oct 2014 14:12:03 -0400 Subject: [Haskell-cafe] Converting a Constraint to Bool In-Reply-To: References: Message-ID: On Oct 16, 2014, at 6:58 AM, Ivan Lazar Miljenovic wrote: > Using the Constraint type and the ConstraintKinds extension, is there > any way we can determine if a Constraint is satisfied (i.e. a > type-level function of type Constraint -> Bool using DataKinds)? No, for precisely this reason: On Oct 16, 2014, at 7:06 AM, Miguel Mitrofanov wrote: > See, even if a constraint is not satisfied, there is no reason why it can't be satisfied later, in another module. So, inclusion of another module might change the behaviour of the code that was already compiled. But I disagree here: > > I'm sure that after some oleging you'd find something that is more or less similar to what you want, but it's still a bad idea. If you figure out some way to encode the feature you're after (converting a Constraint to a Bool like this), you've broken the type system. Please submit a bug report! Thanks, Richard From mgsloan at gmail.com Fri Oct 17 00:20:24 2014 From: mgsloan at gmail.com (Michael Sloan) Date: Thu, 16 Oct 2014 17:20:24 -0700 Subject: [Haskell-cafe] Splicing type signature in TH In-Reply-To: References: Message-ID: Hmm, did you try to compile that code? FunT doesn't exist. The definition of f should be: f :: Q Type -> Q Exp f m = m >>= \t -> return $ SigE (VarE 'id) (AppT (AppT ArrowT t) t) Or, better yet: f = fmap (\t -> SigE (VarE 'id) (AppT (AppT ArrowT t) t)) Yes, something like splicef is impossible, and this is exactly the kind of situation the stage restriction prevents. Consider how a usage of 'splicef' would need to work. Since the type is only known when compiling an invocation of it, this is also when code generation would need to happen. If it's used polymorphically within a function, then *that* function would also need to be recompiled for each of its invocations. In other words, it would need to be like C++ templates, rather than Haskell's normal polymorphic functions. Here's the best thing I can think of that might be useful (using typed expressions, because why not!). What's your usecase? {-# LANGUAGE TemplateHaskell #-} module A where import Data.Typeable import Language.Haskell.Meta.Parse (parseType) import Language.Haskell.TH liftT :: Typeable a => a -> Q Type liftT x = either fail return $ parseType $ show $ typeOf x splicef :: Typeable a => a -> Q (TExp (a -> a)) splicef x = do ty <- liftT x [e|| id :: ty -> ty ||] someValue :: [(Int, Int)] someValue = [] {-# LANGUAGE TemplateHaskell #-} module B where import A main = $$(splicef someValue) someValue On Thu, Oct 16, 2014 at 5:52 AM, Hugo Pacheco wrote: > Hi, > > Yes, Michael's hack would do part of the trick, but I forgot to exemplify > part of my question in the example code. > > The whole idea is that I would like to be able to splice the generated Type > into a TH quotation. Consider one of the world's most complicated identity > functions: > > {-# LANGUAGE TemplateHaskell #-} > > import Data.Typeable > import Language.Haskell.Meta.Parse (parseType) > import Language.Haskell.TH > > f :: Q Type -> Q Exp > f m = m >>= \t -> SigE (VarE 'id) (FunT t t) > > liftT :: Typeable a => a -> Q Type > liftT x = either fail return $ parseType $ show $ typeOf x > > -- separate files > > splicef :: Typeable a => a -> a > splicef x = $(f (liftT x)) x > > This code does not work because liftT depends on the value of x, exposing > TH's state restrictions, but since we only need the type of x to evaluate > liftT, we should be fine. > > Thanks, > hugo > > On Thu, Oct 16, 2014 at 1:22 AM, Michael Sloan wrote: >> >> Here's a hacky solution to this, using haskell-src-meta to parse the type: >> >> {-# LANGUAGE TemplateHaskell #-} >> >> import Data.Typeable >> import Language.Haskell.Meta.Parse (parseType) >> import Language.Haskell.TH >> >> liftT :: Typeable a => a -> Type >> liftT x = either error id $ parseType $ show $ typeOf x >> >> This doesn't handle qualification properly, as the instance of Show >> for TypeRep doesn't qualify names. A proper solution would involve >> directly writing a (TypeRep -> Type) function. >> >> On Wed, Oct 15, 2014 at 9:06 PM, Hugo Pacheco wrote: >> > Hi list, >> > >> > I am 99.9% sure that this is currently not possible, but I might as well >> > ask: >> > >> > Is there a way to lift type variables into Template Haskell type >> > splices? >> > >> > What I had in mind would be something like this (erroneous) code: >> > >> > liftT :: a -> Q Type >> > liftT (_::a) = [t| $a |] >> > >> > I have no idea how hard it would be to implement such a feature, or if >> > it is >> > remotely doable. >> > Naively, it seems to me that TH would have to delay evaluating the >> > splice >> > until the type variable is fully expanded, but all the necessary >> > information >> > would still be available at some point during compilation. >> > >> > Cheers, >> > hugo >> > >> > -- >> > www.cs.cornell.edu/~hpacheco >> > >> > _______________________________________________ >> > Haskell-Cafe mailing list >> > Haskell-Cafe at haskell.org >> > http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > > > > -- > www.cs.cornell.edu/~hpacheco From ivan.miljenovic at gmail.com Fri Oct 17 00:26:30 2014 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Fri, 17 Oct 2014 11:26:30 +1100 Subject: [Haskell-cafe] Converting a Constraint to Bool In-Reply-To: References: Message-ID: On 17 October 2014 05:12, Richard Eisenberg wrote: > On Oct 16, 2014, at 6:58 AM, Ivan Lazar Miljenovic wrote: >> Using the Constraint type and the ConstraintKinds extension, is there >> any way we can determine if a Constraint is satisfied (i.e. a >> type-level function of type Constraint -> Bool using DataKinds)? > > No, for precisely this reason: > > On Oct 16, 2014, at 7:06 AM, Miguel Mitrofanov wrote: >> See, even if a constraint is not satisfied, there is no reason why it can't be satisfied later, in another module. So, inclusion of another module might change the behaviour of the code that was already compiled. > Oh, because any such conversions would be done at compile time of the module that defined such behaviour and won't take into account any more instances or classes? Didn't think about that... > But I disagree here: > >> >> I'm sure that after some oleging you'd find something that is more or less similar to what you want, but it's still a bad idea. > > If you figure out some way to encode the feature you're after (converting a Constraint to a Bool like this), you've broken the type system. Please submit a bug report! > > Thanks, > Richard -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From yinbirmjin at gmail.com Fri Oct 17 02:00:13 2014 From: yinbirmjin at gmail.com (Birmjin In) Date: Fri, 17 Oct 2014 11:00:13 +0900 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team with many C, C++ and Java developers? Message-ID: Hi, Recently our development team had decided to attempt using Haskell or Scala as one of our programming language. (We had hoped some of our problem will be addressed through taking advantage of some element of FP, like immutability and Rx) Most of our team members have fairly good knowledge of C, C++ and Java. And few of them, including myself, have been self-studying a FP language like Haskell and Scala since last year. Besides some early starters, functional programming is quite new to us. When we held a lecture on FP, we found many of our developers were struggling in grasping some idea of FP. They fumbled with writing functional programming style code. We kept on lecturing several times, but still not quite successful. It seems more difficult than it looks - thinking in functional programming way for the long time C, C++ and Java developers. Does anyone had an experience with initiating FP adoption into a large dev team without pain? Our development team has around 300+ people. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kazu at iij.ad.jp Fri Oct 17 02:49:12 2014 From: kazu at iij.ad.jp (Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=)) Date: Fri, 17 Oct 2014 11:49:12 +0900 (JST) Subject: [Haskell-cafe] Yosemite Message-ID: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Hi, Has anybody tried GHC on Yosemite? I cannot afford to do it by myself this time. So, I would like to know. --Kazu From johnw at newartisans.com Fri Oct 17 02:59:59 2014 From: johnw at newartisans.com (John Wiegley) Date: Thu, 16 Oct 2014 21:59:59 -0500 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team with many C, C++ and Java developers? In-Reply-To: (Birmjin In's message of "Fri, 17 Oct 2014 11:00:13 +0900") References: Message-ID: >>>>> Birmjin In writes: > It seems more difficult than it looks - thinking in functional programming > way for the long time C, C++ and Java developers. C/C++ and Java all have a functional component: their expression language. Since this is the only way to writie constexpr functions in C++, for example, such functions must be FP in nature. I think the thing to get across is how a functional programs mutate values through a composition of smaller components: each function takes in an argument, and returns a result which is derived from that argument. This, of course, can be terribly inefficient in languages like C++, which do not have full support for taking advantage of things persistence, the way Haskell does. This is usually where a biggest disconnect happens: the functional "way" feels wrong, because it's not how you would ever write efficient C++. Teaching them to think that way requires viewing the "progression of data" in a completely different way. I remember it took me months to become comfortable with folds rather than for loops, exactly because of this distinction. Folds in C++ are a bit of a pain, and can be wasteful; while mutative iteration in Haskell is likewise a pain. I don't this gap can be bridged simply by taking one camp and showing them another language, and thinking that the insights will occur by themselves. You also have to talk about data structures, and how the whole concept of data flow through a program fundamentally changes when you have the facilities of a functional programming environment at your disposal. So, with an FP environment comes methodologies that are tuned for FP, and these methodologies do not always have direct analogues. What is good for one is not necessarily good for the other and vice versa. If you asked a C++ programmer how he'd compute Fibonacci using only the expression sub-language of C++, he could do it -- and he'd end up with a functional-style solution by doing so. But it would feel like tying his hands behind his back -- a feeling anyway who has done any template meta-programming has felt, since that is also a functional subset of C++, where most of the idioms are missing. I think that once the data flow model can be understood, and its benefits (in the scenarios where it does have benefits), then presenting how functional languages take advantage of these can make a lot more sense. John From carter.schonwald at gmail.com Fri Oct 17 03:03:32 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 16 Oct 2014 23:03:32 -0400 Subject: [Haskell-cafe] Yosemite In-Reply-To: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Message-ID: I too, plan to wait a week or so. I think mark L tested on 10.10 a while ago, and 7.8.3 is working fine with current xcodes! (which should match those in upgraded to yosemite ) On Thu, Oct 16, 2014 at 10:49 PM, Kazu Yamamoto wrote: > Hi, > > Has anybody tried GHC on Yosemite? > I cannot afford to do it by myself this time. > So, I would like to know. > > --Kazu > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hpacheco at gmail.com Fri Oct 17 03:48:45 2014 From: hpacheco at gmail.com (Hugo Pacheco) Date: Thu, 16 Oct 2014 23:48:45 -0400 Subject: [Haskell-cafe] Splicing type signature in TH In-Reply-To: References: Message-ID: Yes, my intuition was also that the splice would have to be specialized, forked, etc until the type becomes fully monomorphic. I was *hoping* to achieve the overly ambitious goal of deciding type inclusion purely at compile time (exactly what TYB does), but without having to shift completely to the odd meta programming world (as happens with TYB). The traditional solution is to introduce tailored type classes in the style of Typeable that provide value-level representations of types, but it gets more cumbersome. Also, when types are polymorphic the checks do not occur at compile time, introducing more overhead. On Thu, Oct 16, 2014 at 8:20 PM, Michael Sloan wrote: > Hmm, did you try to compile that code? FunT doesn't exist. The > definition of f should be: > > f :: Q Type -> Q Exp > f m = m >>= \t -> return $ SigE (VarE 'id) (AppT (AppT ArrowT t) t) > > Or, better yet: > > f = fmap (\t -> SigE (VarE 'id) (AppT (AppT ArrowT t) t)) > > Yes, something like splicef is impossible, and this is exactly the > kind of situation the stage restriction prevents. Consider how a > usage of 'splicef' would need to work. Since the type is only known > when compiling an invocation of it, this is also when code generation > would need to happen. If it's used polymorphically within a function, > then *that* function would also need to be recompiled for each of its > invocations. In other words, it would need to be like C++ templates, > rather than Haskell's normal polymorphic functions. > > Here's the best thing I can think of that might be useful (using typed > expressions, because why not!). What's your usecase? > > {-# LANGUAGE TemplateHaskell #-} > > module A where > > import Data.Typeable > import Language.Haskell.Meta.Parse (parseType) > import Language.Haskell.TH > > liftT :: Typeable a => a -> Q Type > liftT x = either fail return $ parseType $ show $ typeOf x > > splicef :: Typeable a => a -> Q (TExp (a -> a)) > splicef x = do > ty <- liftT x > [e|| id :: ty -> ty ||] > > someValue :: [(Int, Int)] > someValue = [] > > > {-# LANGUAGE TemplateHaskell #-} > > module B where > > import A > > main = $$(splicef someValue) someValue > > > > On Thu, Oct 16, 2014 at 5:52 AM, Hugo Pacheco wrote: > > Hi, > > > > Yes, Michael's hack would do part of the trick, but I forgot to exemplify > > part of my question in the example code. > > > > The whole idea is that I would like to be able to splice the generated > Type > > into a TH quotation. Consider one of the world's most complicated > identity > > functions: > > > > {-# LANGUAGE TemplateHaskell #-} > > > > import Data.Typeable > > import Language.Haskell.Meta.Parse (parseType) > > import Language.Haskell.TH > > > > f :: Q Type -> Q Exp > > f m = m >>= \t -> SigE (VarE 'id) (FunT t t) > > > > liftT :: Typeable a => a -> Q Type > > liftT x = either fail return $ parseType $ show $ typeOf x > > > > -- separate files > > > > splicef :: Typeable a => a -> a > > splicef x = $(f (liftT x)) x > > > > This code does not work because liftT depends on the value of x, exposing > > TH's state restrictions, but since we only need the type of x to evaluate > > liftT, we should be fine. > > > > Thanks, > > hugo > > > > On Thu, Oct 16, 2014 at 1:22 AM, Michael Sloan > wrote: > >> > >> Here's a hacky solution to this, using haskell-src-meta to parse the > type: > >> > >> {-# LANGUAGE TemplateHaskell #-} > >> > >> import Data.Typeable > >> import Language.Haskell.Meta.Parse (parseType) > >> import Language.Haskell.TH > >> > >> liftT :: Typeable a => a -> Type > >> liftT x = either error id $ parseType $ show $ typeOf x > >> > >> This doesn't handle qualification properly, as the instance of Show > >> for TypeRep doesn't qualify names. A proper solution would involve > >> directly writing a (TypeRep -> Type) function. > >> > >> On Wed, Oct 15, 2014 at 9:06 PM, Hugo Pacheco > wrote: > >> > Hi list, > >> > > >> > I am 99.9% sure that this is currently not possible, but I might as > well > >> > ask: > >> > > >> > Is there a way to lift type variables into Template Haskell type > >> > splices? > >> > > >> > What I had in mind would be something like this (erroneous) code: > >> > > >> > liftT :: a -> Q Type > >> > liftT (_::a) = [t| $a |] > >> > > >> > I have no idea how hard it would be to implement such a feature, or if > >> > it is > >> > remotely doable. > >> > Naively, it seems to me that TH would have to delay evaluating the > >> > splice > >> > until the type variable is fully expanded, but all the necessary > >> > information > >> > would still be available at some point during compilation. > >> > > >> > Cheers, > >> > hugo > >> > > >> > -- > >> > www.cs.cornell.edu/~hpacheco > >> > > >> > _______________________________________________ > >> > Haskell-Cafe mailing list > >> > Haskell-Cafe at haskell.org > >> > http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > > > > > > > > > > > -- > > www.cs.cornell.edu/~hpacheco > -- www.cs.cornell.edu/~hpacheco -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon at jonmsterling.com Fri Oct 17 04:57:25 2014 From: jon at jonmsterling.com (Jon Sterling) Date: Thu, 16 Oct 2014 21:57:25 -0700 Subject: [Haskell-cafe] Yosemite In-Reply-To: References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Message-ID: <1413521845.414129.180026501.69AF647A@webmail.messagingengine.com> I have been using current GHC on Yosemite for a few weeks, and it's working fine for me... On Thu, Oct 16, 2014, at 08:03 PM, Carter Schonwald wrote: I too, plan to wait a week or so. I think mark L tested on 10.10 a while ago, and 7.8.3 is working fine with current xcodes! (which should match those in upgraded to yosemite ) On Thu, Oct 16, 2014 at 10:49 PM, Kazu Yamamoto <[1]kazu at iij.ad.jp> wrote: Hi, Has anybody tried GHC on Yosemite? I cannot afford to do it by myself this time. So, I would like to know. --Kazu _______________________________________________ Haskell-Cafe mailing list [2]Haskell-Cafe at haskell.org [3]http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list [4]Haskell-Cafe at haskell.org [5]http://www.haskell.org/mailman/listinfo/haskell-cafe References 1. mailto:kazu at iij.ad.jp 2. mailto:Haskell-Cafe at haskell.org 3. http://www.haskell.org/mailman/listinfo/haskell-cafe 4. mailto:Haskell-Cafe at haskell.org 5. http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Fri Oct 17 06:51:23 2014 From: magnus at therning.org (Magnus Therning) Date: Fri, 17 Oct 2014 08:51:23 +0200 Subject: [Haskell-cafe] Yosemite In-Reply-To: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Message-ID: Now I feel ignorant, but what's Yosemite except a national park in California? /M On 17 Oct 2014 04:49, "Kazu Yamamoto" wrote: > Hi, > > Has anybody tried GHC on Yosemite? > I cannot afford to do it by myself this time. > So, I would like to know. > > --Kazu > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From miguelimo38 at yandex.ru Fri Oct 17 07:18:53 2014 From: miguelimo38 at yandex.ru (MigMit) Date: Fri, 17 Oct 2014 11:18:53 +0400 Subject: [Haskell-cafe] Yosemite In-Reply-To: References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Message-ID: The last version of the pretty much only UNIX on the market. ?????????? ? iPad > 17 ???. 2014 ?., ? 10:51, Magnus Therning ???????(?): > > Now I feel ignorant, but what's Yosemite except a national park in California? > > /M > >> On 17 Oct 2014 04:49, "Kazu Yamamoto" wrote: >> Hi, >> >> Has anybody tried GHC on Yosemite? >> I cannot afford to do it by myself this time. >> So, I would like to know. >> >> --Kazu >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmartin at eecs.berkeley.edu Fri Oct 17 07:27:03 2014 From: jmartin at eecs.berkeley.edu (James M) Date: Fri, 17 Oct 2014 00:27:03 -0700 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team with many C, C++ and Java developers? In-Reply-To: References: Message-ID: First off, immutability, laziness, and such are not strictly elements of functional programming. For example, Lisp (one of the first practical functional programming languages) has both mutation and strictness. I think probably the better approach is to start with the fundamentals. In MIT and Berkeley, we used to teach using a now classic book called SICP (Structure and Interpretation of Computer Programs). The first chapter covers the core concepts of functional programming, and I highly recommend it. Doing the exercises is necessary to really get a grasp. The book uses Lisp, but the syntax is so lightweight that it shouldn't be an issue. http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html The class taught at Berkeley and MIT is the first class that computer science majors take. Most of the students who took the course were already familiar with imperative programming, and while it can be a little mind bending at first, everyone eventually gets a grasp of it after the homework. If you are looking for the lectures, you can find them on youtube (or otherwise) by these course numbers. It always the first thing taught in the class. Berkeley: CS61A http://www.youtube.com/watch?v=zmYqShvVDh4 (and the following ones) MIT: 6.001 http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/ James On Thu, Oct 16, 2014 at 7:59 PM, John Wiegley wrote: > >>>>> Birmjin In writes: > > > It seems more difficult than it looks - thinking in functional > programming > > way for the long time C, C++ and Java developers. > > C/C++ and Java all have a functional component: their expression language. > Since this is the only way to writie constexpr functions in C++, for > example, > such functions must be FP in nature. > > I think the thing to get across is how a functional programs mutate values > through a composition of smaller components: each function takes in an > argument, and returns a result which is derived from that argument. > > This, of course, can be terribly inefficient in languages like C++, which > do > not have full support for taking advantage of things persistence, the way > Haskell does. This is usually where a biggest disconnect happens: the > functional "way" feels wrong, because it's not how you would ever write > efficient C++. Teaching them to think that way requires viewing the > "progression of data" in a completely different way. > > I remember it took me months to become comfortable with folds rather than > for > loops, exactly because of this distinction. Folds in C++ are a bit of a > pain, > and can be wasteful; while mutative iteration in Haskell is likewise a > pain. > > I don't this gap can be bridged simply by taking one camp and showing them > another language, and thinking that the insights will occur by themselves. > You also have to talk about data structures, and how the whole concept of > data > flow through a program fundamentally changes when you have the facilities > of a > functional programming environment at your disposal. > > So, with an FP environment comes methodologies that are tuned for FP, and > these methodologies do not always have direct analogues. What is good for > one > is not necessarily good for the other and vice versa. If you asked a C++ > programmer how he'd compute Fibonacci using only the expression > sub-language > of C++, he could do it -- and he'd end up with a functional-style solution > by > doing so. But it would feel like tying his hands behind his back -- a > feeling > anyway who has done any template meta-programming has felt, since that is > also > a functional subset of C++, where most of the idioms are missing. > > I think that once the data flow model can be understood, and its benefits > (in > the scenarios where it does have benefits), then presenting how functional > languages take advantage of these can make a lot more sense. > > John > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwm at mired.org Fri Oct 17 07:38:41 2014 From: mwm at mired.org (Mike Meyer) Date: Fri, 17 Oct 2014 02:38:41 -0500 Subject: [Haskell-cafe] Yosemite In-Reply-To: References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Message-ID: Hmm. Calling it the "only UNIX on the market" may be a bit of a stretch. And since I have a box or two running it, I certainly hope it's not the LAST version! FWIW, it's the latest release of OS X from Apple - except I don't think it's actually been released yet. Last I've heard (I've spent most of the last three days either in a small, uncomfortable seat very high in the air or recovering from that travel, so may have missed an announcement) it hasn't been released yet, and the latest thing available was a release candidate. As for it being "the pretty much only UNIX on the market", I think your definition is a bit to narrow - and my definition is narrow enough to exclude Linux. On Fri, Oct 17, 2014 at 2:18 AM, MigMit wrote: > The last version of the pretty much only UNIX on the market. > > ?????????? ? iPad > > 17 ???. 2014 ?., ? 10:51, Magnus Therning > ???????(?): > > Now I feel ignorant, but what's Yosemite except a national park in > California? > > /M > On 17 Oct 2014 04:49, "Kazu Yamamoto" wrote: > >> Hi, >> >> Has anybody tried GHC on Yosemite? >> I cannot afford to do it by myself this time. >> So, I would like to know. >> >> --Kazu >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mithrandi at mithrandi.net Fri Oct 17 07:41:44 2014 From: mithrandi at mithrandi.net (Tristan Seligmann) Date: Fri, 17 Oct 2014 09:41:44 +0200 Subject: [Haskell-cafe] Yosemite In-Reply-To: References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Message-ID: On 17 October 2014 09:38, Mike Meyer wrote: > FWIW, it's the latest release of OS X from Apple - except I don't think it's > actually been released yet. Last I've heard (I've spent most of the last > three days either in a small, uncomfortable seat very high in the air or > recovering from that travel, so may have missed an announcement) it hasn't > been released yet, and the latest thing available was a release candidate. The final release is now indeed out (as of about 12 hours ago, I think) :) -- mithrandi, i Ainil en-Balandor, a faer Ambar From kazu at iij.ad.jp Fri Oct 17 07:59:11 2014 From: kazu at iij.ad.jp (Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=)) Date: Fri, 17 Oct 2014 16:59:11 +0900 (JST) Subject: [Haskell-cafe] Yosemite In-Reply-To: <1413521845.414129.180026501.69AF647A@webmail.messagingengine.com> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> <1413521845.414129.180026501.69AF647A@webmail.messagingengine.com> Message-ID: <20141017.165911.640769318142577881.kazu@iij.ad.jp> Jon, > I have been using current GHC on Yosemite for a few weeks, and > it's working fine for me... Thanks. FYI. If you guys are planing to upgrade to Yosemite, the following article is highly recommended to read: https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/ --Kazu From info at jonkri.com Fri Oct 17 10:07:41 2014 From: info at jonkri.com (Jon Kristensen) Date: Fri, 17 Oct 2014 12:07:41 +0200 Subject: [Haskell-cafe] Haskell software engineering master thesis Message-ID: Hi, everyone! I'm about to write a software engineering/management master thesis at the IT University of Gothenburg, and I'm considering to do research into the Haskell world. It should probably be in one of the following five fields: empirical software engineering, requirements engineering, software architecture, model-driven engineering or quality management. The focus should probably be more towards an empirical study, rather than something more computer science-related. It should also add to general body of knowledge, and not be too tied to, for example, a specific implementation. Does anyone have any suggestions of relevant topics that I could write about, or perhaps some related papers that I could read? Thanks! Warm regards, Jon Kristensen -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at joefiorini.com Fri Oct 17 12:15:28 2014 From: joe at joefiorini.com (Joe Fiorini) Date: Fri, 17 Oct 2014 05:15:28 -0700 (PDT) Subject: [Haskell-cafe] Yosemite In-Reply-To: <20141017.165911.640769318142577881.kazu@iij.ad.jp> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> <1413521845.414129.180026501.69AF647A@webmail.messagingengine.com> <20141017.165911.640769318142577881.kazu@iij.ad.jp> Message-ID: <12979daa-ab47-4a07-a686-a4e14be48bc5@googlegroups.com> I have been using Yosemite for over a month. I had lots of trouble using GHC & cabal via Nix, but I now have it installed via Homebrew and it's working great. The downside was Homebrew didn't have a bottle for GHC when I installed it (does it now?) so I had to wait for it to compile. It took 111 minutes on my brand new, maxed out 13" MacBook Pro. If you don't want to go that route, there's also GHC for Mac OS X [1]. - Joe [1]: https://ghcformacosx.github.io On Friday, October 17, 2014 3:59:27 AM UTC-4, ???? Kazu Yamamoto wrote: > > Jon, > > > I have been using current GHC on Yosemite for a few weeks, and > > it's working fine for me... > > Thanks. > > FYI. If you guys are planing to upgrade to Yosemite, the following > article is highly recommended to read: > > https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/ > > --Kazu > > > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe at joefiorini.com Fri Oct 17 12:15:28 2014 From: joe at joefiorini.com (Joe Fiorini) Date: Fri, 17 Oct 2014 05:15:28 -0700 (PDT) Subject: [Haskell-cafe] Yosemite In-Reply-To: <20141017.165911.640769318142577881.kazu@iij.ad.jp> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> <1413521845.414129.180026501.69AF647A@webmail.messagingengine.com> <20141017.165911.640769318142577881.kazu@iij.ad.jp> Message-ID: <12979daa-ab47-4a07-a686-a4e14be48bc5@googlegroups.com> I have been using Yosemite for over a month. I had lots of trouble using GHC & cabal via Nix, but I now have it installed via Homebrew and it's working great. The downside was Homebrew didn't have a bottle for GHC when I installed it (does it now?) so I had to wait for it to compile. It took 111 minutes on my brand new, maxed out 13" MacBook Pro. If you don't want to go that route, there's also GHC for Mac OS X [1]. - Joe [1]: https://ghcformacosx.github.io On Friday, October 17, 2014 3:59:27 AM UTC-4, ???? Kazu Yamamoto wrote: > > Jon, > > > I have been using current GHC on Yosemite for a few weeks, and > > it's working fine for me... > > Thanks. > > FYI. If you guys are planing to upgrade to Yosemite, the following > article is highly recommended to read: > > https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/ > > --Kazu > > > _______________________________________________ > Haskell-Cafe mailing list > Haskel... at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rustompmody at gmail.com Fri Oct 17 14:25:38 2014 From: rustompmody at gmail.com (Rustom Mody) Date: Fri, 17 Oct 2014 19:55:38 +0530 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team with many C, C++ and Java developers? In-Reply-To: References: Message-ID: On Fri, Oct 17, 2014 at 7:30 AM, Birmjin In wrote: > Hi, > > Recently our development team had decided to attempt using Haskell or > Scala as one of our programming language. > > (We had hoped some of our problem will be addressed through taking > advantage of some element of FP, like immutability and Rx) > > Most of our team members have fairly good knowledge of C, C++ and Java. > And few of them, including myself, have been self-studying a FP language > like Haskell and Scala since last year. Besides some early starters, > functional programming is quite new to us. > > When we held a lecture on FP, we found many of our developers were > struggling in grasping some idea of FP. > > They fumbled with writing functional programming style code. We kept on > lecturing several times, but still not quite successful. > > It seems more difficult than it looks - thinking in functional programming > way for the long time C, C++ and Java developers. > > Does anyone had an experience with initiating FP adoption into a large dev > team without pain? > > Our development team has around 300+ people. > > Here is a grab-bag list that I made for a similar purpose: http://blog.languager.org/2012/10/functional-programming-lost-booty.html IOW its not really focussed on any language *technology* -- functional or otherwise. Rather it lists out (a bit tersely I guess [?]) what are some key *concepts/perspective* that a programmer needs to get, to think functionally -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 32B.gif Type: image/gif Size: 205 bytes Desc: not available URL: From donn at avvanta.com Fri Oct 17 15:45:08 2014 From: donn at avvanta.com (Donn Cave) Date: Fri, 17 Oct 2014 08:45:08 -0700 (PDT) Subject: [Haskell-cafe] Best way to Introduce FP into a dev team withmany C, C++ and Java developers? In-Reply-To: References: Message-ID: <20141017154508.53488276CB7@mail.avvanta.com> quoth Rustom Mody ... > Here is a grab-bag list that I made for a similar purpose: > http://blog.languager.org/2012/10/functional-programming-lost-booty.html > > IOW its not really focussed on any language *technology* -- functional or > otherwise. Rather it lists out (a bit tersely I guess [?]) what are some > key *concepts/perspective* that a programmer needs to get, to think > functionally Looks good, for me it's about the right amount of terse and covers a lot of ground. I don't know if it would help or hinder the learning experience, to acknowledge that there are some trade-offs. This doesn't apply so much to Scala, because (I think - from fiddling around with it for a week years ago) Scala, Objective CAML et al. support mutable variables and loop constructs etc., so ... it's a floor wax AND a dessert topping. But someone who's obliged to use recursive functions to replace the loop-with-mutables functionality he or she is used to, is going to be confronted with some awkward limitations, because loop-with-mutables supports more or less unlimited possibilities, where recursion is (for at least one thing) bound by the need for each iteration to be the same type. That isn't just "you need a new mindset to appreciate this" kind of thing, it's an example of a real obstacle that you just have to learn to get around. Donn From erantapaa at gmail.com Fri Oct 17 15:46:40 2014 From: erantapaa at gmail.com (Erik Rantapaa) Date: Fri, 17 Oct 2014 10:46:40 -0500 Subject: [Haskell-cafe] 2^770000 triggers Bus Error? Message-ID: Running ghci under OSX I am seeing the following behavior: Prelude> 2^750000 {... lots of digits...} Prelude> 2^760000 Segmentation Fault: 11 Prelude> 2^770000 Bus Error: 10 and I'm curious why this happens. More details: $ ghci --version The Glorious Glasgow Haskell Compilation System, version 7.8.3 I'm using the 64-bit version of the Haskell Platform (x86_64-darwin-7.8.3). -------------- next part -------------- An HTML attachment was scrubbed... URL: From alex at lagoa.com Fri Oct 17 15:51:09 2014 From: alex at lagoa.com (Alexander Vieth) Date: Fri, 17 Oct 2014 11:51:09 -0400 Subject: [Haskell-cafe] 2^770000 triggers Bus Error? In-Reply-To: References: Message-ID: Interesting. This is reproducible on my machine (OSX 10.7.5), with an older GHC: $ ghc --version The Glorious Glasgow Haskell Compilation System, version 7.6.3 Check out this ticket https://ghc.haskell.org/trac/ghc/ticket/7655 Alex On 2014-10-17, at 11:46 AM, Erik Rantapaa wrote: > Running ghci under OSX I am seeing the following behavior: > > Prelude> 2^750000 > {... lots of digits...} > > Prelude> 2^760000 > Segmentation Fault: 11 > > Prelude> 2^770000 > Bus Error: 10 > > and I'm curious why this happens. > > More details: > > $ ghci --version > The Glorious Glasgow Haskell Compilation System, version 7.8.3 > > I'm using the 64-bit version of the Haskell Platform (x86_64-darwin-7.8.3). > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From matteo.ferrando2 at gmail.com Fri Oct 17 16:08:10 2014 From: matteo.ferrando2 at gmail.com (Matteo Ferrando) Date: Fri, 17 Oct 2014 11:38:10 -0430 Subject: [Haskell-cafe] 2^770000 triggers Bus Error? In-Reply-To: References: Message-ID: I'm currently on a MacBook with OSX 10.9.5, and all three examples give me *{... lots of digits...}*. $ ghci --version The Glorious Glasgow Haskell Compilation System, version 7.8.3 On Fri, Oct 17, 2014 at 11:21 AM, Alexander Vieth wrote: > Interesting. This is reproducible on my machine (OSX 10.7.5), with an > older GHC: > > $ ghc --version > The Glorious Glasgow Haskell Compilation System, version 7.6.3 > > Check out this ticket https://ghc.haskell.org/trac/ghc/ticket/7655 > > Alex > > On 2014-10-17, at 11:46 AM, Erik Rantapaa wrote: > > Running ghci under OSX I am seeing the following behavior: > > Prelude> 2^750000 > {... lots of digits...} > > Prelude> 2^760000 > Segmentation Fault: 11 > > Prelude> 2^770000 > Bus Error: 10 > > and I'm curious why this happens. > > More details: > > $ ghci --version > The Glorious Glasgow Haskell Compilation System, version 7.8.3 > > I'm using the 64-bit version of the Haskell Platform (x86_64-darwin-7.8.3). > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kyle.marek.spartz at gmail.com Fri Oct 17 17:11:55 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Fri, 17 Oct 2014 12:11:55 -0500 Subject: [Haskell-cafe] 2^770000 triggers Bus Error? In-Reply-To: References: Message-ID: <02d0e50f-81b7-4217-aedb-74d3df38d18e@highlander> https://ghc.haskell.org/trac/ghc/ticket/7655 ? Kyle Marek-Spartz On Oct 17, 2014, 11:08:10 AM, Matteo Ferrando wrote: I'm currently on a MacBook with OSX 10.9.5, and all three examples give me *{... lots of digits...}*. $ ghci --version The Glorious Glasgow Haskell Compilation System, version 7.8.3 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kc1956 at gmail.com Fri Oct 17 17:26:25 2014 From: kc1956 at gmail.com (KC) Date: Fri, 17 Oct 2014 10:26:25 -0700 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team with many C, C++ and Java developers? In-Reply-To: References: Message-ID: One can do functional design without using a functional language. That may be a more copacetic way to introduce them to functional concepts. -- -- Sent from an expensive device which will be obsolete in a few months! :D Casey On Oct 16, 2014 7:00 PM, "Birmjin In" wrote: > Hi, > > Recently our development team had decided to attempt using Haskell or > Scala as one of our programming language. > > (We had hoped some of our problem will be addressed through taking > advantage of some element of FP, like immutability and Rx) > > Most of our team members have fairly good knowledge of C, C++ and Java. > And few of them, including myself, have been self-studying a FP language > like Haskell and Scala since last year. Besides some early starters, > functional programming is quite new to us. > > When we held a lecture on FP, we found many of our developers were > struggling in grasping some idea of FP. > > They fumbled with writing functional programming style code. We kept on > lecturing several times, but still not quite successful. > > It seems more difficult than it looks - thinking in functional programming > way for the long time C, C++ and Java developers. > > Does anyone had an experience with initiating FP adoption into a large dev > team without pain? > > Our development team has around 300+ people. > > Thanks. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.wobben at home.nl Fri Oct 17 18:14:34 2014 From: r.wobben at home.nl (Roelof Wobben) Date: Fri, 17 Oct 2014 20:14:34 +0200 Subject: [Haskell-cafe] beginnners book Message-ID: <54415C8A.4020501@home.nl> Hello, What is a good book to learn Haskell with a lot of exercises so I can check if I understand everything right ? Roelof From cma at bitemyapp.com Fri Oct 17 18:16:42 2014 From: cma at bitemyapp.com (Christopher Allen) Date: Fri, 17 Oct 2014 13:16:42 -0500 Subject: [Haskell-cafe] beginnners book In-Reply-To: <54415C8A.4020501@home.nl> References: <54415C8A.4020501@home.nl> Message-ID: I'm side-stepping the strict definition of a "book" here, but this: https://github.com/bitemyapp/learnhaskell is the guide I use to teach Haskell. It's primarily cis194 followed by the NICTA course, augmented by LYAH and RWH as supplemental references. I'm working on a book as well, but that's still early and cannot help you yet. Remember to have fun while learning Haskell. :) --- Chris Allen On Fri, Oct 17, 2014 at 1:14 PM, Roelof Wobben wrote: > Hello, > > What is a good book to learn Haskell with a lot of exercises so I can > check if I understand everything right ? > > Roelof > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mwm at mired.org Fri Oct 17 19:28:05 2014 From: mwm at mired.org (Mike Meyer) Date: Fri, 17 Oct 2014 14:28:05 -0500 Subject: [Haskell-cafe] beginnners book In-Reply-To: <54415C8A.4020501@home.nl> References: <54415C8A.4020501@home.nl> Message-ID: Since we've already pointed out some non-books, I'll point you at: https://www.fpcomplete.com/school/starting-with-haskell That includes three intro books: a course textbook from a Yale CS intro to Haskell, an online book intended for experienced programmers, and a book written specifically for the School of Haskell. Being on the SoH gives you two advantages: 1) exercises are presented as active code snippets that you can edit and run in your browser, which means 2) you don't have to figure out how to get a Haskell environment set up on your system. Full disclosure: I've done contract work for FP Complete, including participation in selecting what material wound up in the "Starting with Haskell" folder. On Fri, Oct 17, 2014 at 1:14 PM, Roelof Wobben wrote: > Hello, > > What is a good book to learn Haskell with a lot of exercises so I can > check if I understand everything right ? > > Roelof > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.wobben at home.nl Fri Oct 17 19:42:30 2014 From: r.wobben at home.nl (Roelof Wobben) Date: Fri, 17 Oct 2014 21:42:30 +0200 Subject: [Haskell-cafe] beginnners book In-Reply-To: References: <54415C8A.4020501@home.nl> Message-ID: <54417126.4070800@home.nl> An HTML attachment was scrubbed... URL: From mwm at mired.org Fri Oct 17 20:07:20 2014 From: mwm at mired.org (Mike Meyer) Date: Fri, 17 Oct 2014 15:07:20 -0500 Subject: [Haskell-cafe] beginnners book In-Reply-To: <54417126.4070800@home.nl> References: <54415C8A.4020501@home.nl> <54417126.4070800@home.nl> Message-ID: On Fri, Oct 17, 2014 at 2:42 PM, Roelof Wobben wrote: > Mike Meyer schreef op 17-10-2014 21:28: > > Since we've already pointed out some non-books, I'll point you at: > https://www.fpcomplete.com/school/starting-with-haskell > > That includes three intro books: a course textbook from a Yale CS intro > to Haskell, an online book intended for experienced programmers, and a book > written specifically for the School of Haskell. Being on the SoH gives you > two advantages: 1) exercises are presented as active code snippets that you > can edit and run in your browser, which means 2) you don't have to figure > out how to get a Haskell environment set up on your system. > > > I have looked at the course but I cannot figure out which beginners course > is the best. > As with any such question, that depends on what you want, what you already know and how you learn. If you're an experienced programmer who wants to write or maintain Haskell code, I'd recommend "Fast and Hard." If you're interested in functional programming and want to use Haskell to learn about it, then try "Introduction to". If you're more curious about Haskell, then try "Basics of". -------------- next part -------------- An HTML attachment was scrubbed... URL: From r.wobben at home.nl Fri Oct 17 20:22:27 2014 From: r.wobben at home.nl (Roelof Wobben) Date: Fri, 17 Oct 2014 22:22:27 +0200 Subject: [Haskell-cafe] beginnners book In-Reply-To: References: <54415C8A.4020501@home.nl> <54417126.4070800@home.nl> Message-ID: <54417A83.9070008@home.nl> An HTML attachment was scrubbed... URL: From fuuzetsu at fuuzetsu.co.uk Sat Oct 18 01:14:55 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Sat, 18 Oct 2014 02:14:55 +0100 Subject: [Haskell-cafe] Yosemite In-Reply-To: <12979daa-ab47-4a07-a686-a4e14be48bc5@googlegroups.com> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> <1413521845.414129.180026501.69AF647A@webmail.messagingengine.com> <20141017.165911.640769318142577881.kazu@iij.ad.jp> <12979daa-ab47-4a07-a686-a4e14be48bc5@googlegroups.com> Message-ID: <5441BF0F.5000003@fuuzetsu.co.uk> On 10/17/2014 01:15 PM, Joe Fiorini wrote: > I have been using Yosemite for over a month. I had lots of trouble using > GHC & cabal via Nix, but I now have it installed via Homebrew and it's > working great. The downside was Homebrew didn't have a bottle for GHC when > I installed it (does it now?) so I had to wait for it to compile. It took > 111 minutes on my brand new, maxed out 13" MacBook Pro. If you don't want > to go that route, there's also GHC for Mac OS X [1]. > > - Joe > > [1]: https://ghcformacosx.github.io I believe the situation of Yosemite + nix is now better than it was a month ago in case anyone is interested. Ask in #nixos if in doubt. > On Friday, October 17, 2014 3:59:27 AM UTC-4, ???? Kazu Yamamoto wrote: >> >> Jon, >> >>> I have been using current GHC on Yosemite for a few weeks, and >>> it's working fine for me... >> >> Thanks. >> >> FYI. If you guys are planing to upgrade to Yosemite, the following >> article is highly recommended to read: >> >> https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/ >> >> --Kazu >> >> -- Mateusz K. From ok at cs.otago.ac.nz Sat Oct 18 01:48:33 2014 From: ok at cs.otago.ac.nz (ok at cs.otago.ac.nz) Date: Sat, 18 Oct 2014 14:48:33 +1300 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team withmany C, C++ and Java developers? In-Reply-To: <20141017154508.53488276CB7@mail.avvanta.com> References: <20141017154508.53488276CB7@mail.avvanta.com> Message-ID: <0f2508f1c24027cae0a48869d6f38770.squirrel@chasm.otago.ac.nz> Donn Cave wrote > But someone who's obliged to use recursive functions to replace the > loop-with-mutables functionality he or she is used to, is going to be > confronted with some awkward limitations, because loop-with-mutables > supports more or less unlimited possibilities, where recursion is > (for at least one thing) bound by the need for each iteration to be > the same type. That isn't just "you need a new mindset to appreciate > this" kind of thing, it's an example of a real obstacle that you just > have to learn to get around. Can you expand on this, because I just don't get it. while Cond do Stmt -- where Vars change in Stmt = loop Vars where loop Vars = if Cond then Stmt;Vars' else Vars Ad hoc definition: *shallow mutation* is replacing the values of entire variables, *deep mutation* is replacing proper parts of variables, *dangerous mutation* is replacing *shared* proper parts of variables. Any loop with shallow mutation can be trivially transliterated to a tail recursion with the same asymptotic cost. Any loop with deep mutation can be trivially transliterated to a tail recursion but with possibly a log(size of data) slowdown -- using uniqueness typing in Clean or monads in Haskell this slowdown can usually be avoided. Any loop with dangerous mutation is asking for trouble in any language, and will be very awkward to express in a functional language, but the problem is the dangerous mutation, not the looping. In imperative languages (such as Dijkstra's notation, Fortran, C, PL/I, C#, D, any of the Algols, Ada, ) I am used to loops where each iteration uses the same body, so I don't understand how this is any less restrictive than a recursion. From ok at cs.otago.ac.nz Sat Oct 18 01:51:18 2014 From: ok at cs.otago.ac.nz (ok at cs.otago.ac.nz) Date: Sat, 18 Oct 2014 14:51:18 +1300 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team with many C, C++ and Java developers? In-Reply-To: References: Message-ID: <2dbe9f1ee80ada264d8f4ab784f66fb0.squirrel@chasm.otago.ac.nz> One idea, which is half fun and full earnest, is - get Mono - teach them C# as a "better Java than Java" - introduce them to LINQ. Or equivalently, start them on Python. From eric at seidel.io Sat Oct 18 02:28:42 2014 From: eric at seidel.io (Eric Seidel) Date: Fri, 17 Oct 2014 19:28:42 -0700 Subject: [Haskell-cafe] Yosemite In-Reply-To: <5441BF0F.5000003@fuuzetsu.co.uk> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> <1413521845.414129.180026501.69AF647A@webmail.messagingengine.com> <20141017.165911.640769318142577881.kazu@iij.ad.jp> <12979daa-ab47-4a07-a686-a4e14be48bc5@googlegroups.com> <5441BF0F.5000003@fuuzetsu.co.uk> Message-ID: <9DBD2BF0-867C-4D96-B645-2390902D9D9A@seidel.io> Even better, come to ##nix-darwin. > On Oct 17, 2014, at 18:14, Mateusz Kowalczyk wrote: > > On 10/17/2014 01:15 PM, Joe Fiorini wrote: >> I have been using Yosemite for over a month. I had lots of trouble using >> GHC & cabal via Nix, but I now have it installed via Homebrew and it's >> working great. The downside was Homebrew didn't have a bottle for GHC when >> I installed it (does it now?) so I had to wait for it to compile. It took >> 111 minutes on my brand new, maxed out 13" MacBook Pro. If you don't want >> to go that route, there's also GHC for Mac OS X [1]. >> >> - Joe >> >> [1]: https://ghcformacosx.github.io > > I believe the situation of Yosemite + nix is now better than it was a > month ago in case anyone is interested. Ask in #nixos if in doubt. > >> On Friday, October 17, 2014 3:59:27 AM UTC-4, ???? Kazu Yamamoto wrote: >>> >>> Jon, >>> >>>> I have been using current GHC on Yosemite for a few weeks, and >>>> it's working fine for me... >>> >>> Thanks. >>> >>> FYI. If you guys are planing to upgrade to Yosemite, the following >>> article is highly recommended to read: >>> >>> https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/ >>> >>> --Kazu >>> >>> > > -- > Mateusz K. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From agocorona at gmail.com Sat Oct 18 07:21:42 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Sat, 18 Oct 2014 09:21:42 +0200 Subject: [Haskell-cafe] Best way to Introduce FP into a dev team with many C, C++ and Java developers? In-Reply-To: References: Message-ID: Hi; - Choose a problem that you have at hand . - Write the specification in haskell, using ADTs, do sequences, applicative, alternative and pure code. so that every one can understand the match of the code with the specification - Make this specification run by adding class instances and function definitions - show how you have made not only a solution for this particular problem, but a EDSL for all the problems of this kind. 2014-10-17 4:00 GMT+02:00 Birmjin In : > Hi, > > Recently our development team had decided to attempt using Haskell or > Scala as one of our programming language. > > (We had hoped some of our problem will be addressed through taking > advantage of some element of FP, like immutability and Rx) > > Most of our team members have fairly good knowledge of C, C++ and Java. > And few of them, including myself, have been self-studying a FP language > like Haskell and Scala since last year. Besides some early starters, > functional programming is quite new to us. > > When we held a lecture on FP, we found many of our developers were > struggling in grasping some idea of FP. > > They fumbled with writing functional programming style code. We kept on > lecturing several times, but still not quite successful. > > It seems more difficult than it looks - thinking in functional programming > way for the long time C, C++ and Java developers. > > Does anyone had an experience with initiating FP adoption into a large dev > team without pain? > > Our development team has around 300+ people. > > Thanks. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From trtoaster at googlemail.com Sat Oct 18 15:30:01 2014 From: trtoaster at googlemail.com (Thorsten Rangwich) Date: Sat, 18 Oct 2014 17:30:01 +0200 Subject: [Haskell-cafe] What happened to hugs? In-Reply-To: References: <-3701248786196244697@unknownmsgid> Message-ID: <8ECA5AF1-6F99-47AC-A1D7-B0F9C6FE5310@googlemail.com> Great stuff. :) That must have been a lot of work. Thank you very much. \ Thorsten. Am 10.10.2014 um 04:04 schrieb Gershom B: > I?m happy to announce that http://www.haskell.org/hugs has now been resuscitated, and should contain complete documentation and downloads for the Hugs system. Furthermore we?re working on putting put in place a redirect so that http://cvs.haskell.org will be able to point to the new location to keep older links intact. > > If there are any other stale links anyone would like patched up or binary releases that people feel should be pointed to, please let us know at admin at haskell.org. > > -gershom > > > On September 25, 2014 at 11:57:58 PM, Rustom Mody (rustompmody at gmail.com) wrote: >> On Thu, Sep 11, 2014 at 2:03 AM, Thorsten Rangwich > > wrote: >> >>> Hi, >>> >>> I suppose this question is not new, but neither google nor a manual search >>> file be file through the archives brought enlightement. >>> >>> www.haskell.org/hugs >>> >>> still exists, but none of the links there does work. Documentation and >>> source point to cvs.haskell.org ("server does not exist") and development >>> points to http://hackage.haskell.org/trac/hugs ("page does not exist"). >>> >>> Was it migrated to somewhere else or is it dead - in latter case the page >>> would not make sense any more. >>> >>> >> >> Sad that hugs links are now dead. >> >> There is still gofer (the predecessor to hugs). >> The original of Mark Jones and modifications made by me in the early 90s >> and the whys of these modifications are at >> http://blog.languager.org/2014/09/pugofer.html >> >> >>> "Raskell" (iPad app) provided a development environment usinh hugs, so I >>> would at least like to install hugs on my Mac as well... >>> >> >> Dont know about macs but last I knew it was compiling with gcc on linux >> (in all of 10 seconds!) >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > From corentin.dupont at gmail.com Sat Oct 18 18:57:53 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sat, 18 Oct 2014 20:57:53 +0200 Subject: [Haskell-cafe] Profiling with an interpreter Message-ID: Hi, I'm trying to profile my game (Nomyx) but I get: "You can't call hscCompileCoreExpr in a profiled compiler". I figured out it's because I'm embbeding an intrepreter. Is there a way to avoid that and profile anyway? Maybe ignoring the calls to the interpreter or something... Cheers Corentin -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Sun Oct 19 01:36:04 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sat, 18 Oct 2014 18:36:04 -0700 Subject: [Haskell-cafe] Precise timing Message-ID: Hi, An earlier version of this question is cross-posted at StackOverflow . What should I use for precise (and eventually, concurrency-compatible) timing in Haskell? I want to make rhythms. I tried the following to produce a repeating rhythm in which one note is twice as long as the other two. (That rhythm is encoded by the list [1,1,2].) import Control.Concurrent import Text.Printf import Control.Monad main = mapM_ note (cycle [1,1,2]) beat = round (10^6 / 4) -- measured in microseconds note :: Int -> IO () note n = do threadDelay $ beat * n printf "\BEL\n" When I run it the long note is three times as long as the others, not twice. If I speed it up, by changing the number 4 to a 10, the rhythm is destroyed completely: the notes all have the same length. threadDelay is guaranteed to wait at least as long, but potentially longer than, what the caller specifies. Another potential problem could be buffering in printf. (Eventually I intend to replace the printf statement with OSC output to a sound generator.) Thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Sun Oct 19 02:19:54 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Sat, 18 Oct 2014 22:19:54 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: On Sat, Oct 18, 2014 at 9:36 PM, Jeffrey Brown wrote: > threadDelay is guaranteed > > > to wait at least as long, but potentially longer than, what the caller > specifies. Another potential problem could be buffering in printf. > (Eventually I intend to replace the printf statement with OSC output to a > sound generator.) > This isn't going to be solved completely within Haskell; the behavior of threadDelay is the behavior of the system scheduler for a normal process, possibly modified by garbage collection delays. You'll need to switch the process to a realtime scheduling class to remove --- or at least reduce --- the OS's contribution to the uncertainties in sleep times. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Oct 19 04:48:38 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 19 Oct 2014 00:48:38 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: if you care about precise timing (at the cost of of some loss of throughput) you can compile your code with -fno-omit-yields, and also the context switching timer see eg http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/using-concurrent.html default context switching rate for threads is -C0.02 (20ms), but you can set the rate as small as you like, and -C0 will trigger a context switch at every yield. happy experimenting! On Sat, Oct 18, 2014 at 10:19 PM, Brandon Allbery wrote: > On Sat, Oct 18, 2014 at 9:36 PM, Jeffrey Brown > wrote: > >> threadDelay is guaranteed >> >> >> to wait at least as long, but potentially longer than, what the caller >> specifies. Another potential problem could be buffering in printf. >> (Eventually I intend to replace the printf statement with OSC output to a >> sound generator.) >> > > This isn't going to be solved completely within Haskell; the behavior of > threadDelay is the behavior of the system scheduler for a normal process, > possibly modified by garbage collection delays. You'll need to switch the > process to a realtime scheduling class to remove --- or at least reduce --- > the OS's contribution to the uncertainties in sleep times. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Oct 19 04:49:17 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 19 Oct 2014 00:49:17 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: to clarify, the -C flag is an RTS flag On Sun, Oct 19, 2014 at 12:48 AM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > if you care about precise timing (at the cost of of some loss of > throughput) > you can compile your code with -fno-omit-yields, and also the context > switching timer > see eg > http://www.haskell.org/ghc/docs/7.4.2/html/users_guide/using-concurrent.html > > default context switching rate for threads is -C0.02 (20ms), but you can > set the rate as small as you like, and -C0 will trigger a context switch at > every yield. > > happy experimenting! > > On Sat, Oct 18, 2014 at 10:19 PM, Brandon Allbery > wrote: > >> On Sat, Oct 18, 2014 at 9:36 PM, Jeffrey Brown >> wrote: >> >>> threadDelay is guaranteed >>> >>> >>> to wait at least as long, but potentially longer than, what the caller >>> specifies. Another potential problem could be buffering in printf. >>> (Eventually I intend to replace the printf statement with OSC output to a >>> sound generator.) >>> >> >> This isn't going to be solved completely within Haskell; the behavior of >> threadDelay is the behavior of the system scheduler for a normal process, >> possibly modified by garbage collection delays. You'll need to switch the >> process to a realtime scheduling class to remove --- or at least reduce --- >> the OS's contribution to the uncertainties in sleep times. >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vigalchin at gmail.com Sun Oct 19 06:31:55 2014 From: vigalchin at gmail.com (Vasili I. Galchin) Date: Sun, 19 Oct 2014 01:31:55 -0500 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. Message-ID: Hi Fellow Haskellers, I was just reading at http://www.haskell.org. I am looking for a list of currently active Haskell projects needing help .. :-) Vasili -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Sun Oct 19 06:32:46 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sat, 18 Oct 2014 23:32:46 -0700 Subject: [Haskell-cafe] Eval forgotten unless type specified? Message-ID: In this passage, after the seq call, :sprint reveals x and y to be evaluated: let x = 1 + 2 :: Int let y = x + 1 :sprint x :sprint y seq y () :sprint x :sprint y The above is a verbatim quote of Marlow's Concurrency book, chapter 2. In the below, however, :sprint shows them unevaluated both before and after the seq call. let x = 1 + 2 let y = x + 1 :sprint x :sprint y seq y () :sprint x :sprint y Why? -------------- next part -------------- An HTML attachment was scrubbed... URL: From apfelmus at quantentunnel.de Sun Oct 19 07:40:26 2014 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Sun, 19 Oct 2014 09:40:26 +0200 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: Jeffrey Brown wrote: > An earlier version of this question is cross-posted at StackOverflow > > .. > > What should I use for precise (and eventually, concurrency-compatible) > timing in Haskell? I want to make rhythms. I tried the following to produce > a repeating rhythm in which one note is twice as long as the other two. > (That rhythm is encoded by the list [1,1,2].) > > import Control.Concurrent > import Text.Printf > import Control.Monad > > main = mapM_ note (cycle [1,1,2]) > > beat = round (10^6 / 4) -- measured in microseconds > > note :: Int -> IO () > note n = do > threadDelay $ beat * n > printf "\BEL\n" > > When I run it the long note is three times as long as the others, not > twice. If I speed it up, by changing the number 4 to a 10, the rhythm is > destroyed completely: the notes all have the same length. > > threadDelay is guaranteed > > to > wait at least as long, but potentially longer than, what the caller > specifies. Another potential problem could be buffering in printf. > (Eventually I intend to replace the printf statement with OSC output to a > sound generator.) > > Thanks, > Jeff I found that that compiling a program with the -threaded option greatly improves the precision of threadDelay for the purpose of making rhythms. Your program is simple enough that this shouldn't make a difference, though. Note that there may also be issues with stdout buffering. Try System.IO.hSetBuffering stdout NoBuffering before the main loop. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Sun Oct 19 08:43:13 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Sun, 19 Oct 2014 09:43:13 +0100 Subject: [Haskell-cafe] Eval forgotten unless type specified? In-Reply-To: References: Message-ID: <20141019084313.GO6192@weber> On Sat, Oct 18, 2014 at 11:32:46PM -0700, Jeffrey Brown wrote: > In the below, however, :sprint shows them unevaluated both before and > after > the seq call. > let x = 1 + 2 > let y = x + 1 > :sprint x > :sprint y > seq y () > :sprint x > :sprint y > > Why? Because you are using GHC 7.8 where the mmonomorphism restriction is not imposed. Without the monomorphism restriction `1 + 2` is of type `Num a => a`, not `Int`, and forcing it does not memoize the result. Try running GHCi with `-XMonomorphismRestriction`. Tom From nicola.gigante at gmail.com Sun Oct 19 11:42:57 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Sun, 19 Oct 2014 13:42:57 +0200 Subject: [Haskell-cafe] Recommended way to install, use and maintain haskell tools on OS X Message-ID: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> Hi I know this question might be a little old, but I happen to have a from scratch installation of OS X (yosemite) on my machine and I want to install the haskell tools in the currently best way. So I summarize the options that I understand are available: 1) A non-option first: the Homebrew formula for haskell-platform is no longer available, but? 2) There are formulas for GHC (7.8.x) and cabal, so I can install those and install the other packages with the homebrew cabal. 3) I can install the binary distribution of the Haskell Platform for OS X directly from the website, and then install any needed package with cabal. 4) I?ve heard of Nix, what is this all about? 5) Installing manually the binary distributions of ghc and cabal. No thanks. That said, what is the recommended way to manage packages once I have cabal and ghc? 1) Installing everything locally into ~/Library/Haskell, which afaik is the default behavior of cabal. That also means having ~/Library/Haskell/bin in the PATH. But do I have to also have ~/.cabal/bin in the PATH? Why having two different local bin directories? What happens to the packages installed by haskell platform system-wide? They are left there, shadowed by the local ones, and never again touched nor updated? 2) Installing everything globally, changing the cabal configuration to make it the default. Afaik bad idea, but then I don?t have obsoleted packages installed system-wide. 3) Installing nothing, and relying on sandboxes to install exactly what is needed for any single package I need. This option is still a bit mysterious to me. 3a) If I need to install a package I need for development, I do cabal sandbox init in my source tree and then if I install something from inside it, cabal installs it in the sandbox. Am I correct? 3a) If I need to install a package I need to _use_, instead, what to do? Sorry for the confusion and thanks for the clarification. Bye, Nicola From hjgtuyl at chello.nl Sun Oct 19 13:11:14 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Sun, 19 Oct 2014 15:11:14 +0200 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: On Sun, 19 Oct 2014 08:31:55 +0200, Vasili I. Galchin wrote: > Hi Fellow Haskellers, > > I was just reading at http://www.haskell.org. I am looking for a > list > of currently active Haskell projects needing help .. :-) > > Vasili wxHaskell[0] could use your support very well, I hope others will join in as well. wxHaskell can be used for both game and serious software, but could use more support. What is it? ----------- wxHaskell is a portable and native GUI library for Haskell. The goal of the project is to provide an industrial strength GUI library for Haskell, but without the burden of developing (and maintaining) one ourselves. wxHaskell is therefore built on top of wxWidgets ? a comprehensive C++ library that is portable across all major GUI platforms; including GTK, Windows, X11, and MacOS X. Furthermore, it is a mature library (in development since 1992) that supports a wide range of widgets with the native look-and-feel. The wxHaskell project[0] could use more participants. What can be done? ----------------- Some of the activities: - Adding new features - Writing sample programs for testing and teaching (for functionality not used in sample programs so far) - Simplifying installation (e.g. creating a wxWidgets binary package with installation program) - Solving bugs - Add/improve descriptions of the wxHaskell API in the source code (include usage samples) - Write a manual, similar to the wxWidgets manual[1] - Trying wxHaskell on Android and other new platforms - Testing - Creating binary packages - Updating the wiki pages Look at the bug tickets and feature requests[2] for details of some of the things to do. Regards, Henk-Jan van Tuyl [0] https://www.haskell.org/haskellwiki/WxHaskell [1] http://docs.wxwidgets.org/stable/ [2] http://sourceforge.net/p/wxhaskell/_list/tickets -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ From carter.schonwald at gmail.com Sun Oct 19 16:52:45 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 19 Oct 2014 12:52:45 -0400 Subject: [Haskell-cafe] Recommended way to install, use and maintain haskell tools on OS X In-Reply-To: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> References: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> Message-ID: ignore all the stuff about haskell platform. use this http://ghcformacosx.github.io/ and the Library / ~/Library stuff is wholely an artifact of haskell platform. use the vanilla cabal config setup that uses ~/.cabal and entails putting ~/.cabal/bin in your PATH use cabal sandbox for application dev that you plan to deploy elsewhere / share (because you'll easily wind up having multiple projects going on at once) and use normal cabal install (into ~/.cabal) otherwise. On Sun, Oct 19, 2014 at 7:42 AM, Nicola Gigante wrote: > Hi > > I know this question might be a little old, but I happen to have a from > scratch > installation of OS X (yosemite) on my machine and I want to install the > haskell > tools in the currently best way. > > So I summarize the options that I understand are available: > > 1) A non-option first: the Homebrew formula for haskell-platform is no > longer > available, but? > 2) There are formulas for GHC (7.8.x) and cabal, so I can install those and > install the other packages with the homebrew cabal. > 3) I can install the binary distribution of the Haskell Platform for OS X > directly > from the website, and then install any needed package with cabal. > 4) I?ve heard of Nix, what is this all about? > 5) Installing manually the binary distributions of ghc and cabal. No > thanks. > > That said, what is the recommended way to manage packages once I have > cabal and ghc? > > 1) Installing everything locally into ~/Library/Haskell, which afaik is > the default > behavior of cabal. That also means having ~/Library/Haskell/bin in the > PATH. > But do I have to also have ~/.cabal/bin in the PATH? Why having two > different > local bin directories? What happens to the packages installed by haskell > platform > system-wide? They are left there, shadowed by the local ones, and never > again > touched nor updated? > > 2) Installing everything globally, changing the cabal configuration to > make it > the default. Afaik bad idea, but then I don?t have obsoleted packages > installed > system-wide. > > 3) Installing nothing, and relying on sandboxes to install exactly what is > needed > for any single package I need. This option is still a bit mysterious to me. > 3a) If I need to install a package I need for development, I do cabal > sandbox init > in my source tree and then if I install something from inside it, cabal > installs it > in the sandbox. Am I correct? > 3a) If I need to install a package I need to _use_, instead, what to do? > > > Sorry for the confusion and thanks for the clarification. > > Bye, > Nicola > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuuzetsu at fuuzetsu.co.uk Sun Oct 19 17:50:02 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Sun, 19 Oct 2014 18:50:02 +0100 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: <5443F9CA.9060401@fuuzetsu.co.uk> On 10/19/2014 02:11 PM, Henk-Jan van Tuyl wrote: > On Sun, 19 Oct 2014 08:31:55 +0200, Vasili I. Galchin > wrote: > >> Hi Fellow Haskellers, >> >> I was just reading at http://www.haskell.org. I am looking for a >> list >> of currently active Haskell projects needing help .. :-) >> >> Vasili > > > wxHaskell[0] could use your support very well, I hope others will join in > as well. wxHaskell can be used for both game and serious software, but > could use more support. > > > What is it? > ----------- I hope you don't mind me hijacking this thread a bit for few questions. > wxHaskell is a portable and native GUI library for Haskell. The goal of > the project is to provide an industrial strength GUI library for Haskell, > but without the burden of developing (and maintaining) one ourselves. > > wxHaskell is therefore built on top of wxWidgets ? a comprehensive C++ > library that is portable across all major GUI platforms; including GTK, > Windows, X11, and MacOS X. Furthermore, it is a mature library (in > development since 1992) that supports a wide range of widgets with the > native look-and-feel. > The wxHaskell project[0] could use more participants. I'm a bit confused: you say it's a native GUI library but then say it's built on top of a C++ library. We might be interested in a wxHaskell frontend for Yi. Can you compare it to gtk2hs a bit? Notably, we get complaints that gtk2hs is hard to install outside of Linux, even though it does run on those platforms. Is the situation better with wxHaskell? Can one embed pango in it? Are there any non-trivial, cross-platform programs out there currently that are using wxHaskell? > > What can be done? > ----------------- > > Some of the activities: > - Adding new features > - Writing sample programs for testing and teaching (for functionality not > used in sample programs so far) > - Simplifying installation (e.g. creating a wxWidgets binary package with > installation program) > - Solving bugs > - Add/improve descriptions of the wxHaskell API in the source code > (include usage samples) > - Write a manual, similar to the wxWidgets manual[1] > - Trying wxHaskell on Android and other new platforms > - Testing > - Creating binary packages > - Updating the wiki pages > > Look at the bug tickets and feature requests[2] for details of some of the > things to do. > > Regards, > Henk-Jan van Tuyl > > [0] https://www.haskell.org/haskellwiki/WxHaskell > [1] http://docs.wxwidgets.org/stable/ > [2] http://sourceforge.net/p/wxhaskell/_list/tickets > > > -- > Folding at home > What if you could share your unused computer power to help find a cure? In > just 5 minutes you can join the world's biggest networked computer and get > us closer sooner. Watch the video. > http://folding.stanford.edu/ > > > http://Van.Tuyl.eu/ > http://members.chello.nl/hjgtuyl/tourdemonad.html > Haskell programming > -- > -- Mateusz K. From corentin.dupont at gmail.com Sun Oct 19 18:03:44 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sun, 19 Oct 2014 20:03:44 +0200 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: Hi Vasili, Nomyx (www.nomyx.org) is a unique game made in Haskell, still under active developement! There is a demo game running (see the web site). Cheers, Corentin On Sun, Oct 19, 2014 at 8:31 AM, Vasili I. Galchin wrote: > Hi Fellow Haskellers, > > I was just reading at http://www.haskell.org. I am looking for a > list of currently active Haskell projects needing help .. :-) > > Vasili > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From corentin.dupont at gmail.com Sun Oct 19 18:04:26 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sun, 19 Oct 2014 20:04:26 +0200 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: Sorry the address is www.nomyx.net On Sun, Oct 19, 2014 at 8:03 PM, Corentin Dupont wrote: > Hi Vasili, > Nomyx (www.nomyx.org) is a unique game made in Haskell, still under > active developement! > There is a demo game running (see the web site). > > Cheers, > Corentin > > On Sun, Oct 19, 2014 at 8:31 AM, Vasili I. Galchin > wrote: > >> Hi Fellow Haskellers, >> >> I was just reading at http://www.haskell.org. I am looking for a >> list of currently active Haskell projects needing help .. :-) >> >> Vasili >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From noteed at gmail.com Sun Oct 19 18:34:44 2014 From: noteed at gmail.com (Vo Minh Thu) Date: Sun, 19 Oct 2014 20:34:44 +0200 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: <5443F9CA.9060401@fuuzetsu.co.uk> References: <5443F9CA.9060401@fuuzetsu.co.uk> Message-ID: 2014-10-19 19:50 GMT+02:00 Mateusz Kowalczyk : > On 10/19/2014 02:11 PM, Henk-Jan van Tuyl wrote: >> On Sun, 19 Oct 2014 08:31:55 +0200, Vasili I. Galchin >> wrote: >> >>> Hi Fellow Haskellers, >>> >>> I was just reading at http://www.haskell.org. I am looking for a >>> list >>> of currently active Haskell projects needing help .. :-) >>> >>> Vasili >> >> >> wxHaskell[0] could use your support very well, I hope others will join in >> as well. wxHaskell can be used for both game and serious software, but >> could use more support. >> >> >> What is it? >> ----------- > > I hope you don't mind me hijacking this thread a bit for few questions. > >> wxHaskell is a portable and native GUI library for Haskell. The goal of >> the project is to provide an industrial strength GUI library for Haskell, >> but without the burden of developing (and maintaining) one ourselves. >> >> wxHaskell is therefore built on top of wxWidgets ? a comprehensive C++ >> library that is portable across all major GUI platforms; including GTK, >> Windows, X11, and MacOS X. Furthermore, it is a mature library (in >> development since 1992) that supports a wide range of widgets with the >> native look-and-feel. >> The wxHaskell project[0] could use more participants. > > I'm a bit confused: you say it's a native GUI library but then say it's > built on top of a C++ library. > [snip] I think native in this context refer to the graphical elements being the ones native to the OS, not native as in pure Haskell implementation. Cheers, Thu From jeffbrown.the at gmail.com Sun Oct 19 18:50:32 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sun, 19 Oct 2014 11:50:32 -0700 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: Thanks, everybody! Those were incredibly informative answers. This list is amazing. Heinrich's suggestion of compiling with "-threaded" was by itself sufficient to get the first rhythm to sound right. The second rhythm, however, still blurs into a string of beeps of the same duration even after I throw all of Heinrich's and Carter's suggestions at it by doing this: ghc --make fast -threaded -fno-omit-yields -with-rtsopts -C0 (although I should admit to not really knowing what I'm doing when I run that) where fast.hs is this: import Control.Concurrent import Text.Printf import Control.Monad import System.IO main = do hSetBuffering stdout NoBuffering mapM_ note (cycle [1,1,2]) beat = round (10^6 / 10) -- measured in microseconds note :: Int -> IO () note n = do threadDelay $ beat * n printf "\BEL\n" I therefore suspect I have to teach myself, as Brandon suggested, a realtime scheduler. This seems like a general, powerful thing: http://hackage.haskell.org/package/atom Hayoo also returns a lot of domain-specific results, e.g. from the Sound and Data.Reactive libraries: http://hackage.haskell.org/package/alsa-0.4/docs/Sound-Alsa-Sequencer.html http://hackage.haskell.org/package/midi-0.2.1.3/docs/Sound-MIDI-Message-System-RealTime.html# http://hackage.haskell.org/package/definitive-reactive-1.0/docs/Data-Reactive.html but I suspect a general tool like Atom would be more useful so I'll start there. Thanks again, Jeff On Sun, Oct 19, 2014 at 12:40 AM, Heinrich Apfelmus < apfelmus at quantentunnel.de> wrote: > Jeffrey Brown wrote: > >> An earlier version of this question is cross-posted at StackOverflow >> > inaccuracy-in-haskell-threaddelay> >> .. >> >> What should I use for precise (and eventually, concurrency-compatible) >> timing in Haskell? I want to make rhythms. I tried the following to >> produce >> a repeating rhythm in which one note is twice as long as the other two. >> (That rhythm is encoded by the list [1,1,2].) >> >> import Control.Concurrent >> import Text.Printf >> import Control.Monad >> >> main = mapM_ note (cycle [1,1,2]) >> >> beat = round (10^6 / 4) -- measured in microseconds >> >> note :: Int -> IO () >> note n = do >> threadDelay $ beat * n >> printf "\BEL\n" >> >> When I run it the long note is three times as long as the others, not >> twice. If I speed it up, by changing the number 4 to a 10, the rhythm is >> destroyed completely: the notes all have the same length. >> >> threadDelay is guaranteed >> > Control-Concurrent.html#v:threadDelay> >> to >> wait at least as long, but potentially longer than, what the caller >> specifies. Another potential problem could be buffering in printf. >> (Eventually I intend to replace the printf statement with OSC output to a >> sound generator.) >> >> Thanks, >> Jeff >> > > I found that that compiling a program with the -threaded option greatly > improves the precision of threadDelay for the purpose of making rhythms. > > Your program is simple enough that this shouldn't make a difference, > though. Note that there may also be issues with stdout buffering. Try > > System.IO.hSetBuffering stdout NoBuffering > > before the main loop. > > Best regards, > Heinrich Apfelmus > > -- > http://apfelmus.nfshost.com > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Sun Oct 19 18:54:26 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 19 Oct 2014 14:54:26 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: On Sun, Oct 19, 2014 at 2:50 PM, Jeffrey Brown wrote: > I therefore suspect I have to teach myself, as Brandon suggested, a > realtime scheduler. Unless you're running on embedded hardware, you're probably looking for something like sched_setscheduler(2) (or perhaps more helpfully, chrt(1)) on Linux. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Sun Oct 19 19:03:26 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sun, 19 Oct 2014 12:03:26 -0700 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: Doh! Right. So probably this then? https://hackage.haskell.org/package/posix-realtime On Sun, Oct 19, 2014 at 11:54 AM, Brandon Allbery wrote: > On Sun, Oct 19, 2014 at 2:50 PM, Jeffrey Brown > wrote: > >> I therefore suspect I have to teach myself, as Brandon suggested, a >> realtime scheduler. > > > Unless you're running on embedded hardware, you're probably looking for > something like sched_setscheduler(2) (or perhaps more helpfully, chrt(1)) > on Linux. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Sun Oct 19 19:07:02 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 19 Oct 2014 15:07:02 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: On Sun, Oct 19, 2014 at 3:03 PM, Jeffrey Brown wrote: > Doh! Right. So probably this then? > https://hackage.haskell.org/package/posix-realtime > Possibly, although I think you'll find that specifying a realtime scheduler class requires extra permissions, so `sudo chrt ...` will be more helpful unless you can manipulate your account's or the program's Linux kernel capabilities. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Sun Oct 19 19:44:58 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sun, 19 Oct 2014 12:44:58 -0700 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: You mean I should call chrt from the command line after starting the process, to modify its priority? This documentation for the posix-realtime package says that it has a sched_setscheduler function. That supposedly exists on my OS (OS X 10.9). The chrt command, on the other hand, it does not recognize. On Sun, Oct 19, 2014 at 12:07 PM, Brandon Allbery wrote: > On Sun, Oct 19, 2014 at 3:03 PM, Jeffrey Brown > wrote: > >> Doh! Right. So probably this then? >> https://hackage.haskell.org/package/posix-realtime >> > > Possibly, although I think you'll find that specifying a realtime > scheduler class requires extra permissions, so `sudo chrt ...` will be more > helpful unless you can manipulate your account's or the program's Linux > kernel capabilities. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guillaumh at gmail.com Sun Oct 19 20:29:36 2014 From: guillaumh at gmail.com (Guillaume Hoffmann) Date: Sun, 19 Oct 2014 17:29:36 -0300 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: Hi Vasili, Darcs is active and needs help: http://darcs.net/HowToHelp Guillaume From allbery.b at gmail.com Sun Oct 19 21:11:42 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 19 Oct 2014 17:11:42 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: On Sun, Oct 19, 2014 at 3:44 PM, Jeffrey Brown wrote: > You mean I should call chrt from the command line after starting the > process, to modify its priority? > Normally you'd use it to run the program. But, as I said at least twice, it's Linux specific. > This documentation > for > the posix-realtime package > says that it has a > sched_setscheduler function. That supposedly exists on my OS (OS X 10.9). > The chrt command, on the other hand, > Does it warn you that you need privileges (probably root) to switch to a higher scheduler level? Normally realtime and other high priority schedulers require elevated privileges, whereas lower priority schedulers such as SCHED_IDLE don't. I should note that I see no manpage for sched_setscheduler on 10.9.5, nor do I find it in any of the dylibs in /usr/lib. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sun Oct 19 21:22:03 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 19 Oct 2014 17:22:03 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: I think threadDelay is the wrong operation here. Its fundamentally a primitive for **spreading out** compute, rather than *scheduling compute*. one (crazy) idea might be the following, say you wanna do an event every X milli seconds (with some error tolerance about the precise timing), do a threadDelay for 1/2-2/3rds X, then poll the time constantly :) OTOH, as other folks are suggesting, theres probably fundamentally better primitives already available. On Sun, Oct 19, 2014 at 5:11 PM, Brandon Allbery wrote: > On Sun, Oct 19, 2014 at 3:44 PM, Jeffrey Brown > wrote: > >> You mean I should call chrt from the command line after starting the >> process, to modify its priority? >> > > Normally you'd use it to run the program. But, as I said at least twice, > it's Linux specific. > > >> This documentation >> for >> the posix-realtime package >> says that it has a >> sched_setscheduler function. That supposedly exists on my OS (OS X 10.9). >> The chrt command, on the other hand, >> > > Does it warn you that you need privileges (probably root) to switch to a > higher scheduler level? Normally realtime and other high priority > schedulers require elevated privileges, whereas lower priority schedulers > such as SCHED_IDLE don't. > > I should note that I see no manpage for sched_setscheduler on 10.9.5, nor > do I find it in any of the dylibs in /usr/lib. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hjgtuyl at chello.nl Sun Oct 19 22:43:24 2014 From: hjgtuyl at chello.nl (Henk-Jan van Tuyl) Date: Mon, 20 Oct 2014 00:43:24 +0200 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: <5443F9CA.9060401@fuuzetsu.co.uk> References: <5443F9CA.9060401@fuuzetsu.co.uk> Message-ID: On Sun, 19 Oct 2014 19:50:02 +0200, Mateusz Kowalczyk wrote: > I'm a bit confused: you say it's a native GUI library but then say it's > built on top of a C++ library. The GUI is native, not the library; wxHaskell has a native look and feel on each platform, see: http://wxhaskell.sourceforge.net/samples.html > We might be interested in a wxHaskell frontend for Yi. Can you compare > it to gtk2hs a bit? Notably, we get complaints that gtk2hs is hard to > install outside of Linux, even though it does run on those platforms. Is > the situation better with wxHaskell? Can one embed pango in it? An extensive comparison is given at: http://stackoverflow.com/questions/553317/what-are-the-relative-merits-of-wxhaskell-and-gtk2hs#601996 wxHaskell is not easy to install in a Windows environment; that is one of the things that needs work. I don't know if Pango can be embedded. > Are there any non-trivial, cross-platform programs out there currently > that are using wxHaskell? See: - Reverse dependencies: http://packdeps.haskellers.com/reverse/wx - Application screenshots: http://wxhaskell.sourceforge.net/applications.html - Dazzle: http://www.cs.uu.nl/wiki/Dazzle/WebHome Regards, Henk-Jan van Tuyl -- Folding at home What if you could share your unused computer power to help find a cure? In just 5 minutes you can join the world's biggest networked computer and get us closer sooner. Watch the video. http://folding.stanford.edu/ http://Van.Tuyl.eu/ http://members.chello.nl/hjgtuyl/tourdemonad.html Haskell programming -- From jwlato at gmail.com Mon Oct 20 00:29:48 2014 From: jwlato at gmail.com (John Lato) Date: Mon, 20 Oct 2014 08:29:48 +0800 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: I was going to suggest something like this. The usual approach in audio software is to have a main processing loop that never yields (or calls threadDelay, or blocking operations). This loop runs at a fixed rate, and is responsible for handling the scheduling, mixing, writing to output, etc. You can have other threads that work on other processes, but if they're time-sensitive again you wouldn't want them to be de-scheduled, unless you can reschedule them in advance then wait. Currently it's hard to do this very reliably in Haskell because the RTS has no support for thread priorities or anything like that. Even if you use posix-realtime, you'd still need to be aware that the Haskell RTS can unschedule threads, or move calculations around. And a stop-the-world GC could theoretically happen at any time. That said, I've had decent success doing real-time work so long as the CPUs don't get completely saturated. An alternate approach is to hand off the real audio processing to something like csound or OSC. At least with csound I know it's possible to pipe raw audio data via the API, and I imagine OSC has a facility for this as well. John L On Mon, Oct 20, 2014 at 5:22 AM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > I think threadDelay is the wrong operation here. Its fundamentally a > primitive for **spreading out** compute, rather than *scheduling compute*. > one (crazy) idea might be the following, say you wanna do an event every X > milli seconds (with some error tolerance about the precise timing), > do a threadDelay for 1/2-2/3rds X, then poll the time constantly :) > > OTOH, as other folks are suggesting, theres probably fundamentally better > primitives already available. > > On Sun, Oct 19, 2014 at 5:11 PM, Brandon Allbery > wrote: > >> On Sun, Oct 19, 2014 at 3:44 PM, Jeffrey Brown >> wrote: >> >>> You mean I should call chrt from the command line after starting the >>> process, to modify its priority? >>> >> >> Normally you'd use it to run the program. But, as I said at least twice, >> it's Linux specific. >> >> >>> This documentation >>> for >>> the posix-realtime package >>> says that it has a >>> sched_setscheduler function. That supposedly exists on my OS (OS X 10.9). >>> The chrt command, on the other hand, >>> >> >> Does it warn you that you need privileges (probably root) to switch to a >> higher scheduler level? Normally realtime and other high priority >> schedulers require elevated privileges, whereas lower priority schedulers >> such as SCHED_IDLE don't. >> >> I should note that I see no manpage for sched_setscheduler on 10.9.5, nor >> do I find it in any of the dylibs in /usr/lib. >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Mon Oct 20 01:07:23 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sun, 19 Oct 2014 18:07:23 -0700 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: Again thank you to everybody! Brandon, I see no warnings in the documentation regarding privilege requirement for raising a scheduler's priority -- the strings "priv" and "user" are absent, and "su" only appears twice. Also I did not understand until today that while Mac is a variety of Unix, it is not a variety of Linux. Carter and John, I will try the polling method you suggest. A polling cycle with a period of 20 ms would be fast enough for me. I don't need Haskell to handle audio math, just to send control signals (to Max/MSP). As soon as I figure out how to get UDP from Haskell to Max, I'll run a test. Hopefully the problem I'm seeing derives from print, not threadDelay. (threadDelay accepts its time argument in millionths of a second! That would seem to suggest it was designed to handle at least the speed I'm hoping for ...) On Sun, Oct 19, 2014 at 2:11 PM, Brandon Allbery wrote: > On Sun, Oct 19, 2014 at 3:44 PM, Jeffrey Brown > wrote: > >> You mean I should call chrt from the command line after starting the >> process, to modify its priority? >> > > Normally you'd use it to run the program. But, as I said at least twice, > it's Linux specific. > > >> This documentation >> for >> the posix-realtime package >> says that it has a >> sched_setscheduler function. That supposedly exists on my OS (OS X 10.9). >> The chrt command, on the other hand, >> > > Does it warn you that you need privileges (probably root) to switch to a > higher scheduler level? Normally realtime and other high priority > schedulers require elevated privileges, whereas lower priority schedulers > such as SCHED_IDLE don't. > > I should note that I see no manpage for sched_setscheduler on 10.9.5, nor > do I find it in any of the dylibs in /usr/lib. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rohan.drape at gmail.com Mon Oct 20 01:29:30 2014 From: rohan.drape at gmail.com (Rohan Drape) Date: Mon, 20 Oct 2014 01:29:30 +0000 (UTC) Subject: [Haskell-cafe] Precise timing References: Message-ID: > (Eventually I intend to replace the printf statement with OSC output to a sound generator.) OSC packets can have NTP timestamps. So one approach is to forward timestamp outgoing packets by a small constant amount. Enough so that the synthesiser still receives the most delayed packets before they're due. Then the synthesiser schedules the messages accurately. This can solve the concurrency issue as well. If you need highly accurate scheduling in the language perhaps consider SuperCollider? http://audiosynth.com/ Best, Rohan From ok at cs.otago.ac.nz Mon Oct 20 06:14:49 2014 From: ok at cs.otago.ac.nz (ok at cs.otago.ac.nz) Date: Mon, 20 Oct 2014 19:14:49 +1300 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: <85c87a083ea1cb5101f39125f61e3db6.squirrel@chasm.otago.ac.nz> Jeffrey Brown wrote > Also I did not understand > until today that while Mac is a variety of Unix, it is not a variety > of Linux. There's a bunch of POSIX (well, SuSv4) features to do with threads or scheduling that are missing in OS X. In Apple's defence, they are optional. Examples include sched_{get,set}{param,scheduler}, barriers, and spin locks. I'm sure I've forgotten some. Oh yeah, robust mutexes. Several locking functions with timeouts too. These are of course not the only differences. There are apparently quite a few things that can be done nicely in OS X using Mach facilities, but I have not yet succeeded in finding useful documentation for Mach, which has probably kept me out of more trouble than I realise. From mwm at mired.org Mon Oct 20 07:32:07 2014 From: mwm at mired.org (Mike Meyer) Date: Mon, 20 Oct 2014 02:32:07 -0500 Subject: [Haskell-cafe] Precise timing In-Reply-To: <85c87a083ea1cb5101f39125f61e3db6.squirrel@chasm.otago.ac.nz> References: <85c87a083ea1cb5101f39125f61e3db6.squirrel@chasm.otago.ac.nz> Message-ID: On Mon, Oct 20, 2014 at 1:14 AM, wrote: > There are apparently quite a few things that can be done nicely > in OS X using Mach facilities, but I have not yet succeeded in > finding useful documentation for Mach, which has probably kept me > out of more trouble than I realise. > Apple pushes grand central dispatch (aka libdispatch) for concurrency. Not clear if it'll help in this case, though. It's interesting technology, and at least the userland parts are open source, and have been ported to FreeBSD as the libdispatch port. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vlatko.basic at gmail.com Mon Oct 20 09:02:17 2014 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Mon, 20 Oct 2014 11:02:17 +0200 Subject: [Haskell-cafe] Limit elements of a list to a certain value Message-ID: <5444CF99.9060802@gmail.com> Hello Cafe, I have these datatypes data Event = E1 {...} | E2 {...} | E3 {...} data Parsed = PEvent Event | PLine Text | PHeader Text I'd like to split the list of Parsed values into separate lists with a guaranty that each of those lists contains only the elements of the same type, as in [PEvent E1] [PEvent E2] [PLine Text] ... How can that be achieved on type level (without creating newtypes for each case)? I tried with type families, but failed. Also, an explanation of why the Event above (or "data Q = Q1 | Q2 String") is not promotable to kind level would be welcome. best regards, vlatko From nicola.gigante at gmail.com Mon Oct 20 09:18:02 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Mon, 20 Oct 2014 11:18:02 +0200 Subject: [Haskell-cafe] Recommended way to install, use and maintain haskell tools on OS X In-Reply-To: References: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> Message-ID: > Il giorno 19/ott/2014, alle ore 18:52, Carter Schonwald ha scritto: > > ignore all the stuff about haskell platform. > > use this http://ghcformacosx.github.io/ > > and the Library / ~/Library stuff is wholely an artifact of haskell platform. use the vanilla cabal config setup that uses ~/.cabal and entails putting ~/.cabal/bin in your PATH > > use cabal sandbox for application dev that you plan to deploy elsewhere / share (because you'll easily wind up having multiple projects going on at once) > and use normal cabal install (into ~/.cabal) otherwise. > Thanks for the hint! Do you know if that package already works well on Yosemite? Bye, Nicola -------------- next part -------------- An HTML attachment was scrubbed... URL: From hesselink at gmail.com Mon Oct 20 09:55:27 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Mon, 20 Oct 2014 11:55:27 +0200 Subject: [Haskell-cafe] Limit elements of a list to a certain value In-Reply-To: <5444CF99.9060802@gmail.com> References: <5444CF99.9060802@gmail.com> Message-ID: You could do it by making Parsed into a GADT: data Parsed ev where PEvent :: Event -> Parsed E1 ... As for the question about promoting 'Q', I think it's because it contains a String, and the Symbol kind doesn't map one-to-one to String, since it's opaque. The same goes for types containing Integers, I guess. They also cannot be promoted, as Integer doesn't map cleanly to Nat. I'm just guessing here, though. Erik On Mon, Oct 20, 2014 at 11:02 AM, Vlatko Basic wrote: > Hello Cafe, > > I have these datatypes > > data Event = E1 {...} | E2 {...} | E3 {...} > data Parsed = PEvent Event | PLine Text | PHeader Text > > I'd like to split the list of Parsed values into separate lists with a > guaranty > that each of those lists contains only the elements of the same type, as in > [PEvent E1] [PEvent E2] [PLine Text] ... > > > How can that be achieved on type level (without creating newtypes for each > case)? > I tried with type families, but failed. > > Also, an explanation of why the Event above (or "data Q = Q1 | Q2 String") > is not promotable to kind level would be welcome. > > > best regards, > > vlatko > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From omari at smileystation.com Mon Oct 20 11:24:20 2014 From: omari at smileystation.com (Omari Norman) Date: Mon, 20 Oct 2014 07:24:20 -0400 Subject: [Haskell-cafe] Recommended way to install, use and maintain haskell tools on OS X In-Reply-To: References: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> Message-ID: On Sun, Oct 19, 2014 at 12:52 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > ignore all the stuff about haskell platform. > > use this http://ghcformacosx.github.io/ > > How is this better than installing GHC from http://www.haskell.org/ghc/download_ghc_7_8_3 and then getting cabal install from http://www.haskell.org/cabal/download.html The ghcformacosx installs some man pages apparently, and it's just one step; any other advantages? -------------- next part -------------- An HTML attachment was scrubbed... URL: From nicola.gigante at gmail.com Mon Oct 20 12:46:18 2014 From: nicola.gigante at gmail.com (Nicola Gigante) Date: Mon, 20 Oct 2014 14:46:18 +0200 Subject: [Haskell-cafe] Recommended way to install, use and maintain haskell tools on OS X In-Reply-To: References: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> Message-ID: <201CD109-DC54-4067-AA65-BB1BC5F732AB@gmail.com> > Il giorno 20/ott/2014, alle ore 13:24, Omari Norman ha scritto: > > On Sun, Oct 19, 2014 at 12:52 PM, Carter Schonwald > wrote: > ignore all the stuff about haskell platform. > > use this http://ghcformacosx.github.io/ > > > How is this better than installing GHC from > > http://www.haskell.org/ghc/download_ghc_7_8_3 > > and then getting cabal install from > > http://www.haskell.org/cabal/download.html > > The ghcformacosx installs some man pages apparently, and it's just one step; any other advantages? Also what?s the difference from the homebrew formulas for ghc and cabal-install? Bye, Nicola -------------- next part -------------- An HTML attachment was scrubbed... URL: From amindfv at gmail.com Mon Oct 20 13:17:48 2014 From: amindfv at gmail.com (amindfv at gmail.com) Date: Mon, 20 Oct 2014 09:17:48 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: <22D7E788-4CB3-4A23-A374-7C741EAF4616@gmail.com> El Oct 19, 2014, a las 21:29, Rohan Drape escribi?: >> (Eventually I intend to replace the printf statement with OSC output to a sound generator.) > > OSC packets can have NTP timestamps. > > [...] > > If you need highly accurate scheduling in the language perhaps consider SuperCollider? > > http://audiosynth.com/ > http://supercollider.github.io/ is a more recent site - that link has a 2006 conference as the only "Upcoming Event" Tom -------------- next part -------------- An HTML attachment was scrubbed... URL: From rikvdkleij at gmail.com Mon Oct 20 14:37:43 2014 From: rikvdkleij at gmail.com (Rik van der Kleij) Date: Mon, 20 Oct 2014 07:37:43 -0700 (PDT) Subject: [Haskell-cafe] ANN: Haskell plugin for IntelliJ Message-ID: <5ce38607-75e4-488d-99c5-14f2489dbd04@googlegroups.com> Hi everyone, I'm glad to announce initial version of Haskell plugin for IntelliJ. It's available in the plugin repository. This plugin is written mainly in Scala and is not mentioned to support GHC/Cabal directly. This plugin support sandbox projects and expects that the Cabal init/install/build is done on command-line. Features - Syntax highlighting (which can be customised); - Error/warning highlighting; - Find Usages of identifiers; - Resolving references of identifiers (also to library code if library source code is added to project and resolves inside import declaration); - Code completion by resolving references; - Renaming variables (which first shows preview so refactoring scope can be adjusted); - View type info from (selected) expression; - View expression info; - View quick documentation; - View quick definition; - Structure view; - Navigate to declaration (called `Class` in IntelliJ menu); - Navigate to identifier (called `Symbol` in IntelliJ menu); - Code completion by looking to import declarations; - Simple form of code formatting; A lot of features are with the help of ghc-mod and ghc-modi. Documentation is provided by haskell-docs. See for more information and getting started: https://github.com/rikvdkleij/intellij-haskell Any feedback is welcome! Regards, Rik -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob at redivi.com Mon Oct 20 16:27:47 2014 From: bob at redivi.com (Bob Ippolito) Date: Mon, 20 Oct 2014 09:27:47 -0700 Subject: [Haskell-cafe] Recommended way to install, use and maintain haskell tools on OS X In-Reply-To: References: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> Message-ID: On Monday, October 20, 2014, Omari Norman wrote: > On Sun, Oct 19, 2014 at 12:52 PM, Carter Schonwald < > carter.schonwald at gmail.com > > wrote: > >> ignore all the stuff about haskell platform. >> >> use this http://ghcformacosx.github.io/ >> >> > How is this better than installing GHC from > > http://www.haskell.org/ghc/download_ghc_7_8_3 > > and then getting cabal install from > > http://www.haskell.org/cabal/download.html > > The ghcformacosx installs some man pages apparently, and it's just one > step; any other advantages? > That's precisely what it is, just quicker and simpler to install as it's one download, there's no build step, and it can help you change your PATH. No technical advantages. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Mon Oct 20 17:10:54 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 20 Oct 2014 13:10:54 -0400 Subject: [Haskell-cafe] Recommended way to install, use and maintain haskell tools on OS X In-Reply-To: References: <55B58891-3F54-47E4-8D78-DB49BFFE24AC@gmail.com> Message-ID: further more, no ghc dev is currently actively involved in helping maintain the brew ghc/cabal-install/whatever formulas, so generally they are more likely to have problems (though they look like broken when i checked recently) On Mon, Oct 20, 2014 at 12:27 PM, Bob Ippolito wrote: > > > On Monday, October 20, 2014, Omari Norman wrote: > >> On Sun, Oct 19, 2014 at 12:52 PM, Carter Schonwald < >> carter.schonwald at gmail.com> wrote: >> >>> ignore all the stuff about haskell platform. >>> >>> use this http://ghcformacosx.github.io/ >>> >>> >> How is this better than installing GHC from >> >> http://www.haskell.org/ghc/download_ghc_7_8_3 >> >> and then getting cabal install from >> >> http://www.haskell.org/cabal/download.html >> >> The ghcformacosx installs some man pages apparently, and it's just one >> step; any other advantages? >> > > That's precisely what it is, just quicker and simpler to install as it's > one download, there's no build step, and it can help you change your PATH. > No technical advantages. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Mon Oct 20 23:19:21 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Mon, 20 Oct 2014 16:19:21 -0700 Subject: [Haskell-cafe] How to send a string somewhere via UDP Message-ID: Chapter 27 of Real World Haskell explains a way to send a message over UDP. From a folder containing the two files "syslogclient.hs" and "SyslogTypes.hs" (which are attached to this email, and also available here ), supposedly one can run these three commands from GHCI, to send the message "This is my message" to localhost, port number 514: :load syslogclient.hs h <- openlog "localhost" "514" "testprog" syslog h USER INFO "This is my message" I have a Max/MSP patch that accepts UDP on localhost port number 9000. I substitute 514 -> 9000 and run that, and I get nothing. I know the Max/MSP "udpreceive" object is working, because from Python, using the aiosc module, I can run aiosc.send(('127.0.0.1', 9000), "This is a message from Python") ) and "This is a message from Python" reaches Max. There is a UDP library for Haskell, which I presume could serve as an alternative to the RWH code, but I don't understand it. I run OS X 10.9 on an early 2011 MBP. Many thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: syslogclient.hs Type: application/octet-stream Size: 2039 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: SyslogTypes.hs Type: application/octet-stream Size: 3019 bytes Desc: not available URL: From ky3 at atamo.com Tue Oct 21 04:04:04 2014 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Tue, 21 Oct 2014 11:04:04 +0700 Subject: [Haskell-cafe] How to send a string somewhere via UDP In-Reply-To: References: Message-ID: On 10/21/14, Jeffrey Brown wrote: > There is a UDP library > > for Haskell, which I presume could serve as an alternative to the RWH code, but > I don't understand it. Here's a fully working UDP echo server: http://www.haskell.org/pipermail/haskell-cafe/2007-January/021280.html No special package needed, merely import the humble, dependable Network.Socket. -- Kim-Ee From apfelmus at quantentunnel.de Tue Oct 21 08:05:25 2014 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Tue, 21 Oct 2014 10:05:25 +0200 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: Jeffrey Brown wrote: > Thanks, everybody! Those were incredibly informative answers. This list is > amazing. > > Heinrich's suggestion of compiling with "-threaded" was by itself > sufficient to get the first rhythm to sound right. > > The second rhythm, however, still blurs into a string of beeps of the same > duration even after I throw all of Heinrich's and Carter's suggestions at > it by doing this: > > ghc --make fast -threaded -fno-omit-yields -with-rtsopts -C0 > > (although I should admit to not really knowing what I'm doing when I run > that) where fast.hs is this: > > import Control.Concurrent > import Text.Printf > import Control.Monad > import System.IO > main = do > hSetBuffering stdout NoBuffering > mapM_ note (cycle [1,1,2]) > beat = round (10^6 / 10) -- measured in microseconds > note :: Int -> IO () > note n = do > threadDelay $ beat * n > printf "\BEL\n" > > I therefore suspect I have to teach myself, as Brandon suggested, a > realtime scheduler. This seems like a general, powerful thing: > http://hackage.haskell.org/package/atom I would be hesitant to attribute your problem to the scheduler. An alternative explanation could be the following: The sound file played by the terminal when it encounters the \BEL character is longer than 100ms. A new sound will be played only when the previous sound has finished playing, so the terminal will queue \BEL characters until the previous ones have finished. But since they arrive too fast, there will never have any pause in between and you hear a constant rhythm. I can't test this theory because the \BEL character doesn't work in my Terminal application, but I have just listened to a kick drum sample on autorepeat and got a tempo of less than 200bpm. This means that the file is significantly longer than 100ms (or that starting the file from the beginning again takes a long time, but I did not notice any extended silence). An length of 100ms would correspond to 600bpm. To test this theory, you can try to sweep through lower tempi like 200bpm-500bpm and look for the threshold when the actual tempo plateaus even though you are increasing the scheduling tempo. This should be correspond to the length of the audio file. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From vlatko.basic at gmail.com Tue Oct 21 09:18:00 2014 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Tue, 21 Oct 2014 11:18:00 +0200 Subject: [Haskell-cafe] Limit elements of a list to a certain value In-Reply-To: References: <5444CF99.9060802@gmail.com> Message-ID: <544624C8.2090805@gmail.com> Hi Erik, Thanks for the tip. Interestingly, on Reddit [1] just appeared almost the same problem with some suggestions. vlatko [1] - http://www.reddit.com/r/haskell/comments/2jsz4t/function_on_a_single_member_of_a_sum_type/ -------- Original Message -------- Subject: Re: [Haskell-cafe] Limit elements of a list to a certain value From: Erik Hesselink To: Vlatko Ba?i? Cc: haskell Date: 20.10.2014 11:55 > You could do it by making Parsed into a GADT: > > data Parsed ev where > PEvent :: Event -> Parsed E1 > ... > > As for the question about promoting 'Q', I think it's because it > contains a String, and the Symbol kind doesn't map one-to-one to > String, since it's opaque. The same goes for types containing > Integers, I guess. They also cannot be promoted, as Integer doesn't > map cleanly to Nat. I'm just guessing here, though. > > Erik > > On Mon, Oct 20, 2014 at 11:02 AM, Vlatko Basic wrote: >> Hello Cafe, >> >> I have these datatypes >> >> data Event = E1 {...} | E2 {...} | E3 {...} >> data Parsed = PEvent Event | PLine Text | PHeader Text >> >> I'd like to split the list of Parsed values into separate lists with a >> guaranty >> that each of those lists contains only the elements of the same type, as in >> [PEvent E1] [PEvent E2] [PLine Text] ... >> >> >> How can that be achieved on type level (without creating newtypes for each >> case)? >> I tried with type families, but failed. >> >> Also, an explanation of why the Event above (or "data Q = Q1 | Q2 String") >> is not promotable to kind level would be welcome. >> >> >> best regards, >> >> vlatko >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe From allbery.b at gmail.com Tue Oct 21 09:24:46 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 21 Oct 2014 05:24:46 -0400 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: On Tue, Oct 21, 2014 at 4:05 AM, Heinrich Apfelmus < apfelmus at quantentunnel.de> wrote: > I would be hesitant to attribute your problem to the scheduler. An > alternative explanation could be the following: The sound file played by > the terminal when it encounters the \BEL character is longer than 100ms. A > new sound will be played only when the previous sound has finished playing, On most systems I've used, this isn't true; they're either suppressed or they overlap, depending on system. (I've had to work around this.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From madjestic13 at gmail.com Tue Oct 21 10:24:28 2014 From: madjestic13 at gmail.com (Vlad Lopatin) Date: Tue, 21 Oct 2014 12:24:28 +0200 Subject: [Haskell-cafe] a textured quad/triangle Message-ID: Hello, I am looking for a working example of texture binding, using VBOs and OpenGL4+ standard. A textured quad/triangle would be great. Does anybody have one? Regards, Vlad -------------- next part -------------- An HTML attachment was scrubbed... URL: From ollie at ocharles.org.uk Tue Oct 21 11:12:47 2014 From: ollie at ocharles.org.uk (Oliver Charles) Date: Tue, 21 Oct 2014 12:12:47 +0100 Subject: [Haskell-cafe] a textured quad/triangle In-Reply-To: References: Message-ID: During 24 Days of Hackage last year, I wrote some basic code to get a spinning triangle on screen, using VBOs and shaders. You can find the code for this at https://github.com/ocharles/blog/blob/master/code/2013-12-02-linear-example.hs . To do texturing, it's not much more complicated. My toy "hadoom" project (a Doom-like engine in Haskell) uses texturing - but obviously there's more code to wade through there. I think the relevant stuff will be * Loading: https://github.com/ocharles/hadoom/blob/420597915f115d608192cfb32e6087f7e9044732/hadoom/Material.hs#L21 * Binding: https://github.com/ocharles/hadoom/blob/420597915f115d608192cfb32e6087f7e9044732/hadoom/Material.hs#L84 * Using in a shader: https://github.com/ocharles/hadoom/blob/420597915f115d608192cfb32e6087f7e9044732/shaders/fragment/solid-white.glsl#L48 You'll have to do some grep'ing to see how it all fits together. You'll also need to add UV coordinates to the triangle. Hope this provides enough information to help you get started. If you're comfortable on IRC, you might want to swing by #haskell-game on Freenode, where we're trying to build a Haskell game/graphics dev community. - ocharles On Tue, Oct 21, 2014 at 11:24 AM, Vlad Lopatin wrote: > Hello, > > I am looking for a working example of texture binding, using VBOs and > OpenGL4+ standard. A textured quad/triangle would be great. Does anybody > have one? > > > Regards, > Vlad > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Tue Oct 21 20:09:51 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Tue, 21 Oct 2014 13:09:51 -0700 Subject: [Haskell-cafe] How to send a string somewhere via UDP In-Reply-To: References: Message-ID: I have been going back and for between the UDP server code Kim pointed me toward and Hayoo for an hour. I can load it into GHCI, but I understand neither how it works nor how to use it. If I knew how to use it I could probably figure out a lot of how it works on my own. If I wanted to, say, send the message "test" to localhost port 9000, how would I do that? On Mon, Oct 20, 2014 at 9:04 PM, Kim-Ee Yeoh wrote: > On 10/21/14, Jeffrey Brown wrote: > > There is a UDP library > > < > http://hackage.haskell.org/package/network-conduit-0.6.1.1/docs/Data-Conduit-Network-UDP.html > > > > for Haskell, which I presume could serve as an alternative to the RWH > code, but > > I don't understand it. > > Here's a fully working UDP echo server: > > http://www.haskell.org/pipermail/haskell-cafe/2007-January/021280.html > > No special package needed, merely import the humble, dependable > Network.Socket. > > > -- Kim-Ee > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rohan.drape at gmail.com Tue Oct 21 22:56:45 2014 From: rohan.drape at gmail.com (Rohan Drape) Date: Tue, 21 Oct 2014 22:56:45 +0000 (UTC) Subject: [Haskell-cafe] How to send a string somewhere via UDP References: Message-ID: > aiosc.send(('127.0.0.1', 9000), "This is a message from Python") ) isn't this sending an OSC packet? not a plain UDP packet? perhaps see http://hackage.haskell.org/package/hosc import Sound.OSC withMax = withTransport (openUDP "127.0.0.1" 9000) main = withMax (sendMessage (Message "/this-is-a-message-from-haskell" [])) From simon at joyful.com Wed Oct 22 01:20:21 2014 From: simon at joyful.com (Simon Michael) Date: Tue, 21 Oct 2014 18:20:21 -0700 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: On 10/18/14 11:31 PM, Vasili I. Galchin wrote: > Hi Fellow Haskellers, > > I was just reading at http://www.haskell.org. I am looking for a > list of currently active Haskell projects needing help .. :-) Hi Vasili, no-one is maintaining such a list, but it's a FAQ and every time someone asks a bunch of us reply. Would you be interested in keeping that list ? :) And to the previous answers, add hledger ! (http://hledger.org) From jeffbrown.the at gmail.com Wed Oct 22 03:07:22 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Tue, 21 Oct 2014 20:07:22 -0700 Subject: [Haskell-cafe] How to send a string somewhere via UDP In-Reply-To: References: Message-ID: Rohan, that worked! And the timing is, to the extent my perception can tell, perfect! (I'm using threadDelay to create a rhythm, as described here .) This means I can use Haskell instead of Python or SuperCollider. I am beside myself with excitement. On Tue, Oct 21, 2014 at 3:56 PM, Rohan Drape wrote: > > aiosc.send(('127.0.0.1', 9000), "This is a message from Python") ) > > isn't this sending an OSC packet? not a plain UDP packet? > > perhaps see http://hackage.haskell.org/package/hosc > > import Sound.OSC > withMax = withTransport (openUDP "127.0.0.1" 9000) > main = withMax (sendMessage (Message "/this-is-a-message-from-haskell" [])) > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Wed Oct 22 03:13:46 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Tue, 21 Oct 2014 20:13:46 -0700 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: On a separate thread , Rohan Drape showed me how to send OSC. The following test, which simplifies the old one and replaces printf with OSC, demonstrates timing as perfect as my ears are able to distinguish. import Control.Concurrent import Control.Monad import System.IO import Sound.OSC main = do hSetBuffering stdout NoBuffering mapM_ note (cycle [1,1,2]) withMax = withTransport (openUDP "127.0.0.1" 9000) beat = 60000 -- 60 ms, measured in ?s note :: Int -> IO () note n = do withMax (sendMessage (Message "sin0 frq 100" [])) -- set sine wave 0 to frequency 100 withMax (sendMessage (Message "sin0 amp 1" [])) -- set sine wave 0 to amplitude 1 threadDelay $ beat * n withMax (sendMessage (Message "sin0 amp 0" [])) -- set sine wave 0 to amplitude 0 threadDelay $ beat * n This means I can use Haskell instead of Python or SuperCollider. I am beside myself with excitement. Thanks again, everyone! On Tue, Oct 21, 2014 at 2:24 AM, Brandon Allbery wrote: > On Tue, Oct 21, 2014 at 4:05 AM, Heinrich Apfelmus < > apfelmus at quantentunnel.de> wrote: > >> I would be hesitant to attribute your problem to the scheduler. An >> alternative explanation could be the following: The sound file played by >> the terminal when it encounters the \BEL character is longer than 100ms. A >> new sound will be played only when the previous sound has finished playing, > > > On most systems I've used, this isn't true; they're either suppressed or > they overlap, depending on system. (I've had to work around this.) > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeffbrown.the at gmail.com Wed Oct 22 03:14:28 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Tue, 21 Oct 2014 20:14:28 -0700 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: On a separate thread , Rohan Drape showed me how to send OSC. The following test, which simplifies the old one and replaces printf with OSC, demonstrates timing as perfect as my ears are able to distinguish. import Control.Concurrent import Control.Monad import System.IO import Sound.OSC main = do hSetBuffering stdout NoBuffering mapM_ note (cycle [1,1,2]) withMax = withTransport (openUDP "127.0.0.1" 9000) beat = 60000 -- 60 ms, measured in ?s note :: Int -> IO () note n = do withMax (sendMessage (Message "sin0 frq 100" [])) -- set sine wave 0 to frequency 100 withMax (sendMessage (Message "sin0 amp 1" [])) -- set sine wave 0 to amplitude 1 threadDelay $ beat * n withMax (sendMessage (Message "sin0 amp 0" [])) -- set sine wave 0 to amplitude 0 threadDelay $ beat * n This means I can use Haskell instead of Python or SuperCollider. I am beside myself with excitement. Thanks again, everyone! On Tue, Oct 21, 2014 at 2:24 AM, Brandon Allbery wrote: > On Tue, Oct 21, 2014 at 4:05 AM, Heinrich Apfelmus < > apfelmus at quantentunnel.de> wrote: > >> I would be hesitant to attribute your problem to the scheduler. An >> alternative explanation could be the following: The sound file played by >> the terminal when it encounters the \BEL character is longer than 100ms. A >> new sound will be played only when the previous sound has finished playing, > > > On most systems I've used, this isn't true; they're either suppressed or > they overlap, depending on system. (I've had to work around this.) > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rohan.drape at gmail.com Wed Oct 22 03:32:30 2014 From: rohan.drape at gmail.com (Rohan Drape) Date: Wed, 22 Oct 2014 03:32:30 +0000 (UTC) Subject: [Haskell-cafe] How to send a string somewhere via UDP References: Message-ID: > This means I can use Haskell instead of Python or SuperCollider. haskell is excellent for writing music in, supercollider is too. alex hosts a "haskell-art" list at http://lurk.org/ that might be helpful, there's also the tidal list there... best, rohan From alexander at plaimi.net Wed Oct 22 06:46:25 2014 From: alexander at plaimi.net (Alexander Berntsen) Date: Wed, 22 Oct 2014 08:46:25 +0200 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: <544752C1.40506@plaimi.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 22/10/14 03:20, Simon Michael wrote: > no-one is maintaining such a list, but it's a FAQ and every time > someone asks a bunch of us reply. Would you be interested in > keeping that list ? :) Maybe something analogous to would be nice. The Wiki seems like the right place for such a list. - -- Alexander alexander at plaimi.net https://secure.plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlRHUsEACgkQRtClrXBQc7VLoQEAlA0ka8jDcAGi27dB1yIAOHg6 Int/JsQBuqEOTLOM5I8BAKG6Dgt1IEv7PF+iPgAP9vHLEREZvPAx8v8hVdTlFmEl =A9EU -----END PGP SIGNATURE----- From mail at joachim-breitner.de Wed Oct 22 09:20:38 2014 From: mail at joachim-breitner.de (Joachim Breitner) Date: Wed, 22 Oct 2014 11:20:38 +0200 Subject: [Haskell-cafe] looking for ongoing Haskell projects .. In-Reply-To: References: Message-ID: <1413969638.1376.11.camel@joachim-breitner.de> Hi, Am Sonntag, den 19.10.2014, 01:31 -0500 schrieb Vasili I. Galchin: > I was just reading at http://www.haskell.org. I am looking for a list > of currently active Haskell projects needing help .. :-) I guess most projects on http://www.haskell.org/haskellwiki/Haskell_Communities_and_Activities_Report would welcome new contributors. Greetings, Joachim -- Joachim ?nomeata? Breitner mail at joachim-breitner.de ? http://www.joachim-breitner.de/ Jabber: nomeata at joachim-breitner.de ? GPG-Key: 0xF0FBF51F Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: This is a digitally signed message part URL: From magnus at therning.org Wed Oct 22 10:05:57 2014 From: magnus at therning.org (Magnus Therning) Date: Wed, 22 Oct 2014 12:05:57 +0200 Subject: [Haskell-cafe] Timing execution of individual functions in ghci? Message-ID: <20141022100557.GD22952@mtcomp.evidente.local> When playing around with various implementations of a single function it would be nice to time the execution. Is there some way to do that easily from within GHCi? Or am I forced to look to criterion for that? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Heuristic is an algorithm in a clown suit. It?s less predictable, it?s more fun, and it comes without a 30-day, money-back guarantee. -- Steve McConnell, Code Complete -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From allbery.b at gmail.com Wed Oct 22 10:14:10 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 22 Oct 2014 06:14:10 -0400 Subject: [Haskell-cafe] Timing execution of individual functions in ghci? In-Reply-To: <20141022100557.GD22952@mtcomp.evidente.local> References: <20141022100557.GD22952@mtcomp.evidente.local> Message-ID: On Wed, Oct 22, 2014 at 6:05 AM, Magnus Therning wrote: > When playing around with various implementations of a single function > it would be nice to time the execution. Is there some way to do that > easily from within GHCi? > :set +s (possibly also +r; http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-set.html#idp7320496 ) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.trstenjak at gmail.com Wed Oct 22 10:48:53 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Wed, 22 Oct 2014 12:48:53 +0200 Subject: [Haskell-cafe] Timing execution of individual functions in ghci? In-Reply-To: <20141022100557.GD22952@mtcomp.evidente.local> References: <20141022100557.GD22952@mtcomp.evidente.local> Message-ID: <20141022104853.GA14093@machine> Hi Magnus, > When playing around with various implementations of a single function > it would be nice to time the execution. Is there some way to do that > easily from within GHCi? ghci normally only interprets your code, without much optimizations, so your timings might be quite misleading. > Or am I forced to look to criterion for that? I think so, if you want to trust your timings. Greetings, Daniel From e1028732 at student.tuwien.ac.at Wed Oct 22 14:46:42 2014 From: e1028732 at student.tuwien.ac.at (Alexander Scharinger) Date: Wed, 22 Oct 2014 16:46:42 +0200 Subject: [Haskell-cafe] Precise timing In-Reply-To: References: Message-ID: <5447C352.8010801@student.tuwien.ac.at> I think it would be much easier to take a different approach. For example one of these: * Use an audio library * Write your own audio synthesis John Lato already said something about the usual approach to audio software. I will just sketch out how to write very simple audio synthesis: * You need a sample rate! * Think in terms of a modular audio synthesizer * Write your own oscillator. * Write an "amplifier", which scales the oscilators amplitude up and down. Whenever you want the oscilator to not make sound you have to mute the amplifier. * Write an envelop generator, which generates an envelop for your amplifier. * Write a sequencer, which controlls the envelop generator. The sequencer should take your prefered encoding (like 'cycle [1,1,2]') * Write the output of the amplifier straight into the audio-out buffer of your OS. I don't know how you do that exactly. You have to find out. But I do know that on Linux you could also just write the output of your program to standard-out and pipe it into ALSA on the command line with the padsp command. Advantages of this approach: * IO-Monad is used only on the highest level of abstraction. * If you write straight into the audio-out buffer of your OS, the OS will suspend and schedule your process as needed. Whenever the audio-out buffer is full, your process will be blocked by the OS on the write system call. You don't have to think much about scheduling. * it's easy. Most of the components could be a single and simple function. Just my 2 cents, Alexander On 10/22/2014 05:14 AM, Jeffrey Brown wrote: > On a separate thread > , > Rohan Drape showed me how to send OSC. The following test, which > simplifies the old one and replaces printf with OSC, demonstrates timing > as perfect as my ears are able to distinguish. > > import Control.Concurrent > import Control.Monad > import System.IO > import Sound.OSC > main = do > hSetBuffering stdout NoBuffering > mapM_ note (cycle [1,1,2]) > withMax = withTransport (openUDP "127.0.0.1" 9000) > beat = 60000 -- 60 ms, measured in ?s > note :: Int -> IO () > note n = do > withMax (sendMessage (Message "sin0 frq 100" [])) > -- set sine wave 0 to frequency 100 > withMax (sendMessage (Message "sin0 amp 1" [])) > -- set sine wave 0 to amplitude 1 > threadDelay $ beat * n > withMax (sendMessage (Message "sin0 amp 0" [])) > -- set sine wave 0 to amplitude 0 > threadDelay $ beat * n > > This means I can use Haskell instead of Python or SuperCollider. I am > beside myself with excitement. > > Thanks again, everyone! > > On Tue, Oct 21, 2014 at 2:24 AM, Brandon Allbery > wrote: > > On Tue, Oct 21, 2014 at 4:05 AM, Heinrich Apfelmus > > wrote: > > I would be hesitant to attribute your problem to the scheduler. > An alternative explanation could be the following: The sound > file played by the terminal when it encounters the \BEL > character is longer than 100ms. A new sound will be played only > when the previous sound has finished playing, > > > On most systems I've used, this isn't true; they're either > suppressed or they overlap, depending on system. (I've had to work > around this.) > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From ky3 at atamo.com Wed Oct 22 17:16:26 2014 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Thu, 23 Oct 2014 00:16:26 +0700 Subject: [Haskell-cafe] How to send a string somewhere via UDP In-Reply-To: References: Message-ID: On 10/22/14, Jeffrey Brown wrote: > This means I can use Haskell instead of Python or SuperCollider. I am > beside myself with excitement. Glad you got going! :) You might want to look into the mailing lists Rohan suggested because I'm on some of them and I see they're super-supportive of projects like yours. From jeffbrown.the at gmail.com Wed Oct 22 17:59:29 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Wed, 22 Oct 2014 10:59:29 -0700 Subject: [Haskell-cafe] How to send a string somewhere via UDP In-Reply-To: References: Message-ID: I already joined :) On Wed, Oct 22, 2014 at 10:16 AM, Kim-Ee Yeoh wrote: > On 10/22/14, Jeffrey Brown wrote: > > This means I can use Haskell instead of Python or SuperCollider. I am > > beside myself with excitement. > > Glad you got going! :) > > You might want to look into the mailing lists Rohan suggested because > I'm on some of them and I see they're super-supportive of projects > like yours. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From spopejoy at panix.com Wed Oct 22 19:48:29 2014 From: spopejoy at panix.com (spopejoy) Date: Wed, 22 Oct 2014 19:48:29 +0000 (UTC) Subject: [Haskell-cafe] Test Framework, HUnit Message-ID: Hi, I started using Test Framework following the example of the lens library, specifically using Test.Framework.TH. It looks really nice, however I noticed that the TH project hasn't had any activity in 2 years ... plus the whole test framework project is very light on docs. I've been happy with straight HUnit, but I'm wanting something more structured to bring others into the project I'm working on. 1) Are there more resources on TF? 2) Is TF-TH actively maintained? Cheers, Stuart From jan.stolarek at p.lodz.pl Wed Oct 22 20:05:13 2014 From: jan.stolarek at p.lodz.pl (Jan Stolarek) Date: Wed, 22 Oct 2014 22:05:13 +0200 Subject: [Haskell-cafe] Test Framework, HUnit In-Reply-To: References: Message-ID: <201410222205.13853.jan.stolarek@p.lodz.pl> I believe test-framework has been abandoned. Use tasty instead. Janek Dnia ?roda, 22 pa?dziernika 2014, spopejoy napisa?: > Hi, > > I started using Test Framework following the example of the lens library, > specifically using Test.Framework.TH. It looks really nice, however I > noticed that the TH project hasn't had any activity in 2 years ... plus the > whole test framework project is very light on docs. > > I've been happy with straight HUnit, but I'm wanting something more > structured to bring others into the project I'm working on. > > 1) Are there more resources on TF? > 2) Is TF-TH actively maintained? > > Cheers, > Stuart > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From spopejoy at panix.com Wed Oct 22 21:01:10 2014 From: spopejoy at panix.com (spopejoy) Date: Wed, 22 Oct 2014 21:01:10 +0000 (UTC) Subject: [Haskell-cafe] Test Framework, HUnit References: <201410222205.13853.jan.stolarek@p.lodz.pl> Message-ID: Jan Stolarek p.lodz.pl> writes: > > I believe test-framework has been abandoned. Use tasty instead. > > Janek > > Dnia ?roda, 22 pa?dziernika 2014, spopejoy napisa?: > > Hi, > > > > I started using Test Framework following the example of the lens library, > > specifically using Test.Framework.TH. It looks really nice, however I > > noticed that the TH project hasn't had any activity in 2 years ... plus the > > whole test framework project is very light on docs. > > > > I've been happy with straight HUnit, but I'm wanting something more > > structured to bring others into the project I'm working on. > > > > 1) Are there more resources on TF? > > 2) Is TF-TH actively maintained? > > > > Cheers, > > Stuart > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > Hmm ... Tasty's cool but there's some funny business: * What's up with "Exception: ExitSuccess"? Why does a test framework need to throw an exception to exit? * Why does Tasty rewrite HUnit? They left out some nice features, like the (~:) operator, allowing quick suite authoring a la 'test = "foo" ~: [ bar @?= baz]' ... Cheers, Stuart From madjestic13 at gmail.com Wed Oct 22 21:19:29 2014 From: madjestic13 at gmail.com (Vlad Lopatin) Date: Wed, 22 Oct 2014 23:19:29 +0200 Subject: [Haskell-cafe] a textured quad/triangle In-Reply-To: References: Message-ID: Thank you, Oliver and Schell, Thanks to combined wisdom of both of you, I was able to produce the following thing: tutorial (wip) https://github.com/madjestic/Haskell-OpenGL-Tutorial/tree/master/tutorial10 I hope, when finished, some future noob may find it helpful. Cheers, Vlad On 21 October 2014 13:12, Oliver Charles wrote: > During 24 Days of Hackage last year, I wrote some basic code to get a > spinning triangle on screen, using VBOs and shaders. You can find the code > for this at > https://github.com/ocharles/blog/blob/master/code/2013-12-02-linear-example.hs > . > > To do texturing, it's not much more complicated. My toy "hadoom" project > (a Doom-like engine in Haskell) uses texturing - but obviously there's more > code to wade through there. I think the relevant stuff will be > > * Loading: > https://github.com/ocharles/hadoom/blob/420597915f115d608192cfb32e6087f7e9044732/hadoom/Material.hs#L21 > * Binding: > https://github.com/ocharles/hadoom/blob/420597915f115d608192cfb32e6087f7e9044732/hadoom/Material.hs#L84 > * Using in a shader: > https://github.com/ocharles/hadoom/blob/420597915f115d608192cfb32e6087f7e9044732/shaders/fragment/solid-white.glsl#L48 > > You'll have to do some grep'ing to see how it all fits together. You'll > also need to add UV coordinates to the triangle. > > Hope this provides enough information to help you get started. If you're > comfortable on IRC, you might want to swing by #haskell-game on Freenode, > where we're trying to build a Haskell game/graphics dev community. > - ocharles > > On Tue, Oct 21, 2014 at 11:24 AM, Vlad Lopatin > wrote: > >> Hello, >> >> I am looking for a working example of texture binding, using VBOs and >> OpenGL4+ standard. A textured quad/triangle would be great. Does anybody >> have one? >> >> >> Regards, >> Vlad >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roma at ro-che.info Wed Oct 22 21:36:35 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Thu, 23 Oct 2014 00:36:35 +0300 Subject: [Haskell-cafe] Test Framework, HUnit In-Reply-To: References: <201410222205.13853.jan.stolarek@p.lodz.pl> Message-ID: <54482363.8080006@ro-che.info> On 23/10/14 00:01, spopejoy wrote: > Hmm ... Tasty's cool but there's some funny business: > > * What's up with "Exception: ExitSuccess"? Why does a test framework need to > throw an exception to exit? It is the standard way for Haskell programs to exit. See System.Exit (http://bit.ly/1vOHwTC). I guess you're seeing this text because you're running the test suite from ghci. When you run it as a compiled executable, you don't see this message. > * Why does Tasty rewrite HUnit? To quote the changelog (http://bit.ly/1vOIE9W), this is motivated by: * efficiency (one less package to compile/install) * reliability (if something happens with HUnit, we won't be affected) > They left out some nice features, like the > (~:) operator, allowing quick suite authoring a la 'test = "foo" ~: [ bar > @?= baz]' ... You should be able to define this operator for Tasty quite easily. Even before the dependency on HUnit was dropped, that HUnit operator wouldn't work because Tasty's test are not the same as HUnit tests (though both build upon HUnit's assertions). Nor does it work with test-framework-hunit, if I'm not mistaken. Roman From rohan.drape at gmail.com Thu Oct 23 00:07:18 2014 From: rohan.drape at gmail.com (Rohan Drape) Date: Thu, 23 Oct 2014 00:07:18 +0000 (UTC) Subject: [Haskell-cafe] Precise timing References: Message-ID: > The following test [...] perhaps note that each withTransport creates a new connection. so you may want to group activities under one connection. in which case IO actions can be "lifted" into the transport action. also, hosc has pauseThread, a real-valued (in seconds) threadDelay. also, that OSC message layout, with everything in the address, is a little odd? more traditional would be either (Message "/sin0/frq" [float 100]) or as below? best, rohan main = withMax $ mapM_ note (cycle [1,1,2]) withMax = withTransport (openUDP "127.0.0.1" 9000) sin0 param val = sendMessage (Message "/sin0" [string param,float val]) pause = liftIO . pauseThread . (* 0.6) note n = do sin0 "frq" 100 sin0 "amp" 1 pause n sin0 "amp" 0 pause n From kazu at iij.ad.jp Thu Oct 23 03:07:03 2014 From: kazu at iij.ad.jp (Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=)) Date: Thu, 23 Oct 2014 12:07:03 +0900 (JST) Subject: [Haskell-cafe] Yosemite In-Reply-To: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> References: <20141017.114912.1924376902891956699.kazu@iij.ad.jp> Message-ID: <20141023.120703.158052493791366588.kazu@iij.ad.jp> Hi, > Has anybody tried GHC on Yosemite? > I cannot afford to do it by myself this time. > So, I would like to know. I upgraded to Yosemite and found no problems relating to GHC 7.8.3. Thanks. --Kazu From dstcruz at gmail.com Thu Oct 23 03:36:20 2014 From: dstcruz at gmail.com (Daniel Santa Cruz) Date: Wed, 22 Oct 2014 21:36:20 -0600 Subject: [Haskell-cafe] Haskell Weekly News: Issue 310 Message-ID: Welcome to issue 310 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from October 5 to 18, 2014 Quotes of the Week * spopejoy: That [Spineless Tagless G Machine] will always sound like the villian in an upcoming Ghostbusters sequel to me :) * pigworker: When you can make data out of potatoes, why would you want to encode them as functions? * fishcorn: When someone mentions lens on freenode... [1]zeus-lens! * neelk: So constructively we know this style can be used to meet hard performance deadlines in domains where the penalty for failure is literally radioactive flaming death. * edwardkmett: At one point we had a type in lens where one of its arguments started taking parameters of the form i m a s t a b u. Upon reflection, we let it win the argument and decided not to implement the function. * Ivan Appel: ... while the popular opinion says that the main reason to pick Haskell is "to have fun hacking," in fact it's not so fun to hack in Haskell because there's not such much hacking to do at the first place. For instance, you don't need to spend lots of effort tracing and fixing obscure bugs, so if your definition of "hacking" includes heroic bugfixing, you'd be better off with JavaScript or Perl. Top Reddit Stories * From 60 Frames per Second to 500 in Haskell Domain: keera.co.uk, Score: 116, Comments: 82 Original: [2] http://goo.gl/tiA202 On Reddit: [3] http://goo.gl/sl8TTl * Note: Erik Meijer's MOOC - "Introduction to Functional Programming" starts next Wednesday Domain: edx.org, Score: 109, Comments: 34 Original: [4] http://goo.gl/QNXb5M On Reddit: [5] http://goo.gl/sVfmE4 * The New Haskell.org Domain: blog.haskell.org, Score: 98, Comments: 72 Original: [6] http://goo.gl/TbBGrW On Reddit: [7] http://goo.gl/kdaLFq * New Haskell Book: Thinking Functionally with Haskell Domain: amazon.com, Score: 95, Comments: 39 Original: [8] http://goo.gl/oj35Ox On Reddit: [9] http://goo.gl/rYKq6c * Some notes on reimplementing a NodeJS service in Haskell Domain: gist.github.com, Score: 67, Comments: 5 Original: [10] http://goo.gl/ZoSy2a On Reddit: [11] http://goo.gl/kQ6mOs * Release of threepenny-gui 0.5.0.0: easy UI in Haskell! Domain: apfelmus.nfshost.com, Score: 65, Comments: 1 Original: [12] http://goo.gl/NClc0o On Reddit: [13] http://goo.gl/qDos1R * Bake: a Continuous Integration System Domain: neilmitchell.blogspot.fr, Score: 64, Comments: 34 Original: [14] http://goo.gl/u5bznA On Reddit: [15] http://goo.gl/7oC0N8 * On concerns about Haskell's Prelude favoring Foldable/Traversable Domain: yesodweb.com, Score: 62, Comments: 101 Original: [16] http://goo.gl/yJ7yMJ On Reddit: [17] http://goo.gl/M1M6we * Making GHCi awesomer? Domain: haskell.org, Score: 57, Comments: 3 Original: [18] http://goo.gl/KUkSQ7 On Reddit: [19] http://goo.gl/GRxzb6 * lens over tea, part 1: lenses 101, traversals 101, and some implementation details Domain: artyom.me, Score: 56, Comments: 25 Original: [20] http://goo.gl/rH0tdJ On Reddit: [21] http://goo.gl/jgsBeN * A neat trick for GHCi Domain: mega-nerd.com, Score: 54, Comments: 12 Original: [22] http://goo.gl/o9yrqJ On Reddit: [23] http://goo.gl/oB8Nhb * Shaking up GHC Domain: blogs.ncl.ac.uk, Score: 53, Comments: 21 Original: [24] http://goo.gl/jkRnPn On Reddit: [25] http://goo.gl/byWnxV * FRP Zoo: the TodoMVC of FRP libraries Domain: github.com, Score: 53, Comments: 12 Original: [26] http://goo.gl/JyKRtL On Reddit: [27] http://goo.gl/wJV4Vt * [Video] Simon Peyton Jones - Zero-Cost Coercions in Haskell at Haskell eXchange Domain: skillsmatter.com, Score: 50, Comments: 46 Original: [28] http://goo.gl/yXp43E On Reddit: [29] http://goo.gl/l0mo5O * Bryan O'Sullivan - Performance Measurement and Optimization in Haskell [video] Domain: skillsmatter.com, Score: 49, Comments: 23 Original: [30] http://goo.gl/HO4Sjy On Reddit: [31] http://goo.gl/4sqGgX * How to Rewrite the Prelude Domain: neilmitchell.blogspot.it, Score: 42, Comments: 81 Original: [32] http://goo.gl/PnnoO2 On Reddit: [33] http://goo.gl/EP9CaL * Generalizing function composition Domain: jaspervdj.be, Score: 42, Comments: 31 Original: [34] http://goo.gl/vCfmqT On Reddit: [35] http://goo.gl/GXb4gt * C structures in Haskell FFI Domain: ghc.haskell.org, Score: 40, Comments: 19 Original: [36] http://goo.gl/OT7UFH On Reddit: [37] http://goo.gl/uKJWCl * Yi 0.10, Anniversary Edition Domain: haskell.org, Score: 38, Comments: 16 Original: [38] http://goo.gl/T58nN6 On Reddit: [39] http://goo.gl/Fz6NQo * Curry-Howard, the Ontological Ultimate Domain: psnively.github.io, Score: 38, Comments: 28 Original: [40] http://goo.gl/HpPhXz On Reddit: [41] http://goo.gl/LlYUiM Top StackOverflow Questions * Is it possible to directly invoke Haskell code from Bash and output to stdout? votes: 17, answers: 3 Read on SO: [42] http://goo.gl/jkG0vv * Why does foldr use a helper function? votes: 16, answers: 4 Read on SO: [43] http://goo.gl/hsmIsF * Why do hGetBuf, hPutBuf, etc. allocate memory? votes: 14, answers: 2 Read on SO: [44] http://goo.gl/G40NfW * Is it possible to get the Kind of a Type Constructor in Haskell? votes: 10, answers: 1 Read on SO: [45] http://goo.gl/Pajd4R * Printing out Haskell's evaluation (rewriting) steps for educational/learning purposes. Is it possible? votes: 9, answers: 3 Read on SO: [46] http://goo.gl/Wlfeol Until next time, [47]+Daniel Santa Cruz References 1. https://s3.amazonaws.com/fishcorn/zeus-lens.gif 2. http://keera.co.uk/blog/2014/10/15/from-60-fps-to-500/ 3. http://www.reddit.com/r/haskell/comments/2jbl78/from_60_frames_per_second_to_500_in_haskell/ 4. https://www.edx.org/course/delftx/delftx-fp101x-introduction-functional-2126?fp 5. http://www.reddit.com/r/haskell/comments/2ixpcf/note_erik_meijers_mooc_introduction_to_functional/ 6. https://blog.haskell.org/post/the_new_haskell_org/ 7. http://www.reddit.com/r/haskell/comments/2j4sim/the_new_haskellorg/ 8. http://www.amazon.com/Thinking-Functionally-Haskell-Richard-Bird/dp/1107087201/ref=sr_1_2?ie=UTF8&qid=1413453442&sr=8-2&keywords=graham+hutton+haskell 9. http://www.reddit.com/r/haskell/comments/2jele8/new_haskell_book_thinking_functionally_with/ 10. https://gist.github.com/paf31/9c4d402d400d61a49656 11. http://www.reddit.com/r/haskell/comments/2j8lhd/some_notes_on_reimplementing_a_nodejs_service_in/ 12. http://apfelmus.nfshost.com/blog/2014/10/04-threepenny-gui-0-5.html 13. http://www.reddit.com/r/haskell/comments/2idep2/release_of_threepennygui_0500_easy_ui_in_haskell/ 14. http://neilmitchell.blogspot.fr/2014/10/bake-continuous-integration-system.html 15. http://www.reddit.com/r/haskell/comments/2in244/bake_a_continuous_integration_system/ 16. http://www.yesodweb.com/blog/2014/10/classy-base-prelude 17. http://www.reddit.com/r/haskell/comments/2if0fu/on_concerns_about_haskells_prelude_favoring/ 18. http://www.haskell.org/pipermail/ghc-devs/2014-October/006771.html 19. http://www.reddit.com/r/haskell/comments/2jm4nk/making_ghci_awesomer/ 20. http://artyom.me/lens-over-tea-1 21. http://www.reddit.com/r/haskell/comments/2igp1v/lens_over_tea_part_1_lenses_101_traversals_101/ 22. http://www.mega-nerd.com/erikd/Blog/CodeHacking/Haskell/ghci-trick.html 23. http://www.reddit.com/r/haskell/comments/2jketr/a_neat_trick_for_ghci/ 24. https://blogs.ncl.ac.uk/andreymokhov/shaking-up-ghc/ 25. http://www.reddit.com/r/haskell/comments/2j07m0/shaking_up_ghc/ 26. https://github.com/gelisam/frp-zoo#readme 27. http://www.reddit.com/r/haskell/comments/2j0u4h/frp_zoo_the_todomvc_of_frp_libraries/ 28. https://skillsmatter.com/skillscasts/5296-safe-zero-cost-coercions-in-haskell 29. http://www.reddit.com/r/haskell/comments/2iqrr5/video_simon_peyton_jones_zerocost_coercions_in/ 30. https://skillsmatter.com/skillscasts/5466-bryan-o-sullivan 31. http://www.reddit.com/r/haskell/comments/2is5am/bryan_osullivan_performance_measurement_and/ 32. http://neilmitchell.blogspot.it/2014/10/how-to-rewrite-prelude.html 33. http://www.reddit.com/r/haskell/comments/2icjmf/how_to_rewrite_the_prelude/ 34. http://jaspervdj.be/posts/2014-10-17-generalizing-function-composition.html 35. http://www.reddit.com/r/haskell/comments/2jivxa/generalizing_function_composition/ 36. https://ghc.haskell.org/trac/ghc/wiki/CStructures 37. http://www.reddit.com/r/haskell/comments/2jefui/c_structures_in_haskell_ffi/ 38. http://www.haskell.org/pipermail/haskell-cafe/2014-October/116463.html 39. http://www.reddit.com/r/haskell/comments/2j8pfv/yi_010_anniversary_edition/ 40. http://psnively.github.io/blog/2014/10/14/Curry-Howard-the-Ontological-Ultimate/ 41. http://www.reddit.com/r/haskell/comments/2jb1n7/curryhoward_the_ontological_ultimate/ 42. http://stackoverflow.com/questions/26417136/is-it-possible-to-directly-invoke-haskell-code-from-bash-and-output-to-stdout 43. http://stackoverflow.com/questions/26243014/why-does-foldr-use-a-helper-function 44. http://stackoverflow.com/questions/26333815/why-do-hgetbuf-hputbuf-etc-allocate-memory 45. http://stackoverflow.com/questions/26291740/is-it-possible-to-get-the-kind-of-a-type-constructor-in-haskell 46. http://stackoverflow.com/questions/26214586/printing-out-haskells-evaluation-rewriting-steps-for-educational-learning-pur 47. https://plus.google.com/105107667630152149014/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From magicloud.magiclouds at gmail.com Thu Oct 23 08:06:59 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Thu, 23 Oct 2014 16:06:59 +0800 Subject: [Haskell-cafe] acid-state problem. Message-ID: Hi, I have following code. In init, I called update, createCheckpoint, and close. So every time the code runs, if the DB did not exist, it would ask some configurations and create one. But actually it asks for init every time. How should I use it? state <- openLocalStateFrom dbFolder $ State ConfNone conf <- query state QueryState case conf of ConfNone -> init state m c -> process state m c -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From magicloud.magiclouds at gmail.com Thu Oct 23 09:01:10 2014 From: magicloud.magiclouds at gmail.com (Magicloud Magiclouds) Date: Thu, 23 Oct 2014 17:01:10 +0800 Subject: [Haskell-cafe] acid-state problem. In-Reply-To: References: Message-ID: It worked! Seems like it is the function (a network action) above update that failed that breaks the whole process. On Thu, Oct 23, 2014 at 4:06 PM, Magicloud Magiclouds < magicloud.magiclouds at gmail.com> wrote: > Hi, > > I have following code. In init, I called update, createCheckpoint, and > close. So every time the code runs, if the DB did not exist, it would ask > some configurations and create one. But actually it asks for init every > time. How should I use it? > > state <- openLocalStateFrom dbFolder $ State ConfNone > conf <- query state QueryState > case conf of > ConfNone -> init state m > c -> process state m c > -- > ??????? > ??????? > > And for G+, please use magiclouds#gmail.com. > -- ??????? ??????? And for G+, please use magiclouds#gmail.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Thu Oct 23 14:04:45 2014 From: magnus at therning.org (Magnus Therning) Date: Thu, 23 Oct 2014 16:04:45 +0200 Subject: [Haskell-cafe] Timing execution of individual functions in ghci? In-Reply-To: <20141022104853.GA14093@machine> References: <20141022100557.GD22952@mtcomp.evidente.local> <20141022104853.GA14093@machine> Message-ID: <20141023140445.GB11965@mtcomp.evidente.local> On Wed, Oct 22, 2014 at 12:48:53PM +0200, Daniel Trstenjak wrote: > > Hi Magnus, > >> When playing around with various implementations of a single >> function it would be nice to time the execution. Is there some way >> to do that easily from within GHCi? > > ghci normally only interprets your code, without much optimizations, > so your timings might be quite misleading. Well, it might be enough to confirm or disprove intuitions about time complexity of an implementation; is it O(n) or O(n^2)? And that's really what I'd like to see at a first step. Given that all I'm interested in is relative timings it might even be enough to do a rough comparison of two implementations too. >> Or am I forced to look to criterion for that? > > I think so, if you want to trust your timings. It's just a bit too much ceremony when all I want is to confirm that "inserting in reversed order followed by a `reverse`" has less time complexity than "repeated appending." Of course the only way to get something I can take to the bank is using criterion. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Heuristic is an algorithm in a clown suit. It?s less predictable, it?s more fun, and it comes without a 30-day, money-back guarantee. -- Steve McConnell, Code Complete -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From daniel.trstenjak at gmail.com Thu Oct 23 14:35:36 2014 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Thu, 23 Oct 2014 16:35:36 +0200 Subject: [Haskell-cafe] Timing execution of individual functions in ghci? In-Reply-To: <20141023140445.GB11965@mtcomp.evidente.local> References: <20141022100557.GD22952@mtcomp.evidente.local> <20141022104853.GA14093@machine> <20141023140445.GB11965@mtcomp.evidente.local> Message-ID: <20141023143536.GA29280@machine> Hi Magnus, > Given that all I'm interested in is relative timings it might even be > enough to do a rough comparison of two implementations too. Optimizations - especially in Haskell - can change the runtime behaviour quite dramatically. So comparing the runtime performance without turned on optimizations is pretty much pointless. Meaningful benchmarking is hard and adding any kind of uncertainty doesn't make it in any way easier. Greetings, Daniel From carter.schonwald at gmail.com Thu Oct 23 14:40:51 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 23 Oct 2014 10:40:51 -0400 Subject: [Haskell-cafe] Timing execution of individual functions in ghci? In-Reply-To: <20141023143536.GA29280@machine> References: <20141022100557.GD22952@mtcomp.evidente.local> <20141022104853.GA14093@machine> <20141023140445.GB11965@mtcomp.evidente.local> <20141023143536.GA29280@machine> Message-ID: indeed. My suggestion is 1) use criterion, its awsome 2) run the criterion suite with a variety of optimization flag choices so you can understand how that changes performance 3) use criterion some more ! On Thu, Oct 23, 2014 at 10:35 AM, Daniel Trstenjak < daniel.trstenjak at gmail.com> wrote: > > Hi Magnus, > > > Given that all I'm interested in is relative timings it might even be > > enough to do a rough comparison of two implementations too. > > Optimizations - especially in Haskell - can change the runtime behaviour > quite dramatically. So comparing the runtime performance without turned > on optimizations is pretty much pointless. > > Meaningful benchmarking is hard and adding any kind of uncertainty > doesn't make it in any way easier. > > > Greetings, > Daniel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Thu Oct 23 15:28:20 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 23 Oct 2014 11:28:20 -0400 Subject: [Haskell-cafe] Test Framework, HUnit In-Reply-To: References: Message-ID: its now in the github.com/haskell org, and i think PRS etc will be merged in if you do any ! :) On Wed, Oct 22, 2014 at 3:48 PM, spopejoy wrote: > Hi, > > I started using Test Framework following the example of the lens library, > specifically using Test.Framework.TH. It looks really nice, however I > noticed that the TH project hasn't had any activity in 2 years ... plus the > whole test framework project is very light on docs. > > I've been happy with straight HUnit, but I'm wanting something more > structured to bring others into the project I'm working on. > > 1) Are there more resources on TF? > 2) Is TF-TH actively maintained? > > Cheers, > Stuart > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From briand at aracnet.com Thu Oct 23 18:23:43 2014 From: briand at aracnet.com (briand at aracnet.com) Date: Thu, 23 Oct 2014 11:23:43 -0700 Subject: [Haskell-cafe] pattern matches are overlapped Message-ID: <20141023112343.16d36a1e@pebble.deldotd.com> This works fine keyboardAct a d p (SpecialKey KeyLeft) Down Modifiers {shift=Down, ctrl=Up, alt=Up} = do (x,y) <- get p p $= (x-0.1, y) This keyboardAct a d p (SpecialKey KeyLeft) Down shiftDown = do (x,y) <- get p p $= (x-0.1, y) where, shiftDown = Modifiers {shift=Down, ctrl=Up, alt=Up} gives me : KeyBindings.hs:32:1: Warning: Pattern match(es) are overlapped In an equation for `keyboardAct': keyboardAct angle delta p (SpecialKey KeyLeft) Down Modifiers {shift = Up, ctrl = Up, alt = Up} = ... keyboardAct is used several times via pattern matching, e.g. keyboardAct angle delta p (SpecialKey KeyLeft) Down Modifiers {shift=Up, ctrl=Up, alt=Up} = do (x,y) <- get p a <- get angle d <- get delta angle $= a+d and there are several more. So clearly, the pattern match is overlapped, just like the warning says. The question is why I don't get the same warning before I make use of shiftDown. Thanks Brian From allbery.b at gmail.com Thu Oct 23 18:27:26 2014 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 23 Oct 2014 14:27:26 -0400 Subject: [Haskell-cafe] pattern matches are overlapped In-Reply-To: <20141023112343.16d36a1e@pebble.deldotd.com> References: <20141023112343.16d36a1e@pebble.deldotd.com> Message-ID: On Thu, Oct 23, 2014 at 2:23 PM, wrote: > keyboardAct a d p (SpecialKey KeyLeft) Down shiftDown = do > (x,y) <- get p > p $= (x-0.1, y) > > where, > > shiftDown = Modifiers {shift=Down, ctrl=Up, alt=Up} > You can't use a definition like that directly in a pattern match; a name starting with lowercase is a new binding, not the value of some existing binding. You can instead use a guard or, sometimes, a pattern guard. That is, keyboardAct a d p (SpecialKey KeyLeft) Down shiftDown = is identical to keyboardAct a d p (SpecialKey KeyLeft) Down x = aside from the name of the new local binding it introduces. It does *not* use an existing binding for shiftDown or x, it always creates a new one. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwlato at gmail.com Fri Oct 24 01:00:21 2014 From: jwlato at gmail.com (John Lato) Date: Fri, 24 Oct 2014 09:00:21 +0800 Subject: [Haskell-cafe] Timing execution of individual functions in ghci? In-Reply-To: References: <20141022100557.GD22952@mtcomp.evidente.local> <20141022104853.GA14093@machine> <20141023140445.GB11965@mtcomp.evidente.local> <20141023143536.GA29280@machine> Message-ID: While criterion is really great, sometimes you do just want to measure timings. For that, you might want to give my package chronograph ( http://hackage.haskell.org/package/chronograph) a try. On Thu, Oct 23, 2014 at 10:40 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > indeed. My suggestion is > 1) use criterion, its awsome > 2) run the criterion suite with a variety of optimization flag choices so > you can understand how that changes performance > 3) use criterion some more ! > > On Thu, Oct 23, 2014 at 10:35 AM, Daniel Trstenjak < > daniel.trstenjak at gmail.com> wrote: > >> >> Hi Magnus, >> >> > Given that all I'm interested in is relative timings it might even be >> > enough to do a rough comparison of two implementations too. >> >> Optimizations - especially in Haskell - can change the runtime behaviour >> quite dramatically. So comparing the runtime performance without turned >> on optimizations is pretty much pointless. >> >> Meaningful benchmarking is hard and adding any kind of uncertainty >> doesn't make it in any way easier. >> >> >> Greetings, >> Daniel >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From volker.strobel87 at gmail.com Fri Oct 24 01:35:43 2014 From: volker.strobel87 at gmail.com (Volker Strobel) Date: Fri, 24 Oct 2014 03:35:43 +0200 Subject: [Haskell-cafe] Parse CSV / TSV file in Haskell - Unicode Characters Message-ID: Hi, I'm trying to parse a tab-delimited file using cassava/Data.Csv in Haskell. However, I get problems if there are "strange" (Unicode) characters in my CSV file. I'll get a parse error (endOfInput) then. According to the command-line tool "file", my file has a "UTF-8 Unicode text" decoding. My Haskell code looks like this: {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE OverloadedStrings #-} import qualified Data.ByteString as C import qualified System.IO.UTF8 as U import qualified Data.ByteString.UTF8 as UB import qualified Data.ByteString.Lazy.Char8 as DL import qualified Codec.Binary.UTF8.String as US import qualified Data.Text.Lazy.Encoding as EL import qualified Data.ByteString.Lazy as L import Data.Text.Encoding as E -- Handle CSV / TSV files with ... import Data.Csv import qualified Data.Vector as V import Data.Char -- ord csvFile :: FilePath csvFile = "myFile.txt" -- Set delimiter to \t (tabulator) myOptions = defaultDecodeOptions { decDelimiter = fromIntegral (ord '\t') } main :: IO () main = do csvData <- L.readFile csvFile case EL.decodeUtf8' csvData of Left err -> print err Right dat -> case decodeWith myOptions NoHeader $ EL.encodeUtf8 dat of Left err -> putStrLn err Right v -> V.forM_ v $ \ (category :: String , user :: String , date :: String, time :: String, message :: String) -> do print message I tried using decodingUtf8', preprocessing (filtering) the input with predicates from Data.Char, and much more. However the endOfFile error persists. My CSV-file looks like this: a - - - RT USE " Kenny" ? Hahahahahahahahaha. #Emmen #Brandstapel a - - - Uhm .. wat dan ook ????!!!! ? Or more literally: a\t-\t-\t-\tRT USE " Kenny" ? Hahahahahahahahaha. #Emmen #Brandstapel a\t-\t-\t-\tUhm .. wat dan ook ????!!!! ? The problem chars are the ? and ? (and in my complete file, there are many more of similar characters). What can I do, so that cassava / Data.Csv can read my file properly? I've also posted this question at StackOverflow a few days ago: http://stackoverflow.com/questions/26499831/parse-csv-tsv-file-in-haskell-unicode-characters Best, Volker -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Fri Oct 24 05:59:07 2014 From: johan.tibell at gmail.com (Johan Tibell) Date: Fri, 24 Oct 2014 07:59:07 +0200 Subject: [Haskell-cafe] Parse CSV / TSV file in Haskell - Unicode Characters In-Reply-To: References: Message-ID: I just replied to your question on SO. On Fri, Oct 24, 2014 at 3:35 AM, Volker Strobel wrote: > Hi, > > I'm trying to parse a tab-delimited file using cassava/Data.Csv in > Haskell. However, I get problems if there are "strange" (Unicode) > characters in my CSV file. I'll get a parse error (endOfInput) then. > > According to the command-line tool "file", my file has a "UTF-8 Unicode > text" decoding. My Haskell code looks like this: > > {-# LANGUAGE ScopedTypeVariables #-} > {-# LANGUAGE OverloadedStrings #-} > > import qualified Data.ByteString as C > import qualified System.IO.UTF8 as U > import qualified Data.ByteString.UTF8 as UB > import qualified Data.ByteString.Lazy.Char8 as DL > import qualified Codec.Binary.UTF8.String as US > import qualified Data.Text.Lazy.Encoding as EL > import qualified Data.ByteString.Lazy as L > > import Data.Text.Encoding as E > > -- Handle CSV / TSV files with ... > import Data.Csv > import qualified Data.Vector as V > > import Data.Char -- ord > > csvFile :: FilePath > csvFile = "myFile.txt" > > -- Set delimiter to \t (tabulator) > myOptions = defaultDecodeOptions { > decDelimiter = fromIntegral (ord '\t') > } > > main :: IO () > main = do > csvData <- L.readFile csvFile > case EL.decodeUtf8' csvData of > Left err -> print err > Right dat -> > case decodeWith myOptions NoHeader $ EL.encodeUtf8 dat of > Left err -> putStrLn err > Right v -> V.forM_ v $ \ (category :: String , > user :: String , > date :: String, > time :: String, > message :: String) -> do > print message > > I tried using decodingUtf8', preprocessing (filtering) the input with > predicates from Data.Char, and much more. However the endOfFile error > persists. > > My CSV-file looks like this: > > a - - - RT USE " Kenny" ? Hahahahahahahahaha. #Emmen #Brandstapel > a - - - Uhm .. wat dan ook ????!!!! ? > > Or more literally: > > a\t-\t-\t-\tRT USE " Kenny" ? Hahahahahahahahaha. #Emmen #Brandstapel > a\t-\t-\t-\tUhm .. wat dan ook ????!!!! ? > > The problem chars are the ? and ? (and in my complete file, there are > many more of similar characters). What can I do, so that cassava / Data.Csv > can read my file properly? > > I've also posted this question at StackOverflow a few days ago: > http://stackoverflow.com/questions/26499831/parse-csv-tsv-file-in-haskell-unicode-characters > > Best, > Volker > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hvr at gnu.org Sat Oct 25 09:43:58 2014 From: hvr at gnu.org (Herbert Valerio Riedel) Date: Sat, 25 Oct 2014 11:43:58 +0200 Subject: [Haskell-cafe] Call-for-help: Add XDGBDS support to `directory` package Message-ID: <874mustrfl.fsf@gnu.org> Hello *, I'd like to invite everyone with knowledge of the XDG Base Directory Specification[1] to contribute to https://github.com/haskell/directory/issues/6 >From what I gathered, it appears to me that adhering to the XDGBD Spec (on Linux at least) is desirable and "strongly encouraged" by Linux distributions[2], so I think this ought to be implemented sooner rather than later (maybe even in time to be part of GHC 7.10.1) This issue was originally filed against GHC, since it affects the location of the `~/.ghc` folder (and fwiw this would also affect cabal's `~/.cabal` folder location). Thanks, hvr [1]: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html [2]: https://wiki.debian.org/XDGBaseDirectorySpecification From alexey.muranov at gmail.com Sat Oct 25 15:42:43 2014 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sat, 25 Oct 2014 17:42:43 +0200 Subject: [Haskell-cafe] a simpler way to declare typeclass instances Message-ID: <034ACEE3-9524-4C47-B3BC-3E6D882770C9@gmail.com> Hello, i am trying to understand how typeclasses work. I know that they can be used as follows (from the manual): data Foo = Foo {x :: Integer, str :: String} instance Eq Foo where (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) I am wondering, why is the following seemingly unambiguous syntax not allowed too? data Foo = Foo { x :: Integer, str :: String } instance Eq Foo (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) If it was allowed, it seems that it could also be applied to records: class HasName r where name :: r -> String data Bird = Bird { name :: String, wingNumber :: Integer } data Person = Person { name :: String, likesBirds :: Bool } instance HasName Bird instance HasName Person Alexey. From miguelimo38 at yandex.ru Sat Oct 25 15:50:52 2014 From: miguelimo38 at yandex.ru (MigMit) Date: Sat, 25 Oct 2014 19:50:52 +0400 Subject: [Haskell-cafe] a simpler way to declare typeclass instances In-Reply-To: <034ACEE3-9524-4C47-B3BC-3E6D882770C9@gmail.com> References: <034ACEE3-9524-4C47-B3BC-3E6D882770C9@gmail.com> Message-ID: Well, in this case it would look like a definition of a completely independent function (=), which, obviously, clashes with the already defined one. In general, it's a good idea to keep things that don't make sense without some previous declaration inside the block, established by that declaration. > On 25 Oct 2014, at 19:42, Alexey Muranov wrote: > > Hello, > > i am trying to understand how typeclasses work. I know that they can be used as follows (from the manual): > > data Foo = Foo {x :: Integer, str :: String} > > instance Eq Foo where > (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) > > I am wondering, why is the following seemingly unambiguous syntax not allowed too? > > data Foo = Foo { x :: Integer, str :: String } > > instance Eq Foo > > (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) > > If it was allowed, it seems that it could also be applied to records: > > class HasName r where > name :: r -> String > > data Bird = Bird { name :: String, wingNumber :: Integer } > data Person = Person { name :: String, likesBirds :: Bool } > > instance HasName Bird > instance HasName Person > > Alexey. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From adam at well-typed.com Sat Oct 25 16:25:37 2014 From: adam at well-typed.com (Adam Gundry) Date: Sat, 25 Oct 2014 17:25:37 +0100 Subject: [Haskell-cafe] a simpler way to declare typeclass instances In-Reply-To: <034ACEE3-9524-4C47-B3BC-3E6D882770C9@gmail.com> References: <034ACEE3-9524-4C47-B3BC-3E6D882770C9@gmail.com> Message-ID: <544BCF01.2010505@well-typed.com> Hi Alexey, On 25/10/14 16:42, Alexey Muranov wrote: > i am trying to understand how typeclasses work. I know that they can be used as follows (from the manual): > > data Foo = Foo {x :: Integer, str :: String} > > instance Eq Foo where > (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) > > I am wondering, why is the following seemingly unambiguous syntax not allowed too? > > data Foo = Foo { x :: Integer, str :: String } > > instance Eq Foo > > (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) This case is obviously unambiguous, but what is the general rule? Is the presence of the Foo data constructor important? What if I wrote the following, which would be a perfectly good instance method: foo1 == foo2 = (x foo1 == x foo2) && (str foo1 == str foo2) In general, should the compiler be doing type inference to determine which instance a declaration belongs to? In principle, the language could permit instance methods to be detached from the instances themselves, but I don't think it should. > If it was allowed, it seems that it could also be applied to records: > > class HasName r where > name :: r -> String > > data Bird = Bird { name :: String, wingNumber :: Integer } > data Person = Person { name :: String, likesBirds :: Bool } > > instance HasName Bird > instance HasName Person Note that this currently would only work if you declare Bird and Person in different modules. I'm not convinced that saving one line of boilerplate in the instance declarations is worth it. On the topic of records in particular, you may be interested in the work on OverloadedRecordFields [1], which might (or might not) appear in GHC 7.10. Cheers, Adam [1] https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields -- Adam Gundry, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ From alexey.muranov at gmail.com Sat Oct 25 17:38:31 2014 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sat, 25 Oct 2014 19:38:31 +0200 Subject: [Haskell-cafe] a simpler way to declare typeclass instances In-Reply-To: <544BCF01.2010505@well-typed.com> References: <034ACEE3-9524-4C47-B3BC-3E6D882770C9@gmail.com> <544BCF01.2010505@well-typed.com> Message-ID: <2A1B6F34-32D6-4B5A-9ACA-1BE46CFC7E29@gmail.com> Hello Adam, On 25 oct. 2014, at 18:25, Adam Gundry wrote: > Hi Alexey, > > On 25/10/14 16:42, Alexey Muranov wrote: >> i am trying to understand how typeclasses work. I know that they can be used as follows (from the manual): >> >> data Foo = Foo {x :: Integer, str :: String} >> >> instance Eq Foo where >> (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) >> >> I am wondering, why is the following seemingly unambiguous syntax not allowed too? >> >> data Foo = Foo { x :: Integer, str :: String } >> >> instance Eq Foo >> >> (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) > > This case is obviously unambiguous, but what is the general rule? Is the > presence of the Foo data constructor important? What if I wrote the > following, which would be a perfectly good instance method: > > foo1 == foo2 = (x foo1 == x foo2) && (str foo1 == str foo2) > > In general, should the compiler be doing type inference to determine > which instance a declaration belongs to? In principle, the language > could permit instance methods to be detached from the instances > themselves, but I don't think it should. I have not really thought well about this, but i see no problem with your example: the compiler can use type inference to see that `foo1` and `foo2` are of type `Foo`. I see that type inference is used everywhere in Haskell, back and forth and upside down [1], so why not here? :) In fact, even the `instance Eq Foo` declaration should be unnecessary IMO because it can be inferred. I imagine there could be other obstacles of which i haven't thought. >> If it was allowed, it seems that it could also be applied to records: >> >> class HasName r where >> name :: r -> String >> >> data Bird = Bird { name :: String, wingNumber :: Integer } >> data Person = Person { name :: String, likesBirds :: Bool } >> >> instance HasName Bird >> instance HasName Person > > Note that this currently would only work if you declare Bird and Person > in different modules. I'm not convinced that saving one line of > boilerplate in the instance declarations is worth it. It is not to save one line but to avoid namespace pollution with record field names. I do not see why Bird and Person would need to be in different modules if the compiler could determine that they both are instances of HasName. Of course, currently this does not work. > On the topic of records in particular, you may be interested in the work > on OverloadedRecordFields [1], which might (or might not) appear in GHC > 7.10. > > Cheers, > > Adam > > [1] https://ghc.haskell.org/trac/ghc/wiki/Records/OverloadedRecordFields Thanks for the link, i believe i've read something about it. This looks a bit complicated for me, maybe i'll look at it again later. Alexey. [1] http://stackoverflow.com/questions/3467279/how-to-create-a-polyvariadic-haskell-function From jeffbrown.the at gmail.com Sat Oct 25 23:23:39 2014 From: jeffbrown.the at gmail.com (Jeffrey Brown) Date: Sat, 25 Oct 2014 16:23:39 -0700 Subject: [Haskell-cafe] Monads: external questions Message-ID: As opposed to the internal logic of monads, how they work, I hope to start a discussion about their external logic: how and why to use monads. design ------ How do monads change the way one * thinks about a problem? * structures data? * refactors? * tests? Should I always be giving the monads a lot of cognitive bandwidth, because they reorder the way everything should be, or is it an investment with a high initial cognitive cost but requiring little maintenance thereafter? what is their common framework? ------------------------------- Monads let data reach farther than it otherwise would. Subjectively, they feel like a controlled way of violating encapsulation. Are there other, deeper or more specific, commonalities that explain why monads are a good way to implement exceptions, output, state, and perhaps other services? varieties --------- In practice, are all monads either for exceptions, state or output? If not, what other goals are monads well suited to? How should multiple contexts coexist? What's a simple Haskell program that uses more than one kind of monad in the same scope? Should, say, output and state be nestled in parallel into a three-attribute monad (the third variable being the type variable), or would it instead be better to create separate output and state monads? If each context should have a separate monad, is it a good idea to nest them, or somehow otherwise let them overlap, within a particular function or scope? temptations to err ------------------ I have a vague sense that a common pitfall is to use monads to do things in a procedural way that eliminates the benefits of a functional language, but I'm not sure I would recognize it if I were making that error. I feel like I could learn from a comparison of code that works and uses monads badly to code that does better. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwlato at gmail.com Sat Oct 25 23:52:36 2014 From: jwlato at gmail.com (John Lato) Date: Sat, 25 Oct 2014 16:52:36 -0700 Subject: [Haskell-cafe] Monads: external questions In-Reply-To: References: Message-ID: A fairly short answer for now, that doesn't address everything. I don't think monads necessarily change the way one things about a problem. I personally think of a monad as a way to structure a computation. There's a bit of a hierarchy: 1. functions model a computation from inputs to an output. 2. Applicative functors model a computation from inputs to an output within some type of fancy context. The computation can depend on the context, but it cannot change the context at all. 3. Monads allow the computation to affect the context. That's why a monad is a good model for mutable state: it's a very simple structure that allows for the computation to mutate the state (context). Mutable state itself is a decent model for IO. In practice there are other common users of monads. Modeling coroutines is probably one of the most useful, although perhaps it's not used as widely as it could be. Formerly one of the biggest pitfalls was using a monad when an Applicative would be sufficient. Hopefully the AMP will help with this in the future. Otherwise, I think generally monads are a good model when their power is required. On Oct 25, 2014 4:24 PM, "Jeffrey Brown" wrote: > As opposed to the internal logic of monads, how they work, I hope to start > a discussion about their external logic: how and why to use monads. > > design > ------ > How do monads change the way one > * thinks about a problem? > * structures data? > * refactors? > * tests? > Should I always be giving the monads a lot of cognitive bandwidth, because > they reorder the way everything should be, or is it an investment with a > high initial cognitive cost but requiring little maintenance thereafter? > > what is their common framework? > ------------------------------- > Monads let data reach farther than it otherwise would. Subjectively, they > feel like a controlled way of violating encapsulation. > > Are there other, deeper or more specific, commonalities that explain why > monads are a good way to implement exceptions, output, state, and perhaps > other services? > > varieties > --------- > In practice, are all monads either for exceptions, state or output? If > not, what other goals are monads well suited to? > > How should multiple contexts coexist? What's a simple Haskell program that > uses more than one kind of monad in the same scope? Should, say, output and > state be nestled in parallel into a three-attribute monad (the third > variable being the type variable), or would it instead be better to create > separate output and state monads? If each context should have a separate > monad, is it a good idea to nest them, or somehow otherwise let them > overlap, within a particular function or scope? > > temptations to err > ------------------ > I have a vague sense that a common pitfall is to use monads to do things > in a procedural way that eliminates the benefits of a functional language, > but I'm not sure I would recognize it if I were making that error. I feel > like I could learn from a comparison of code that works and uses monads > badly to code that does better. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From agocorona at gmail.com Sun Oct 26 01:02:59 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Sun, 26 Oct 2014 02:02:59 +0100 Subject: [Haskell-cafe] Monads: external questions In-Reply-To: References: Message-ID: 2014-10-26 1:23 GMT+02:00 Jeffrey Brown : > As opposed to the internal logic of monads, how they work, I hope to start > a discussion about their external logic: how and why to use monads. > > design > ------ > How do monads change the way one > * thinks about a problem? > * structures data? > * refactors? > * tests? > Should I always be giving the monads a lot of cognitive bandwidth, because > they reorder the way everything should be, or is it an investment with a > high initial cognitive cost but requiring little maintenance thereafter? > > what is their common framework? > ------------------------------- > Monads let data reach farther than it otherwise would. Subjectively, they > feel like a controlled way of violating encapsulation. > > Are there other, deeper or more specific, commonalities that explain why > monads are a good way to implement exceptions, output, state, and perhaps > other services? > I made monads for execution state recovery, web navigation.. workflows, long running transactions, backtracking, traceback and event chaining in web browser applications. I?m confident that the perspectives for monads to solve real IT problems are very promising. And when I mean monad I mean all the associated stuff : applicative, alternative etc. I?m confident that there will be a cloud monad (for chaining jobs and work distribution) an orchestration monad for orchestration of web services etc. There are problems that are intrinsically procedural among them, almost all problems in IT. instead of using ad-hoc data/control structures like events, handlers, configurations, routes, exceptions, logs, transaction compensations, promises ....the list goes on and on , the monad is the common control structure that can subsume all of them inside his programmable semicolon So, once the monad is set up, the user of the monad code the solution for the domain problem in a clean EDSL with absolutely no plumbing, at the level of the problem. so anyone that know the problem can understand the code. Is the monad instance, and the applicative etc the ones that subsume under the hood the special data/control structure necessary for the domain problem. Often if your code is general enough, it can be used in any monad. So you benefit from this. I think that in th future there will be a lot of surprises about the shareability of code between monads when the IT industry start to use them seriously. I think that we are just at the beginning. I hope that some others of your questions are also answered here -------------- next part -------------- An HTML attachment was scrubbed... URL: From gonzaw308 at gmail.com Sun Oct 26 01:36:07 2014 From: gonzaw308 at gmail.com (gonzaw) Date: Sat, 25 Oct 2014 18:36:07 -0700 (PDT) Subject: [Haskell-cafe] Polymorphic functions over string libraries Message-ID: <1414287367539-5758630.post@n5.nabble.com> Hi. I was wondering what would be the best way to create a polymorphic function over any possible string library (Text, String, Bytestring, etc). For instance, imagine I have to read a file with text, transform this text in some way and output it to another file, or to the console. If I wanted to use String, I'd just do this: / transform :: String -> String main = readFile "input.txt" >>= writeFile "output.txt" . transform / But if I wanted to use Text instead, I'd have to use this: / import qualified Data.Text.IO as T transform :: Text -> Text main = T.readFile "input.txt" >>= T.writeFile "output.txt" . transform / Idem for ByteString. I was wondering if there was a way to create these computations in a generic way, for any kind of string library, something like this: / class StringLibrary s where: sReadFile :: FilePath -> IO s sWriteFile :: FilePath -> s -> IO () ... / So then I'd just have this: / transform :: StringLibrary s => s -> s main = sReadFile "input.txt" >>= sWriteFile "output.txt" . transform / Now I can perform the computation I want without being tied down to a specific library. At times when I create some quick scripts, I find myself using one library (for example using String to get it finished more quickly, since I have less experience with the other ones), but find that it's too slow or has some problem that is solved by using one of the other libraries. Yet swapping from one to the other is more cumbersome than expected at times. In the example above, I could easily swap between them, just by forcing the compiler to typecheck to a specific one (for instance by changing the type of "transform"). Or if I wanted to, I could leave it as it is and export it as a library of my own. Is there a way to do something like this in Haskell, with existing libraries? In terms of using the string datatype as some sort of container of characters, I think there are libraries like Lens and mono-traversable that allow you to do stuff like this. But I'm not too familiar with them (at least using them in this way). -- View this message in context: http://haskell.1045720.n5.nabble.com/Polymorphic-functions-over-string-libraries-tp5758630.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. From fuuzetsu at fuuzetsu.co.uk Sun Oct 26 03:14:48 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Sun, 26 Oct 2014 03:14:48 +0000 Subject: [Haskell-cafe] Tracking down where an instance comes from Message-ID: <544C6728.8010105@fuuzetsu.co.uk> Hi, I'm in a situation where we have a 140+ module program (Yi) with some 30+ packages of dependencies and somewhere along the lines, this little guy gets in: instance [safe] Show (a -> b) -- Defined in ?Text.Show.Functions? Of course this automatically infects everything to import Yi. This is bad. What would be the best way to track down through which import this actually comes in? There's nothing directly importing Text.Show.Functions and I wonder if there's a better way than ?remove imports one by one going deeper each time you hit it? which might take a while, especially as there seems to be no way to unload instances except restarting GHCi. -- Mateusz K. From vlatko.basic at gmail.com Sun Oct 26 06:31:00 2014 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Sun, 26 Oct 2014 07:31:00 +0100 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: <1414287367539-5758630.post@n5.nabble.com> References: <1414287367539-5758630.post@n5.nabble.com> Message-ID: <544C9524.2050404@gmail.com> Hi Gonzaw, you could try switching to ClassyPrelude: {-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} import ClassyPrelude -- | Just change the sig, and all typechecks transform :: String -> String --transform :: ByteString -> ByteString --transform :: Text -> Text transform s = s xmain :: IO () xmain = readFile "input.txt" >>= writeFile "output.txt" . transform You must write the signatures so the compiler knows which version to use, if it can't guess by itself. The downside is that sometimes the polymorphic signatures and errors on types can be rather cryptic, but you'll get used to them. (However, there are some issues when switching. Most of the issues I had were - about missing partial functions (like head,tail, etc.), so as a quick workaround you can use unsafeHead, unsafeTail, etc. until you find the time to make it correct (or headMay, tailMay, etc) and - switching from Prelude's FilePath to Filesystem's FilePath.) Best regards, vlatko -------- Original Message -------- Subject: [Haskell-cafe] Polymorphic functions over string libraries From: gonzaw To: haskell-cafe at haskell.org Date: 26.10.2014 02:36 > Hi. > > I was wondering what would be the best way to create a polymorphic function > over any possible string library (Text, String, Bytestring, etc). > > For instance, imagine I have to read a file with text, transform this text > in some way and output it to another file, or to the console. > If I wanted to use String, I'd just do this: > / > transform :: String -> String > main = readFile "input.txt" >>= writeFile "output.txt" . transform > / > But if I wanted to use Text instead, I'd have to use this: > / > import qualified Data.Text.IO as T > > transform :: Text -> Text > main = T.readFile "input.txt" >>= T.writeFile "output.txt" . transform > / > Idem for ByteString. > > I was wondering if there was a way to create these computations in a generic > way, for any kind of string library, something like this: > / > class StringLibrary s where: > sReadFile :: FilePath -> IO s > sWriteFile :: FilePath -> s -> IO () > ... > / > So then I'd just have this: > / > transform :: StringLibrary s => s -> s > main = sReadFile "input.txt" >>= sWriteFile "output.txt" . transform > / > Now I can perform the computation I want without being tied down to a > specific library. At times when I create some quick scripts, I find myself > using one library (for example using String to get it finished more quickly, > since I have less experience with the other ones), but find that it's too > slow or has some problem that is solved by using one of the other libraries. > Yet swapping from one to the other is more cumbersome than expected at > times. > In the example above, I could easily swap between them, just by forcing the > compiler to typecheck to a specific one (for instance by changing the type > of "transform"). Or if I wanted to, I could leave it as it is and export it > as a library of my own. > > Is there a way to do something like this in Haskell, with existing > libraries? > In terms of using the string datatype as some sort of container of > characters, I think there are libraries like Lens and mono-traversable that > allow you to do stuff like this. But I'm not too familiar with them (at > least using them in this way). > > > > > -- > View this message in context: http://haskell.1045720.n5.nabble.com/Polymorphic-functions-over-string-libraries-tp5758630.html > Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From KAction at gnu.org Sun Oct 26 08:19:58 2014 From: KAction at gnu.org (Dmitry Bogatov) Date: Sun, 26 Oct 2014 11:19:58 +0300 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: <544C9524.2050404@gmail.com> References: <1414287367539-5758630.post@n5.nabble.com> <544C9524.2050404@gmail.com> Message-ID: <20141026081958.GA7294@self> * Vlatko Basic [2014-10-26 07:31:00+0100] > Hi Gonzaw, > > you could try switching to ClassyPrelude: > > > {-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-} Absolutely agree, but I would also mention mono-traversable package, used by classyPrelude, but probably is lesser dependency. -- Best regards, Dmitry Bogatov , Free Software supporter, esperantisto and netiquette guardian. GPG: 54B7F00D -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: not available URL: From rudy at matela.com.br Sun Oct 26 16:20:14 2014 From: rudy at matela.com.br (Rudy Matela) Date: Sun, 26 Oct 2014 16:20:14 +0000 Subject: [Haskell-cafe] Haskell Cheat Sheet In-Reply-To: References: Message-ID: Hi, All, It's been a while. I've updated my Haskell Cheat Sheet, intended to cover basic Haskell functions and expressions: * added more functions, covering a good part of the Prelude; * removed descriptions for functions or expressions that have obvious names; * added more examples. https://github.com/rudymatela/ultimate-cheat-sheets/releases/download/haskell-v0.5/haskell-ucs-0.5.pdf https://github.com/rudymatela/ultimate-cheat-sheets Thanks to people who sent suggestions. Suggestions and pull requests are still welcome. LaTeX source is avaliable on GitHub. Regards, Rudy PS: This blog post by Jo?o Crist?v?o has a good summary of other cheat sheets / reference cards floating around on the internet: http://fundeps.com/posts/cheatsheets/2014-03-04-cheat-sheets/ On Fri, Mar 7, 2014 at 7:53 PM, Rudy Matela wrote: > New version 0.3, with suggestions and patches from some people applied. From kyle.marek.spartz at gmail.com Sun Oct 26 16:18:13 2014 From: kyle.marek.spartz at gmail.com (Kyle Marek-Spartz) Date: Sun, 26 Oct 2014 11:18:13 -0500 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: <1414287367539-5758630.post@n5.nabble.com> References: <1414287367539-5758630.post@n5.nabble.com> Message-ID: <2fcp3soasy3irc.fsf@gmail.com> This is one of the problems that an improved module language would solve such as the one in SML (Signatures and functors provide for this functionality). In Haskell-land, this is an active area of research. You may be interested in Backpack: http://plv.mpi-sws.org/backpack/ gonzaw writes: > Hi. > > I was wondering what would be the best way to create a polymorphic function > over any possible string library (Text, String, Bytestring, etc). > > For instance, imagine I have to read a file with text, transform this text > in some way and output it to another file, or to the console. > If I wanted to use String, I'd just do this: > / > transform :: String -> String > main = readFile "input.txt" >>= writeFile "output.txt" . transform > / > But if I wanted to use Text instead, I'd have to use this: > / > import qualified Data.Text.IO as T > > transform :: Text -> Text > main = T.readFile "input.txt" >>= T.writeFile "output.txt" . transform > / > Idem for ByteString. > > I was wondering if there was a way to create these computations in a generic > way, for any kind of string library, something like this: > / > class StringLibrary s where: > sReadFile :: FilePath -> IO s > sWriteFile :: FilePath -> s -> IO () > ... > / > So then I'd just have this: > / > transform :: StringLibrary s => s -> s > main = sReadFile "input.txt" >>= sWriteFile "output.txt" . transform > / > Now I can perform the computation I want without being tied down to a > specific library. At times when I create some quick scripts, I find myself > using one library (for example using String to get it finished more quickly, > since I have less experience with the other ones), but find that it's too > slow or has some problem that is solved by using one of the other libraries. > Yet swapping from one to the other is more cumbersome than expected at > times. > In the example above, I could easily swap between them, just by forcing the > compiler to typecheck to a specific one (for instance by changing the type > of "transform"). Or if I wanted to, I could leave it as it is and export it > as a library of my own. > > Is there a way to do something like this in Haskell, with existing > libraries? > In terms of using the string datatype as some sort of container of > characters, I think there are libraries like Lens and mono-traversable that > allow you to do stuff like this. But I'm not too familiar with them (at > least using them in this way). -- Kyle Marek-Spartz From svenpanne at gmail.com Sun Oct 26 16:56:58 2014 From: svenpanne at gmail.com (Sven Panne) Date: Sun, 26 Oct 2014 17:56:58 +0100 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: Currently doc building on Hackage seems to be broken again: Three tiny packages (StateVar, ObjectName, Tensor) I've uploaded more than 2 days ago are still without documentation. I think there is a way to upload this manually, but I don't think that's a good idea, because there's no guarantee that the documentation and the package are in sync. Furthermore, I can't even find a description on hackage.haskell.org how to do that (if I wanted to). I'm well aware that most of the Haskell infrastructure depends on volunteers, so things can't be perfect and there are no SLAs etc. What I'm only complaining about is that it's totally unclear what's going on and what the current status is: Is documentation building totally broken at the moment? If yes, when will it be available again? Are there any kind of logs I can see? Are my packages in some hidden documentation builder queue? If yes, knowing its position and/or ETA might be nice. The building doesn't have to be lightning fast, but having some kind of progress indicator would really be nice. Without any visible documentation basically all packages are useless because one can't really know what what they contain, a synopsis is not enough most of the time. From carter.schonwald at gmail.com Sun Oct 26 17:07:28 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 26 Oct 2014 13:07:28 -0400 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: 1) once they finally finish updating the hackage deply to current hackage-server master, there will be more visibility into the build process 2) i've pinged the person who is owning making sure doc builders are working to ask them to check it out On Sun, Oct 26, 2014 at 12:56 PM, Sven Panne wrote: > Currently doc building on Hackage seems to be broken again: Three tiny > packages (StateVar, ObjectName, Tensor) I've uploaded more than 2 days > ago are still without documentation. I think there is a way to upload > this manually, but I don't think that's a good idea, because there's > no guarantee that the documentation and the package are in sync. > Furthermore, I can't even find a description on hackage.haskell.org > how to do that (if I wanted to). > > I'm well aware that most of the Haskell infrastructure depends on > volunteers, so things can't be perfect and there are no SLAs etc. What > I'm only complaining about is that it's totally unclear what's going > on and what the current status is: Is documentation building totally > broken at the moment? If yes, when will it be available again? Are > there any kind of logs I can see? Are my packages in some hidden > documentation builder queue? If yes, knowing its position and/or ETA > might be nice. The building doesn't have to be lightning fast, but > having some kind of progress indicator would really be nice. Without > any visible documentation basically all packages are useless because > one can't really know what what they contain, a synopsis is not enough > most of the time. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwlato at gmail.com Sun Oct 26 19:43:11 2014 From: jwlato at gmail.com (John Lato) Date: Sun, 26 Oct 2014 12:43:11 -0700 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: <2fcp3soasy3irc.fsf@gmail.com> References: <1414287367539-5758630.post@n5.nabble.com> <2fcp3soasy3irc.fsf@gmail.com> Message-ID: This could be solved by SML-style modules, but as you mention, that's an active area of research. Class-based solutions, such as ListLike or the newer mono-traversable, have been available for years. On Sun, Oct 26, 2014 at 9:18 AM, Kyle Marek-Spartz < kyle.marek.spartz at gmail.com> wrote: > This is one of the problems that an improved module language would solve > such as the one in SML (Signatures and functors provide for this > functionality). In Haskell-land, this is an active area of research. You > may be interested in Backpack: > > http://plv.mpi-sws.org/backpack/ > > > gonzaw writes: > > > Hi. > > > > I was wondering what would be the best way to create a polymorphic > function > > over any possible string library (Text, String, Bytestring, etc). > > > > For instance, imagine I have to read a file with text, transform this > text > > in some way and output it to another file, or to the console. > > If I wanted to use String, I'd just do this: > > / > > transform :: String -> String > > main = readFile "input.txt" >>= writeFile "output.txt" . transform > > / > > But if I wanted to use Text instead, I'd have to use this: > > / > > import qualified Data.Text.IO as T > > > > transform :: Text -> Text > > main = T.readFile "input.txt" >>= T.writeFile "output.txt" . transform > > / > > Idem for ByteString. > > > > I was wondering if there was a way to create these computations in a > generic > > way, for any kind of string library, something like this: > > / > > class StringLibrary s where: > > sReadFile :: FilePath -> IO s > > sWriteFile :: FilePath -> s -> IO () > > ... > > / > > So then I'd just have this: > > / > > transform :: StringLibrary s => s -> s > > main = sReadFile "input.txt" >>= sWriteFile "output.txt" . transform > > / > > Now I can perform the computation I want without being tied down to a > > specific library. At times when I create some quick scripts, I find > myself > > using one library (for example using String to get it finished more > quickly, > > since I have less experience with the other ones), but find that it's too > > slow or has some problem that is solved by using one of the other > libraries. > > Yet swapping from one to the other is more cumbersome than expected at > > times. > > In the example above, I could easily swap between them, just by forcing > the > > compiler to typecheck to a specific one (for instance by changing the > type > > of "transform"). Or if I wanted to, I could leave it as it is and export > it > > as a library of my own. > > > > Is there a way to do something like this in Haskell, with existing > > libraries? > > In terms of using the string datatype as some sort of container of > > characters, I think there are libraries like Lens and mono-traversable > that > > allow you to do stuff like this. But I'm not too familiar with them (at > > least using them in this way). > > -- > Kyle Marek-Spartz > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alper.tekinalp at gmail.com Mon Oct 27 08:16:21 2014 From: alper.tekinalp at gmail.com (Alper Tekinalp) Date: Mon, 27 Oct 2014 10:16:21 +0200 Subject: [Haskell-cafe] Wiki Account Message-ID: Hi. In wiki page it says: " If you would like an account please email "nominolo" (at the email service from Google) or on the haskell-cafe mailing list." I want to create a wiki account. My preferred user name: alpert Can anyone help? Best regards. -- Alper Tekinalp atekinalp.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cpdurham at gmail.com Mon Oct 27 15:05:59 2014 From: cpdurham at gmail.com (Charlie Durham) Date: Mon, 27 Oct 2014 11:05:59 -0400 Subject: [Haskell-cafe] inlinable vs inline Message-ID: Hi, I wanted to get some clarifications on how inlinable and inline behave. One particular case is where you have a module exporting some functions with helper functions that are not exported. You go ahead and add inlinable to the exported functions so that the call site can specialize on them. Is there any penalty to adding inline vs inlinable to the helper functions? For example, are there cases where a helper function will not inline and thus can not be specailized at the call site and it would be better to declare the helper function inlinable? I would be interested to hear any nuances related to the differences and practical consequences of these pragmas. Thanks! Charlie Durham -------------- next part -------------- An HTML attachment was scrubbed... URL: From ndtimofeev at gmail.com Mon Oct 27 15:36:07 2014 From: ndtimofeev at gmail.com (=?UTF-8?B?0J3QuNC60LjRgtCwINCi0LjQvNC+0YTQtdC10LI=?=) Date: Mon, 27 Oct 2014 19:36:07 +0400 Subject: [Haskell-cafe] pontarius-xmpp with tls Message-ID: Who can show a working example code creates a client Session with the server with enabled TLS? -- Timofeev N.D. -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at bergmark.nl Mon Oct 27 17:50:28 2014 From: adam at bergmark.nl (Adam Bergmark) Date: Mon, 27 Oct 2014 18:50:28 +0100 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: References: <1414287367539-5758630.post@n5.nabble.com> <2fcp3soasy3irc.fsf@gmail.com> Message-ID: I If you want to accept String and Text and ByteString your implicitly state that you do not make any assumptions about the encoding I think the most pragmatic (and perhaps even the most appropriate) solution is to simply to expose one set of functions working on one type. If you assume UTF-8 you should not accept a ByteString since it's not encoding aware. If you did you'd have to add documentation saying "this assumes that your bytestring contains valid UTF-8". Use Text instead since it's the best unicode-aware library available. If you don't make any assumptions about encoding, pick ByteString. On Sun, Oct 26, 2014 at 8:43 PM, John Lato wrote: > This could be solved by SML-style modules, but as you mention, that's an > active area of research. Class-based solutions, such as ListLike or the > newer mono-traversable, have been available for years. > > On Sun, Oct 26, 2014 at 9:18 AM, Kyle Marek-Spartz < > kyle.marek.spartz at gmail.com> wrote: > >> This is one of the problems that an improved module language would solve >> such as the one in SML (Signatures and functors provide for this >> functionality). In Haskell-land, this is an active area of research. You >> may be interested in Backpack: >> >> http://plv.mpi-sws.org/backpack/ >> >> >> gonzaw writes: >> >> > Hi. >> > >> > I was wondering what would be the best way to create a polymorphic >> function >> > over any possible string library (Text, String, Bytestring, etc). >> > >> > For instance, imagine I have to read a file with text, transform this >> text >> > in some way and output it to another file, or to the console. >> > If I wanted to use String, I'd just do this: >> > / >> > transform :: String -> String >> > main = readFile "input.txt" >>= writeFile "output.txt" . transform >> > / >> > But if I wanted to use Text instead, I'd have to use this: >> > / >> > import qualified Data.Text.IO as T >> > >> > transform :: Text -> Text >> > main = T.readFile "input.txt" >>= T.writeFile "output.txt" . transform >> > / >> > Idem for ByteString. >> > >> > I was wondering if there was a way to create these computations in a >> generic >> > way, for any kind of string library, something like this: >> > / >> > class StringLibrary s where: >> > sReadFile :: FilePath -> IO s >> > sWriteFile :: FilePath -> s -> IO () >> > ... >> > / >> > So then I'd just have this: >> > / >> > transform :: StringLibrary s => s -> s >> > main = sReadFile "input.txt" >>= sWriteFile "output.txt" . transform >> > / >> > Now I can perform the computation I want without being tied down to a >> > specific library. At times when I create some quick scripts, I find >> myself >> > using one library (for example using String to get it finished more >> quickly, >> > since I have less experience with the other ones), but find that it's >> too >> > slow or has some problem that is solved by using one of the other >> libraries. >> > Yet swapping from one to the other is more cumbersome than expected at >> > times. >> > In the example above, I could easily swap between them, just by forcing >> the >> > compiler to typecheck to a specific one (for instance by changing the >> type >> > of "transform"). Or if I wanted to, I could leave it as it is and >> export it >> > as a library of my own. >> > >> > Is there a way to do something like this in Haskell, with existing >> > libraries? >> > In terms of using the string datatype as some sort of container of >> > characters, I think there are libraries like Lens and mono-traversable >> that >> > allow you to do stuff like this. But I'm not too familiar with them (at >> > least using them in this way). >> >> -- >> Kyle Marek-Spartz >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Mon Oct 27 18:25:09 2014 From: magnus at therning.org (Magnus Therning) Date: Mon, 27 Oct 2014 19:25:09 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) Message-ID: <20141027182509.GA12570@tatooine.lan> It seems pandoc 1.13.1 package on hackage has gotten into an insonsistent state. I just noticed this strange situation with the dependency on http-client: pandoc.cabal at [1] has if flag(https) Build-Depends: http-client >= 0.3.2 && < 0.5, http-client-tls >= 0.2 && < 0.3, http-types >= 0.8 && < 0.9 cpp-options: -DHTTP_CLIENT pandoc.cabal found in [2] has if flag(https) Build-Depends: http-client >= 0.3.2 && < 0.4, http-client-tls >= 0.2 && < 0.3, http-types >= 0.8 && < 0.9 cpp-options: -DHTTP_CLIENT How can something like this even happen? /M [1]: http://hackage.haskell.org/package/pandoc-1.13.1/pandoc.cabal [2]: http://hackage.haskell.org/package/pandoc-1.13.1/src/pandoc.cabal -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From mantkiew at gsd.uwaterloo.ca Mon Oct 27 18:30:29 2014 From: mantkiew at gsd.uwaterloo.ca (mantkiew at gsd.uwaterloo.ca) Date: Mon, 27 Oct 2014 14:30:29 -0400 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141027182509.GA12570@tatooine.lan> References: <20141027182509.GA12570@tatooine.lan> Message-ID: <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> On Hackage you can adjust bounds of dependencies without having to upload a new package version and that was done in consistently with github repo. Michal ? Original Message ? From: Magnus Therning Sent: Monday, October 27, 2014 2:25 PM To: Haskell Cafe Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) It seems pandoc 1.13.1 package on hackage has gotten into an insonsistent state. I just noticed this strange situation with the dependency on http-client: pandoc.cabal at [1] has if flag(https) Build-Depends: http-client >= 0.3.2 && < 0.5, http-client-tls >= 0.2 && < 0.3, http-types >= 0.8 && < 0.9 cpp-options: -DHTTP_CLIENT pandoc.cabal found in [2] has if flag(https) Build-Depends: http-client >= 0.3.2 && < 0.4, http-client-tls >= 0.2 && < 0.3, http-types >= 0.8 && < 0.9 cpp-options: -DHTTP_CLIENT How can something like this even happen? /M [1]: http://hackage.haskell.org/package/pandoc-1.13.1/pandoc.cabal [2]: http://hackage.haskell.org/package/pandoc-1.13.1/src/pandoc.cabal -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Any fool can write code that a computer can understand. Good programmers write code that humans can understand. -- Martin Fowler From magnus at therning.org Mon Oct 27 18:47:51 2014 From: magnus at therning.org (Magnus Therning) Date: Mon, 27 Oct 2014 19:47:51 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> Message-ID: <20141027184751.GB12570@tatooine.lan> On Mon, Oct 27, 2014 at 02:30:29PM -0400, mantkiew at gsd.uwaterloo.ca wrote: > On Hackage you can adjust bounds of dependencies without having to > upload a new package version and that was done in consistently with > github repo. I notice there already is a discussion on the danger of allowing modifications like this, in particular related to reproducibility of builds [1]. I have to say I really do hope that a solution is found where I can go back to trusting version numbers that still allows minor tweaks. The current situation is particularly irritating. Up until now it was safe to use the index to inspect Cabal files, because the Cabal file found in the index was the same as the one found in the package tar ball. Removing this relationship is a *big* change! Is there any chance of it being restored? /M [1]: https://github.com/haskell/hackage-server/issues/52 -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Most software today is very much like an Egyptian pyramid with millions of bricks piled on top of each other, with no structural integrity, but just done by brute force and thousands of slaves. -- Alan Kay -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From hesselink at gmail.com Mon Oct 27 19:24:20 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Mon, 27 Oct 2014 20:24:20 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141027182509.GA12570@tatooine.lan> References: <20141027182509.GA12570@tatooine.lan> Message-ID: This is possible because there's a feature on the new hackage to allow (partial) editing of the cabal file. See e.g. here [1]. This can be useful for relaxing or tightening version bounds. Erik [1] https://github.com/haskell/hackage-server/issues/52 On Mon, Oct 27, 2014 at 7:25 PM, Magnus Therning wrote: > It seems pandoc 1.13.1 package on hackage has gotten into an > insonsistent state. I just noticed this strange situation with the dependency > on http-client: > > pandoc.cabal at [1] has > > if flag(https) > Build-Depends: http-client >= 0.3.2 && < 0.5, > http-client-tls >= 0.2 && < 0.3, > http-types >= 0.8 && < 0.9 > cpp-options: -DHTTP_CLIENT > > pandoc.cabal found in [2] has > > if flag(https) > Build-Depends: http-client >= 0.3.2 && < 0.4, > http-client-tls >= 0.2 && < 0.3, > http-types >= 0.8 && < 0.9 > cpp-options: -DHTTP_CLIENT > > How can something like this even happen? > > /M > > [1]: http://hackage.haskell.org/package/pandoc-1.13.1/pandoc.cabal > [2]: http://hackage.haskell.org/package/pandoc-1.13.1/src/pandoc.cabal > > -- > Magnus Therning OpenPGP: 0xAB4DFBA4 > email: magnus at therning.org jabber: magnus at therning.org > twitter: magthe http://therning.org/magnus > > Any fool can write code that a computer can understand. Good programmers > write code that humans can understand. > -- Martin Fowler > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From jgm at berkeley.edu Mon Oct 27 19:30:03 2014 From: jgm at berkeley.edu (John MacFarlane) Date: Mon, 27 Oct 2014 12:30:03 -0700 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141027184751.GB12570@tatooine.lan> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> Message-ID: <20141027193003.GA2150@berkeley.edu> I must say, I did pause a bit before making this change to pandoc on Hackage, precisely because I realized that the cabal file in the package would not match the one on Hackage. But I went ahead, assuming that if the means were provided to make this kind of change, it should be okay. It is time-consuming for me to make a proper pandoc release. I need to write up release notes, rebuild the website, generate and test the binary packages on various different platforms, upload to github releases and Hackage, send announcement emails, etc. Even with automation this all takes work. I'd rather not have to do this every time a version bound changes on a dependent package, so I like this way of making minor tweaks to version bounds; I hope I can be persuaded that it's not a bad idea. John From hesselink at gmail.com Mon Oct 27 19:48:16 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Mon, 27 Oct 2014 20:48:16 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141027193003.GA2150@berkeley.edu> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> Message-ID: I was a bit hesitant about using this feature as well. We've had some confusion when we used it [1][2][3]. The Nix guys also seem to be having some trouble fitting it into their workflow [4]. But in [1] I did a quick grep to see how many packages used the feature, and there are already quite a lot. There is an 'x-revision' property added to the cabal file in the index, so in theory I guess tools could learn to deal with it. In general I think the biggest win for this feature is not even in relaxing bounds, but in tightening them when it turns out they're too loose. Previously cabal was always free to pick an old, unconstrained version and would often do so, leading to type errors during builds. Erik [1] https://github.com/silkapp/rest/issues/57 [2] https://github.com/silkapp/aeson-utils/issues/1 [3] https://github.com/silkapp/json-schema/issues/12 [4] https://github.com/NixOS/cabal2nix/issues/84 On Mon, Oct 27, 2014 at 8:30 PM, John MacFarlane wrote: > I must say, I did pause a bit before making this change to > pandoc on Hackage, precisely because I realized that the > cabal file in the package would not match the one on > Hackage. > > But I went ahead, assuming that if the means were provided > to make this kind of change, it should be okay. > > It is time-consuming for me to make a proper pandoc > release. I need to write up release notes, rebuild the > website, generate and test the binary packages on various > different platforms, upload to github releases and Hackage, > send announcement emails, etc. Even with automation this > all takes work. I'd rather not have to do this every time a > version bound changes on a dependent package, so I like this > way of making minor tweaks to version bounds; I hope I > can be persuaded that it's not a bad idea. > > John > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From magnus at therning.org Mon Oct 27 21:22:00 2014 From: magnus at therning.org (Magnus Therning) Date: Mon, 27 Oct 2014 22:22:00 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> Message-ID: <20141027212200.GA13677@tatooine.lan> On Mon, Oct 27, 2014 at 08:48:16PM +0100, Erik Hesselink wrote: > I was a bit hesitant about using this feature as well. We've had > some confusion when we used it [1][2][3]. The Nix guys also seem to > be having some trouble fitting it into their workflow [4]. But in > [1] I did a quick grep to see how many packages used the feature, > and there are already quite a lot. There is an 'x-revision' property > added to the cabal file in the index, so in theory I guess tools > could learn to deal with it. Personally I would have liked the feature more if a change to tools had been required in order to take advantage of the modified .cabal. > In general I think the biggest win for this feature is not even in > relaxing bounds, but in tightening them when it turns out they're > too loose. Previously cabal was always free to pick an old, > unconstrained version and would often do so, leading to type errors > during builds. I gather this means that cabal-install has been modified to (or maybe it always has) replace the in-tar-ball .cabal with the .cabal from the 00-index. Is that correct? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus In a hierarchy, every employee tends to rise to his level of incompetence. -- The Peter Principle -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From magnus at therning.org Mon Oct 27 21:39:12 2014 From: magnus at therning.org (Magnus Therning) Date: Mon, 27 Oct 2014 22:39:12 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141027193003.GA2150@berkeley.edu> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> Message-ID: <20141027213912.GB13677@tatooine.lan> On Mon, Oct 27, 2014 at 12:30:03PM -0700, John MacFarlane wrote: > I must say, I did pause a bit before making this change to pandoc on > Hackage, precisely because I realized that the cabal file in the > package would not match the one on Hackage. > > But I went ahead, assuming that if the means were provided to make > this kind of change, it should be okay. > > It is time-consuming for me to make a proper pandoc release. I need > to write up release notes, rebuild the website, generate and test > the binary packages on various different platforms, upload to github > releases and Hackage, send announcement emails, etc. Even with > automation this all takes work. I'd rather not have to do this > every time a version bound changes on a dependent package, so I like > this way of making minor tweaks to version bounds; I hope I can be > persuaded that it's not a bad idea. I can fully appreciate the usefulness of the feature; most of the patches I make to package Haskell packages for Archlinux is of the kind that modifies dependency restrictions. I've read through the discussion at https://github.com/haskell/hackage-server/issues/52 but I see no one arguing for making this change a bit less intrusive and more opt-in for tools, e.g. by keeping 00-index as it's always been and then putting the Hackage edits of .cabals in an overlay (an 01-index). Has this been up for proposed/discussed somewhere else? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus As long as there are ill-defined goals, bizarre bugs, and unrealistic schedules, there will be Real Programmers willing to jump in and Solve The Problem, saving the documentation for later. Long live Fortran! -- Ed Post -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From the.dead.shall.rise at gmail.com Mon Oct 27 21:43:13 2014 From: the.dead.shall.rise at gmail.com (Mikhail Glushenkov) Date: Mon, 27 Oct 2014 22:43:13 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141027212200.GA13677@tatooine.lan> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <20141027212200.GA13677@tatooine.lan> Message-ID: Hi, On 27 October 2014 22:22, Magnus Therning wrote: > I gather this means that cabal-install has been modified to (or maybe it > always has) replace the in-tar-ball .cabal with the .cabal from the > 00-index. Is that correct? Yes, 'cabal get' (formerly known as 'unpack') now does this. From serg.foo at gmail.com Mon Oct 27 22:09:09 2014 From: serg.foo at gmail.com (Sergey Vinokurov) Date: Tue, 28 Oct 2014 00:09:09 +0200 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: References: <1414287367539-5758630.post@n5.nabble.com> <2fcp3soasy3irc.fsf@gmail.com> Message-ID: Hi Gonzaw, Among other alternatives you could try using http://hackage.haskell.org/package/ListLike package. It provides similar interface to strings and text, but all functions operate on a typeclass so they may be used with either Text or Strings. E.g. import Data.Char import Data.Text (Text) import qualified Data.Text as T import Data.ListLike (ListLike, ListLikeIO) import qualified Data.ListLike as LL transform :: String -> String transform = map toUpper transform' :: Text -> Text transform' = T.map toUpper onFile :: (ListLikeIO s c) => FilePath -> FilePath -> (s -> s) -> IO () onFile fileIn fileOut f = LL.readFile fileIn >>= LL.writeFile fileOut . f main :: IO () main = do writeFile "foo" "hello world\n" onFile "foo" "bar" transform onFile "foo" "bar" transform' On Mon, Oct 27, 2014 at 7:50 PM, Adam Bergmark wrote: > > I > If you want to accept String and Text and ByteString your implicitly state > that you do not make any assumptions about the encoding > > I think the most pragmatic (and perhaps even the most appropriate) solution > is to simply to expose one set of functions working on one type. > > If you assume UTF-8 you should not accept a ByteString since it's not > encoding aware. If you did you'd have to add documentation saying "this > assumes that your bytestring contains valid UTF-8". Use Text instead since > it's the best unicode-aware library available. > If you don't make any assumptions about encoding, pick ByteString. > > > > On Sun, Oct 26, 2014 at 8:43 PM, John Lato wrote: >> >> This could be solved by SML-style modules, but as you mention, that's an >> active area of research. Class-based solutions, such as ListLike or the >> newer mono-traversable, have been available for years. >> >> On Sun, Oct 26, 2014 at 9:18 AM, Kyle Marek-Spartz >> wrote: >>> >>> This is one of the problems that an improved module language would solve >>> such as the one in SML (Signatures and functors provide for this >>> functionality). In Haskell-land, this is an active area of research. You >>> may be interested in Backpack: >>> >>> http://plv.mpi-sws.org/backpack/ >>> >>> >>> gonzaw writes: >>> >>> > Hi. >>> > >>> > I was wondering what would be the best way to create a polymorphic >>> > function >>> > over any possible string library (Text, String, Bytestring, etc). >>> > >>> > For instance, imagine I have to read a file with text, transform this >>> > text >>> > in some way and output it to another file, or to the console. >>> > If I wanted to use String, I'd just do this: >>> > / >>> > transform :: String -> String >>> > main = readFile "input.txt" >>= writeFile "output.txt" . transform >>> > / >>> > But if I wanted to use Text instead, I'd have to use this: >>> > / >>> > import qualified Data.Text.IO as T >>> > >>> > transform :: Text -> Text >>> > main = T.readFile "input.txt" >>= T.writeFile "output.txt" . transform >>> > / >>> > Idem for ByteString. >>> > >>> > I was wondering if there was a way to create these computations in a >>> > generic >>> > way, for any kind of string library, something like this: >>> > / >>> > class StringLibrary s where: >>> > sReadFile :: FilePath -> IO s >>> > sWriteFile :: FilePath -> s -> IO () >>> > ... >>> > / >>> > So then I'd just have this: >>> > / >>> > transform :: StringLibrary s => s -> s >>> > main = sReadFile "input.txt" >>= sWriteFile "output.txt" . transform >>> > / >>> > Now I can perform the computation I want without being tied down to a >>> > specific library. At times when I create some quick scripts, I find >>> > myself >>> > using one library (for example using String to get it finished more >>> > quickly, >>> > since I have less experience with the other ones), but find that it's >>> > too >>> > slow or has some problem that is solved by using one of the other >>> > libraries. >>> > Yet swapping from one to the other is more cumbersome than expected at >>> > times. >>> > In the example above, I could easily swap between them, just by forcing >>> > the >>> > compiler to typecheck to a specific one (for instance by changing the >>> > type >>> > of "transform"). Or if I wanted to, I could leave it as it is and >>> > export it >>> > as a library of my own. >>> > >>> > Is there a way to do something like this in Haskell, with existing >>> > libraries? >>> > In terms of using the string datatype as some sort of container of >>> > characters, I think there are libraries like Lens and mono-traversable >>> > that >>> > allow you to do stuff like this. But I'm not too familiar with them (at >>> > least using them in this way). >>> >>> -- >>> Kyle Marek-Spartz >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From k-bx at k-bx.com Mon Oct 27 22:22:51 2014 From: k-bx at k-bx.com (Konstantine Rybnikov) Date: Tue, 28 Oct 2014 00:22:51 +0200 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: <1414287367539-5758630.post@n5.nabble.com> References: <1414287367539-5758630.post@n5.nabble.com> Message-ID: I use small string-class library http://hackage.haskell.org/package/string-class You have type classes for generic things (I don't use them in practice much, to be honest, so please check them out by yourself), and also you have easy toText/toString/fromText/fromString etc. functions, which are quite handy. On Sun, Oct 26, 2014 at 3:36 AM, gonzaw wrote: > Hi. > > I was wondering what would be the best way to create a polymorphic function > over any possible string library (Text, String, Bytestring, etc). > > For instance, imagine I have to read a file with text, transform this text > in some way and output it to another file, or to the console. > If I wanted to use String, I'd just do this: > / > transform :: String -> String > main = readFile "input.txt" >>= writeFile "output.txt" . transform > / > But if I wanted to use Text instead, I'd have to use this: > / > import qualified Data.Text.IO as T > > transform :: Text -> Text > main = T.readFile "input.txt" >>= T.writeFile "output.txt" . transform > / > Idem for ByteString. > > I was wondering if there was a way to create these computations in a > generic > way, for any kind of string library, something like this: > / > class StringLibrary s where: > sReadFile :: FilePath -> IO s > sWriteFile :: FilePath -> s -> IO () > ... > / > So then I'd just have this: > / > transform :: StringLibrary s => s -> s > main = sReadFile "input.txt" >>= sWriteFile "output.txt" . transform > / > Now I can perform the computation I want without being tied down to a > specific library. At times when I create some quick scripts, I find myself > using one library (for example using String to get it finished more > quickly, > since I have less experience with the other ones), but find that it's too > slow or has some problem that is solved by using one of the other > libraries. > Yet swapping from one to the other is more cumbersome than expected at > times. > In the example above, I could easily swap between them, just by forcing the > compiler to typecheck to a specific one (for instance by changing the type > of "transform"). Or if I wanted to, I could leave it as it is and export it > as a library of my own. > > Is there a way to do something like this in Haskell, with existing > libraries? > In terms of using the string datatype as some sort of container of > characters, I think there are libraries like Lens and mono-traversable that > allow you to do stuff like this. But I'm not too familiar with them (at > least using them in this way). > > > > > -- > View this message in context: > http://haskell.1045720.n5.nabble.com/Polymorphic-functions-over-string-libraries-tp5758630.html > Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gonzaw308 at gmail.com Mon Oct 27 23:05:43 2014 From: gonzaw308 at gmail.com (gonzaw) Date: Mon, 27 Oct 2014 16:05:43 -0700 (PDT) Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: References: <1414287367539-5758630.post@n5.nabble.com> <2fcp3soasy3irc.fsf@gmail.com> Message-ID: <1414451143996-5758747.post@n5.nabble.com> Yes, I don't explicitly want to make any assumptions about encoding. I want to make it general enough, so that if I encounter a situation where I DO have to make assumptions about the encoding, I can easily use Text (instead of whatever I was using before). If I have to start making assumptions about other things, then I could easily change it to other string libraries. Thanks for the responses, I think switching to classy-prelude might be the easiest one (it also forces good practices). How do those other libraries compose with Prelude, and other modules from base? For instance, does ListLike compose well with Data.Foldable? Same with mono-traversable. Does MonoFunctor compose well with Functor? Is there an easy "glue" code to, for instance, pass any Functor to a function that expects a MonoFunctor and make it work? Idem with other typeclasses. Basically, I think all of these seem great, but I'm concerned about getting "stuck" with them alone, and not being able to use all the other countless great libraries with them because of compatibility issues. -- View this message in context: http://haskell.1045720.n5.nabble.com/Polymorphic-functions-over-string-libraries-tp5758630p5758747.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. From jwlato at gmail.com Tue Oct 28 00:16:12 2014 From: jwlato at gmail.com (John Lato) Date: Tue, 28 Oct 2014 08:16:12 +0800 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: <1414451143996-5758747.post@n5.nabble.com> References: <1414287367539-5758630.post@n5.nabble.com> <2fcp3soasy3irc.fsf@gmail.com> <1414451143996-5758747.post@n5.nabble.com> Message-ID: ListLike and mono-traversable both provide their own versions of Functor and Foldable (I don't think ListLike has Traversable, exactly, but it could). The problem is that data structures like ByteString and Text simply don't admit instances of these classes. In fact, that's exactly what mono-traversable is: a monomorphic variant of Traversable (and hence the others as well). It's entirely possible to write something like > someFunction :: (ListLike (f el) el, Foldable f) => f el -> a and it may even be sensible, but it means you can't use e.g. Text as an argument to someFunction. I don't believe mono-traversable provides > instance Functor f => MonoFunctor (f a) that instance is problematic because it overlaps with many other instances one could wish to write. However, there are instances for pretty much every type in base that makes sense, so you can pass any particular Functor to code that expects a MonoFunctor and it would work. If you're concerned about getting stuck with a particular library, classy-prelude seems like exactly the wrong choice, as it makes a lot of this implicit rather than explicit, which means it would be harder to migrate away from if you choose to do so later. Besides, it uses mono-traversable under the hood anyway. John L. On Tue, Oct 28, 2014 at 7:05 AM, gonzaw wrote: > Yes, I don't explicitly want to make any assumptions about encoding. I want > to make it general enough, so that if I encounter a situation where I DO > have to make assumptions about the encoding, I can easily use Text (instead > of whatever I was using before). If I have to start making assumptions > about > other things, then I could easily change it to other string libraries. > > Thanks for the responses, I think switching to classy-prelude might be the > easiest one (it also forces good practices). > > How do those other libraries compose with Prelude, and other modules from > base? For instance, does ListLike compose well with Data.Foldable? > Same with mono-traversable. Does MonoFunctor compose well with Functor? Is > there an easy "glue" code to, for instance, pass any Functor to a function > that expects a MonoFunctor and make it work? Idem with other typeclasses. > > Basically, I think all of these seem great, but I'm concerned about getting > "stuck" with them alone, and not being able to use all the other countless > great libraries with them because of compatibility issues. > > > > -- > View this message in context: > http://haskell.1045720.n5.nabble.com/Polymorphic-functions-over-string-libraries-tp5758630p5758747.html > Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuuzetsu at fuuzetsu.co.uk Tue Oct 28 00:38:51 2014 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Tue, 28 Oct 2014 00:38:51 +0000 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> Message-ID: <544EE59B.5010208@fuuzetsu.co.uk> On 10/27/2014 07:48 PM, Erik Hesselink wrote: > I was a bit hesitant about using this feature as well. We've had some > confusion when we used it [1][2][3]. The Nix guys also seem to be > having some trouble fitting it into their workflow [4]. But in [1] I > did a quick grep to see how many packages used the feature, and there > are already quite a lot. There is an 'x-revision' property added to > the cabal file in the index, so in theory I guess tools could learn to > deal with it. > > In general I think the biggest win for this feature is not even in > relaxing bounds, but in tightening them when it turns out they're too > loose. Previously cabal was always free to pick an old, unconstrained > version and would often do so, leading to type errors during builds. > > Erik > > [1] https://github.com/silkapp/rest/issues/57 > [2] https://github.com/silkapp/aeson-utils/issues/1 > [3] https://github.com/silkapp/json-schema/issues/12 > [4] https://github.com/NixOS/cabal2nix/issues/84 > > On Mon, Oct 27, 2014 at 8:30 PM, John MacFarlane wrote: >> I must say, I did pause a bit before making this change to >> pandoc on Hackage, precisely because I realized that the >> cabal file in the package would not match the one on >> Hackage. >> >> But I went ahead, assuming that if the means were provided >> to make this kind of change, it should be okay. >> >> It is time-consuming for me to make a proper pandoc >> release. I need to write up release notes, rebuild the >> website, generate and test the binary packages on various >> different platforms, upload to github releases and Hackage, >> send announcement emails, etc. Even with automation this >> all takes work. I'd rather not have to do this every time a >> version bound changes on a dependent package, so I like this >> way of making minor tweaks to version bounds; I hope I >> can be persuaded that it's not a bad idea. >> >> John >> TL;DR version of below: I think Hackage should generate a new package version for each info change rather than the change being ?silent? making it pretty exclusive to tools which don't care about what they actually build and what hash it has (cabal). This brings us back to ?all version are explicit? from the ?we have versions but there are some updates you need to pull in your tools too?. Long version: As Erik points out at his [4], this really messes things up for us in the nix world, and really anywhere that 1. Wants to grab from Hackage 2. Wants a reproducible build The common justification for this is that it doesn't change the tarball hash. Well then, this ?update info after upload? feature then automatically excludes every single system which uses this tarball. Why? 1. Maintainer uploads a package 2. Distros package it and note down the hash 3. Something happens and maintainer bumps the bounds on Hackage only 4. Distros still grab the very same package as they did before (tarball doesn't change, remember?). Inside is the cabal file with old dependencies, so the build fails if the distro updated other packages (almost certainly). So even though the hash doesn't change, builds suddenly start failing. If you're using cabal, you don't get a reproducible build at all because which versions it picks depends on whatever info is on Hackage at build time (well, last cabal update time) and not what's in the tarball. It is currently perfectly possible for two separate users to have ?cabal update? and know about exactly the same package versions available but end up with different version numbers used because one ?cabal update?d before the info on Hackage was changed and the other did not. But John is right that sometimes making releases is tiresome. For version bumps it can be as easy as checking out the last tag, bumping deps and uploading, but it can be much more involved too. I admit that I used this myself, although only for the stuff that hope to release properly soon and I happen to maintain on NixOS too which AFAICT is the only distro which packages Haskell fast enough to notice breakage within few days (in huge part thanks to Peter Simons ;) ) So clearly there is a problem here: only cabal users use the information from Hackage info bumps. Everyone else who looks into the tarball just fails to build. cabal users who happen to cabal update at unfortunate time also fail to build. I can only think of one ?solution? which fixes this and doesn't require considerable effort and co-ordination between maintainers and packagers. Here is how situation currently looks like 1. I upload awesomepackage (ap) to Hackage under ap-1.0.0.0 2. Time passes, I have commits on top 3. One of those packager type of folk who like to demand things come onto my issue tracker and say I should update my dependencies but I don't want to release right now 4. I go onto Hackage and use that new cool feature, changing the cabal file on ap-1.0.0.0. 5. Packager is unhappy because the problem is not fixed, ap-1.0.0.0 gives them the same thing. The only thing they can do is monkeypatch deps on their side. Instead, I think at steps 4 and 5 the following should happen: 4. I make changes to ap-1.0.0.0, Hackage generates ap-1.0.0.0-fix1 package with identical content but new info without any extra effort on my side. 5. Packager simply now points to ap-1.0.0.0-fix1 which has the new hash and builds great again. cabal does The Right Thing? here and resolves ap-1.0.0.0 to ap-1.0.0.0-fix1 so everything keeps working there as it does now. It does seem a bit wasteful space-wise but with clever programming on Hackage side that could probably be avoided. There is no longer a problem with these ?hidden? changes happening. Everyone can point at the *exact* version they want used like they do now and they get what exactly what they asked for. A less wasteful way would be for the packaging distros to update their tools to look at the Hackage-only cabal files as well. Personally I think that seems like the wrong place to solve this though. Lastly, Hackage should announce with big fat red letters on the front page of the package that the source tarball contains different info than what's shown on Hackage. It's really not possible to tell as a user at the moment unless we specifically look for it. Sorry for the long-winded message, hopefully you heeded the TL;DR at the top and skipped this. -- Mateusz K. From karl at karlv.net Tue Oct 28 06:46:47 2014 From: karl at karlv.net (Karl Voelker) Date: Mon, 27 Oct 2014 23:46:47 -0700 Subject: [Haskell-cafe] Tracking down where an instance comes from In-Reply-To: <544C6728.8010105@fuuzetsu.co.uk> References: <544C6728.8010105@fuuzetsu.co.uk> Message-ID: <1414478807.905864.184089421.0466F501@webmail.messagingengine.com> On Sat, Oct 25, 2014, at 08:14 PM, Mateusz Kowalczyk wrote: > instance [safe] Show (a -> b) -- Defined in ?Text.Show.Functions? An easy start may be a Google search for "import Text.Show.Functions". If you are lucky, you will spot a dependency of Yi in the results. -Karl From haskell at ibotty.net Tue Oct 28 10:58:23 2014 From: haskell at ibotty.net (Tobias Florek) Date: Tue, 28 Oct 2014 11:58:23 +0100 Subject: [Haskell-cafe] Tracking down where an instance comes from In-Reply-To: <544C6728.8010105@fuuzetsu.co.uk> References: <544C6728.8010105@fuuzetsu.co.uk> Message-ID: <20141028105823.21804.9537@x201.Speedport_W723_V_Typ_A_1_01_009> Hi, > instance [safe] Show (a -> b) -- Defined in ?Text.Show.Functions? > > What would be the best way to track down through which import this > actually comes in? I might be late and you already found it, but my strong guess is that it's regex-tdfa. Cheers, tobias florek From rudy at matela.com.br Tue Oct 28 11:09:47 2014 From: rudy at matela.com.br (Rudy Matela) Date: Tue, 28 Oct 2014 11:09:47 +0000 Subject: [Haskell-cafe] Tracking down where an instance comes from In-Reply-To: <20141028105823.21804.9537@x201.Speedport_W723_V_Typ_A_1_01_009> References: <544C6728.8010105@fuuzetsu.co.uk> <20141028105823.21804.9537@x201.Speedport_W723_V_Typ_A_1_01_009> Message-ID: <20141028110947.GA8607@zero.york.ac.uk> I can support the guess. A similar problem was found in Tasty a while ago: https://github.com/feuerbach/tasty/issues/71 In the case of Tasty, the problem was solved by using regex-tdfa-rc instead of regex-tdfa. On Tue, Oct 28, 2014 at 11:58:23AM +0100, Tobias Florek wrote: > Hi, > > > instance [safe] Show (a -> b) -- Defined in ?Text.Show.Functions? > > > > What would be the best way to track down through which import this > > actually comes in? > > I might be late and you already found it, but my strong guess is that > it's regex-tdfa. > > Cheers, > tobias florek > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From andreas.abel at ifi.lmu.de Tue Oct 28 12:17:29 2014 From: andreas.abel at ifi.lmu.de (Andreas Abel) Date: Tue, 28 Oct 2014 13:17:29 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <544EE59B.5010208@fuuzetsu.co.uk> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> Message-ID: <544F8959.1050102@ifi.lmu.de> On 28.10.2014 01:38, Mateusz Kowalczyk wrote: > 4. I make changes to ap-1.0.0.0, Hackage generates ap-1.0.0.0-fix1 > package with identical content but new info without any extra effort on > my side. Basically you suggest that there should be a last digit in the version number that is only used for dependency fixes and is handled automatically by cabal and hackage. We could as well say that Hackage generates ap-1.0.0.0.1 ap-1.0.0.0.2 -- for the next dependency fix but you cannot specify the 5th digit in cabal commands, so when you say cabal install ap-1.0.0.0 you get the latest, i.e. ap-1.0.0.0.2. --Andreas On 28.10.2014 01:38, Mateusz Kowalczyk wrote: > On 10/27/2014 07:48 PM, Erik Hesselink wrote: >> I was a bit hesitant about using this feature as well. We've had some >> confusion when we used it [1][2][3]. The Nix guys also seem to be >> having some trouble fitting it into their workflow [4]. But in [1] I >> did a quick grep to see how many packages used the feature, and there >> are already quite a lot. There is an 'x-revision' property added to >> the cabal file in the index, so in theory I guess tools could learn to >> deal with it. >> >> In general I think the biggest win for this feature is not even in >> relaxing bounds, but in tightening them when it turns out they're too >> loose. Previously cabal was always free to pick an old, unconstrained >> version and would often do so, leading to type errors during builds. >> >> Erik >> >> [1] https://github.com/silkapp/rest/issues/57 >> [2] https://github.com/silkapp/aeson-utils/issues/1 >> [3] https://github.com/silkapp/json-schema/issues/12 >> [4] https://github.com/NixOS/cabal2nix/issues/84 >> >> On Mon, Oct 27, 2014 at 8:30 PM, John MacFarlane wrote: >>> I must say, I did pause a bit before making this change to >>> pandoc on Hackage, precisely because I realized that the >>> cabal file in the package would not match the one on >>> Hackage. >>> >>> But I went ahead, assuming that if the means were provided >>> to make this kind of change, it should be okay. >>> >>> It is time-consuming for me to make a proper pandoc >>> release. I need to write up release notes, rebuild the >>> website, generate and test the binary packages on various >>> different platforms, upload to github releases and Hackage, >>> send announcement emails, etc. Even with automation this >>> all takes work. I'd rather not have to do this every time a >>> version bound changes on a dependent package, so I like this >>> way of making minor tweaks to version bounds; I hope I >>> can be persuaded that it's not a bad idea. >>> >>> John >>> > > TL;DR version of below: I think Hackage should generate a new package > version for each info change rather than the change being ?silent? > making it pretty exclusive to tools which don't care about what they > actually build and what hash it has (cabal). This brings us back to ?all > version are explicit? from the ?we have versions but there are some > updates you need to pull in your tools too?. > > Long version: > > As Erik points out at his [4], this really messes things up for us in > the nix world, and really anywhere that > > 1. Wants to grab from Hackage > 2. Wants a reproducible build > > The common justification for this is that it doesn't change the tarball > hash. Well then, this ?update info after upload? feature then > automatically excludes every single system which uses this tarball. Why? > > 1. Maintainer uploads a package > 2. Distros package it and note down the hash > 3. Something happens and maintainer bumps the bounds on Hackage only > 4. Distros still grab the very same package as they did before (tarball > doesn't change, remember?). Inside is the cabal file with old > dependencies, so the build fails if the distro updated other packages > (almost certainly). > > So even though the hash doesn't change, builds suddenly start failing. > If you're using cabal, you don't get a reproducible build at all because > which versions it picks depends on whatever info is on Hackage at build > time (well, last cabal update time) and not what's in the tarball. It is > currently perfectly possible for two separate users to have ?cabal > update? and know about exactly the same package versions available but > end up with different version numbers used because one ?cabal update?d > before the info on Hackage was changed and the other did not. > > But John is right that sometimes making releases is tiresome. For > version bumps it can be as easy as checking out the last tag, bumping > deps and uploading, but it can be much more involved too. I admit that I > used this myself, although only for the stuff that hope to release > properly soon and I happen to maintain on NixOS too which AFAICT is the > only distro which packages Haskell fast enough to notice breakage within > few days (in huge part thanks to Peter Simons ;) ) > > So clearly there is a problem here: only cabal users use the information > from Hackage info bumps. Everyone else who looks into the tarball just > fails to build. cabal users who happen to cabal update at unfortunate > time also fail to build. > > I can only think of one ?solution? which fixes this and doesn't require > considerable effort and co-ordination between maintainers and packagers. > Here is how situation currently looks like > > 1. I upload awesomepackage (ap) to Hackage under ap-1.0.0.0 > 2. Time passes, I have commits on top > 3. One of those packager type of folk who like to demand things come > onto my issue tracker and say I should update my dependencies but I > don't want to release right now > 4. I go onto Hackage and use that new cool feature, changing the cabal > file on ap-1.0.0.0. > 5. Packager is unhappy because the problem is not fixed, ap-1.0.0.0 > gives them the same thing. The only thing they can do is monkeypatch > deps on their side. > > Instead, I think at steps 4 and 5 the following should happen: > > 4. I make changes to ap-1.0.0.0, Hackage generates ap-1.0.0.0-fix1 > package with identical content but new info without any extra effort on > my side. > 5. Packager simply now points to ap-1.0.0.0-fix1 which has the new hash > and builds great again. cabal does The Right Thing? here and resolves > ap-1.0.0.0 to ap-1.0.0.0-fix1 so everything keeps working there as it > does now. > > It does seem a bit wasteful space-wise but with clever programming on > Hackage side that could probably be avoided. There is no longer a > problem with these ?hidden? changes happening. Everyone can point at the > *exact* version they want used like they do now and they get what > exactly what they asked for. A less wasteful way would be for the > packaging distros to update their tools to look at the Hackage-only > cabal files as well. Personally I think that seems like the wrong place > to solve this though. > > Lastly, Hackage should announce with big fat red letters on the front > page of the package that the source tarball contains different info than > what's shown on Hackage. It's really not possible to tell as a user at > the moment unless we specifically look for it. > > Sorry for the long-winded message, hopefully you heeded the TL;DR at the > top and skipped this. > -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www2.tcs.ifi.lmu.de/~abel/ From hans at hanshoglund.se Tue Oct 28 14:40:50 2014 From: hans at hanshoglund.se (=?iso-8859-1?Q?Hans_H=F6glund?=) Date: Tue, 28 Oct 2014 14:40:50 +0000 Subject: [Haskell-cafe] Polymorphic case for this lens transformer? Message-ID: <13A4DF66-B07F-4982-BD49-65DC368C6C79@hanshoglund.se> Hi all, I have been using this lens transformer http://lpaste.net/113159. However, I can't seem to find a way to implement the polymorphic case (i.e. Lens instead of Lens'). What am I missing? Hans - Hans H?glund Composer, conductor and developer hans [at] hanshoglund.se hanshoglund.com https://twitter.com/hanshogl https://soundcloud.com/hanshoglund http://github.com/hanshoglund -------------- next part -------------- An HTML attachment was scrubbed... URL: From fe.kunzmann at gmail.com Tue Oct 28 20:01:48 2014 From: fe.kunzmann at gmail.com (Felix Kunzmann) Date: Tue, 28 Oct 2014 21:01:48 +0100 Subject: [Haskell-cafe] Polymorphic case for this lens transformer? In-Reply-To: <13A4DF66-B07F-4982-BD49-65DC368C6C79@hanshoglund.se> References: <13A4DF66-B07F-4982-BD49-65DC368C6C79@hanshoglund.se> Message-ID: Hi Hans, I think this code should work: {-# LANGUAGE RankNTypes #-}{-# LANGUAGE TupleSections #-} import Control.Applicativeimport Control.Lens dependingOn :: Lens s t (x,a) (x,b) -> (x -> Lens a b c d) -> Lens s t c ddependingOn l depending f = l (\ (x,a) -> (x,) <$> depending x f a) The trick here is that Lens s t a b is just an type synonym for Functor f => (a -> f b) -> s -> f t. I think it should also be a speed improvement on more complex lenses, only going over the structure once whereas the use of lens would examine the structure twice (first to get and then to set the value). I hope this helps. Felix ? 2014-10-28 15:40 GMT+01:00 Hans H?glund : > Hi all, I have been using this lens transformer http://lpaste.net/113159. > > However, I can't seem to find a way to implement the polymorphic case > (i.e. Lens instead of Lens'). What am I missing? > > Hans > > - > > Hans H?glund > *Composer, conductor and developer* > > hans [at] hanshoglund.se > hanshoglund.com > https://twitter.com/hanshogl > https://soundcloud.com/hanshoglund > http://github.com/hanshoglund > > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Oct 28 21:22:26 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 28 Oct 2014 17:22:26 -0400 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <544F8959.1050102@ifi.lmu.de> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> Message-ID: per se, thats what hackage DOES now. Though it is valid to want some sort of +patchlevel suffix to be visible for distro engineering purposes or such. Speaking as a hackage trustee, this .cabal editing facility has been a VERY VERY good thing overall. A lot of problems have been prevented because of it, and that its creating new problems that haven't existed before should be considered a testament to its success! ;) On Tue, Oct 28, 2014 at 8:17 AM, Andreas Abel wrote: > On 28.10.2014 01:38, Mateusz Kowalczyk wrote: > > 4. I make changes to ap-1.0.0.0, Hackage generates ap-1.0.0.0-fix1 > > package with identical content but new info without any extra effort on > > my side. > > Basically you suggest that there should be a last digit in the version > number that is only used for dependency fixes and is handled automatically > by cabal and hackage. We could as well say that Hackage generates > > ap-1.0.0.0.1 > ap-1.0.0.0.2 -- for the next dependency fix > > but you cannot specify the 5th digit in cabal commands, so when you say > > cabal install ap-1.0.0.0 > > you get the latest, i.e. ap-1.0.0.0.2. > > --Andreas > > > On 28.10.2014 01:38, Mateusz Kowalczyk wrote: > >> On 10/27/2014 07:48 PM, Erik Hesselink wrote: >> >>> I was a bit hesitant about using this feature as well. We've had some >>> confusion when we used it [1][2][3]. The Nix guys also seem to be >>> having some trouble fitting it into their workflow [4]. But in [1] I >>> did a quick grep to see how many packages used the feature, and there >>> are already quite a lot. There is an 'x-revision' property added to >>> the cabal file in the index, so in theory I guess tools could learn to >>> deal with it. >>> >>> In general I think the biggest win for this feature is not even in >>> relaxing bounds, but in tightening them when it turns out they're too >>> loose. Previously cabal was always free to pick an old, unconstrained >>> version and would often do so, leading to type errors during builds. >>> >>> Erik >>> >>> [1] https://github.com/silkapp/rest/issues/57 >>> [2] https://github.com/silkapp/aeson-utils/issues/1 >>> [3] https://github.com/silkapp/json-schema/issues/12 >>> [4] https://github.com/NixOS/cabal2nix/issues/84 >>> >>> On Mon, Oct 27, 2014 at 8:30 PM, John MacFarlane >>> wrote: >>> >>>> I must say, I did pause a bit before making this change to >>>> pandoc on Hackage, precisely because I realized that the >>>> cabal file in the package would not match the one on >>>> Hackage. >>>> >>>> But I went ahead, assuming that if the means were provided >>>> to make this kind of change, it should be okay. >>>> >>>> It is time-consuming for me to make a proper pandoc >>>> release. I need to write up release notes, rebuild the >>>> website, generate and test the binary packages on various >>>> different platforms, upload to github releases and Hackage, >>>> send announcement emails, etc. Even with automation this >>>> all takes work. I'd rather not have to do this every time a >>>> version bound changes on a dependent package, so I like this >>>> way of making minor tweaks to version bounds; I hope I >>>> can be persuaded that it's not a bad idea. >>>> >>>> John >>>> >>>> >> TL;DR version of below: I think Hackage should generate a new package >> version for each info change rather than the change being ?silent? >> making it pretty exclusive to tools which don't care about what they >> actually build and what hash it has (cabal). This brings us back to ?all >> version are explicit? from the ?we have versions but there are some >> updates you need to pull in your tools too?. >> >> Long version: >> >> As Erik points out at his [4], this really messes things up for us in >> the nix world, and really anywhere that >> >> 1. Wants to grab from Hackage >> 2. Wants a reproducible build >> >> The common justification for this is that it doesn't change the tarball >> hash. Well then, this ?update info after upload? feature then >> automatically excludes every single system which uses this tarball. Why? >> >> 1. Maintainer uploads a package >> 2. Distros package it and note down the hash >> 3. Something happens and maintainer bumps the bounds on Hackage only >> 4. Distros still grab the very same package as they did before (tarball >> doesn't change, remember?). Inside is the cabal file with old >> dependencies, so the build fails if the distro updated other packages >> (almost certainly). >> >> So even though the hash doesn't change, builds suddenly start failing. >> If you're using cabal, you don't get a reproducible build at all because >> which versions it picks depends on whatever info is on Hackage at build >> time (well, last cabal update time) and not what's in the tarball. It is >> currently perfectly possible for two separate users to have ?cabal >> update? and know about exactly the same package versions available but >> end up with different version numbers used because one ?cabal update?d >> before the info on Hackage was changed and the other did not. >> >> But John is right that sometimes making releases is tiresome. For >> version bumps it can be as easy as checking out the last tag, bumping >> deps and uploading, but it can be much more involved too. I admit that I >> used this myself, although only for the stuff that hope to release >> properly soon and I happen to maintain on NixOS too which AFAICT is the >> only distro which packages Haskell fast enough to notice breakage within >> few days (in huge part thanks to Peter Simons ;) ) >> >> So clearly there is a problem here: only cabal users use the information >> from Hackage info bumps. Everyone else who looks into the tarball just >> fails to build. cabal users who happen to cabal update at unfortunate >> time also fail to build. >> >> I can only think of one ?solution? which fixes this and doesn't require >> considerable effort and co-ordination between maintainers and packagers. >> Here is how situation currently looks like >> >> 1. I upload awesomepackage (ap) to Hackage under ap-1.0.0.0 >> 2. Time passes, I have commits on top >> 3. One of those packager type of folk who like to demand things come >> onto my issue tracker and say I should update my dependencies but I >> don't want to release right now >> 4. I go onto Hackage and use that new cool feature, changing the cabal >> file on ap-1.0.0.0. >> 5. Packager is unhappy because the problem is not fixed, ap-1.0.0.0 >> gives them the same thing. The only thing they can do is monkeypatch >> deps on their side. >> >> Instead, I think at steps 4 and 5 the following should happen: >> >> 4. I make changes to ap-1.0.0.0, Hackage generates ap-1.0.0.0-fix1 >> package with identical content but new info without any extra effort on >> my side. >> 5. Packager simply now points to ap-1.0.0.0-fix1 which has the new hash >> and builds great again. cabal does The Right Thing? here and resolves >> ap-1.0.0.0 to ap-1.0.0.0-fix1 so everything keeps working there as it >> does now. >> >> It does seem a bit wasteful space-wise but with clever programming on >> Hackage side that could probably be avoided. There is no longer a >> problem with these ?hidden? changes happening. Everyone can point at the >> *exact* version they want used like they do now and they get what >> exactly what they asked for. A less wasteful way would be for the >> packaging distros to update their tools to look at the Hackage-only >> cabal files as well. Personally I think that seems like the wrong place >> to solve this though. >> >> Lastly, Hackage should announce with big fat red letters on the front >> page of the package that the source tarball contains different info than >> what's shown on Hackage. It's really not possible to tell as a user at >> the moment unless we specifically look for it. >> >> Sorry for the long-winded message, hopefully you heeded the TL;DR at the >> top and skipped this. >> >> > > -- > Andreas Abel <>< Du bist der geliebte Mensch. > > Department of Computer Science and Engineering > Chalmers and Gothenburg University, Sweden > > andreas.abel at gu.se > http://www2.tcs.ifi.lmu.de/~abel/ > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Wed Oct 29 07:40:42 2014 From: magnus at therning.org (Magnus Therning) Date: Wed, 29 Oct 2014 08:40:42 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> Message-ID: <20141029074042.GA25375@mtcomp.evidente.local> On Tue, Oct 28, 2014 at 05:22:26PM -0400, Carter Schonwald wrote: > per se, thats what hackage DOES now. Though it is valid to want some > sort of +patchlevel suffix to be visible for distro engineering > purposes or such. > > Speaking as a hackage trustee, this .cabal editing facility has been > a VERY VERY good thing overall. A lot of problems have been > prevented because of it, and that its creating new problems that > haven't existed before should be considered a testament to its > success! ;) If you define success as "swapping one set of problems for another", then we have very different definitions of success ;) Seriously though, I don't doubt that the feature has value *for some users* it's just a bit unfortunate that it was implemented in a way that detracts value for other users. Especially when I suspect there is a very easy way to implement it that wouldn't have impacted those other users at all. I'm not a cabal-install user, so I'm curious to hear how this change works with cabal-install 1.18.0.5, which is what we package in ArchHaskell. Any problems with that? If so, will support for this feature be backported? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Goto labels should be left-aligned in all caps and should include the programmer's name, home phone number, and credit card number. -- Abdul Nizar -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From the.dead.shall.rise at gmail.com Wed Oct 29 08:09:25 2014 From: the.dead.shall.rise at gmail.com (Mikhail Glushenkov) Date: Wed, 29 Oct 2014 09:09:25 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141029074042.GA25375@mtcomp.evidente.local> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <20141029074042.GA25375@mtcomp.evidente.local> Message-ID: Hi, On 29 October 2014 08:40, Magnus Therning wrote: > I'm not a cabal-install user, so I'm curious to hear how this change > works with cabal-install 1.18.0.5, which is what we package in > ArchHaskell. Any problems with that? If so, will support for this > feature be backported? This feature was added two years ago, in the 1.16 release [1]. [1] https://github.com/haskell/cabal/commit/22d3772222ebb5dd49d60882845915999ebc97e2 From magnus at therning.org Wed Oct 29 08:38:05 2014 From: magnus at therning.org (Magnus Therning) Date: Wed, 29 Oct 2014 09:38:05 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <20141029074042.GA25375@mtcomp.evidente.local> Message-ID: <20141029083805.GB25375@mtcomp.evidente.local> On Wed, Oct 29, 2014 at 09:09:25AM +0100, Mikhail Glushenkov wrote: > Hi, > > On 29 October 2014 08:40, Magnus Therning wrote: > > I'm not a cabal-install user, so I'm curious to hear how this change > > works with cabal-install 1.18.0.5, which is what we package in > > ArchHaskell. Any problems with that? If so, will support for this > > feature be backported? > > This feature was added two years ago, in the 1.16 release [1]. > > [1] https://github.com/haskell/cabal/commit/22d3772222ebb5dd49d60882845915999ebc97e2 Excellent, then that's one less thing to worry about. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Goto labels should be left-aligned in all caps and should include the programmer's name, home phone number, and credit card number. -- Abdul Nizar -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From hoerdegen at funktional.info Wed Oct 29 08:49:32 2014 From: hoerdegen at funktional.info (=?ISO-8859-15?Q?Heinrich_H=F6rdegen?=) Date: Wed, 29 Oct 2014 09:49:32 +0100 Subject: [Haskell-cafe] Munich Haskell Meeting Message-ID: <5450AA1C.40803@funktional.info> Dear all, tomorrow, the 30th of October, our monthly Munich Haskell Meeting will take place again at Cafe Puck at 19h30. For details see here: http://www.haskell-munich.de/dates If you plan to join, please click the button! Everybody is welcome! Heinrich From agocorona at gmail.com Wed Oct 29 09:48:05 2014 From: agocorona at gmail.com (Alberto G. Corona ) Date: Wed, 29 Oct 2014 10:48:05 +0100 Subject: [Haskell-cafe] Monads: external questions In-Reply-To: References: Message-ID: I know that I'm using a different language when talking about monads. The language of the IT industry. Many haskellers use the language for toy programming. Others are professional academics. The few that use the language for commercial purposes are too busy developing practical applications rather than thinking deep about how to apply the haskell concepts to their problems. As a result many of such problems remains essentially unsolved. These busy developers try to transcode solutions from other languages that lack the deep and expressiveness of Haskell. This lack of interest in one side and the lack of time in the other is disappointing. The symptoms are everywhere. Particularly, I find it in the lack of support and interests for this ticket: https://ghc.haskell.org/trac/ghc/ticket/7870 I though that there was definitively a shift from "avoid success at all costs" a few years ago, for a commitment for the success, but still there are many minds to change, especially the brilliant ones. 2014-10-26 2:02 GMT+01:00 Alberto G. Corona : > > > 2014-10-26 1:23 GMT+02:00 Jeffrey Brown : > >> As opposed to the internal logic of monads, how they work, I hope to >> start a discussion about their external logic: how and why to use monads. >> >> design >> ------ >> How do monads change the way one >> * thinks about a problem? >> * structures data? >> * refactors? >> * tests? >> Should I always be giving the monads a lot of cognitive bandwidth, >> because they reorder the way everything should be, or is it an investment >> with a high initial cognitive cost but requiring little maintenance >> thereafter? >> >> what is their common framework? >> ------------------------------- >> Monads let data reach farther than it otherwise would. Subjectively, they >> feel like a controlled way of violating encapsulation. >> >> Are there other, deeper or more specific, commonalities that explain why >> monads are a good way to implement exceptions, output, state, and perhaps >> other services? >> > > I made monads for execution state recovery, web navigation.. workflows, > long running transactions, backtracking, traceback and event chaining in > web browser applications. > > I?m confident that the perspectives for monads to solve real IT problems > are very promising. And when I mean monad I mean all the associated stuff : > applicative, alternative etc. > > I?m confident that there will be a cloud monad (for chaining jobs and work > distribution) an orchestration monad for orchestration of web services etc. > > There are problems that are intrinsically procedural among them, almost > all problems in IT. instead of using ad-hoc data/control structures like > events, handlers, configurations, routes, exceptions, logs, transaction > compensations, promises ....the list goes on and on , the monad is the > common control structure that can subsume all of them inside his > programmable semicolon > > So, once the monad is set up, the user of the monad code the solution for > the domain problem in a clean EDSL with absolutely no plumbing, at the > level of the problem. so anyone that know the problem can understand the > code. > > Is the monad instance, and the applicative etc the ones that subsume under > the hood the special data/control structure necessary for the domain > problem. > > > Often if your code is general enough, it can be used in any monad. So you > benefit from this. I think that in th future there will be a lot of > surprises about the shareability of code between monads when the IT > industry start to use them seriously. I think that we are just at the > beginning. > > I hope that some others of your questions are also answered here > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.muranov at gmail.com Wed Oct 29 10:10:22 2014 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Wed, 29 Oct 2014 11:10:22 +0100 Subject: [Haskell-cafe] a simpler way to declare typeclass instances In-Reply-To: <544BCF01.2010505@well-typed.com> References: <034ACEE3-9524-4C47-B3BC-3E6D882770C9@gmail.com> <544BCF01.2010505@well-typed.com> Message-ID: On 25 oct. 2014, at 18:25, Adam Gundry wrote: > Hi Alexey, > > On 25/10/14 16:42, Alexey Muranov wrote: >> i am trying to understand how typeclasses work. I know that they can be used as follows (from the manual): >> >> data Foo = Foo {x :: Integer, str :: String} >> >> instance Eq Foo where >> (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) >> >> I am wondering, why is the following seemingly unambiguous syntax not allowed too? >> >> data Foo = Foo { x :: Integer, str :: String } >> >> instance Eq Foo >> >> (Foo x1 str1) == (Foo x2 str2) = (x1 == x2) && (str1 == str2) > > This case is obviously unambiguous, but what is the general rule? Is the > presence of the Foo data constructor important? What if I wrote the > following, which would be a perfectly good instance method: > > foo1 == foo2 = (x foo1 == x foo2) && (str foo1 == str foo2) > > In general, should the compiler be doing type inference to determine > which instance a declaration belongs to? In principle, the language > could permit instance methods to be detached from the instances > themselves, but I don't think it should. Maybe to specify the types without type inference, something like this could be used: (foo1 :: Foo) == (foo2 :: Foo) = (x foo1 == x foo2) && (str foo1 == str foo2) Alexey. P.S. Maybe all i say is nonsense, I am not very familiar with the theory of types. I plan to read the Hindley's paper when i have time. From corentin.dupont at gmail.com Wed Oct 29 10:51:19 2014 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Wed, 29 Oct 2014 11:51:19 +0100 Subject: [Haskell-cafe] Munich Haskell Meeting In-Reply-To: <5450AA1C.40803@funktional.info> References: <5450AA1C.40803@funktional.info> Message-ID: Hi, I would be delighted to come, but alas for me it's a bit far for just a diner-time meeting... Do you have any plans to make a full Hackathon in Munich? That would be great :) Anyway, is there some ideas for the next Hackathon in Europe? Cheers, Corentin On Wed, Oct 29, 2014 at 9:49 AM, Heinrich H?rdegen < hoerdegen at funktional.info> wrote: > > Dear all, > > tomorrow, the 30th of October, our monthly Munich Haskell Meeting will > take place again at Cafe Puck at 19h30. For details see here: > > http://www.haskell-munich.de/dates > > If you plan to join, please click the button! > > Everybody is welcome! > > Heinrich > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From svenpanne at gmail.com Wed Oct 29 11:04:08 2014 From: svenpanne at gmail.com (Sven Panne) Date: Wed, 29 Oct 2014 12:04:08 +0100 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: 2014-10-26 18:07 GMT+01:00 Carter Schonwald : > 1) once they finally finish updating the hackage deply to current > hackage-server master, there will be more visibility into the build process > > 2) i've pinged the person who is owning making sure doc builders are working > to ask them to check it out Still no documentation. :-( All I'm asking for is some kind of feedback, even a low-tech textual warning on the Hackage starting page would be fine. As it is, things are very opaque... From michael at snoyman.com Wed Oct 29 11:13:39 2014 From: michael at snoyman.com (Michael Snoyman) Date: Wed, 29 Oct 2014 13:13:39 +0200 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: On Wed, Oct 29, 2014 at 1:04 PM, Sven Panne wrote: > 2014-10-26 18:07 GMT+01:00 Carter Schonwald : > > 1) once they finally finish updating the hackage deply to current > > hackage-server master, there will be more visibility into the build > process > > > > 2) i've pinged the person who is owning making sure doc builders are > working > > to ask them to check it out > > Still no documentation. :-( All I'm asking for is some kind of > feedback, even a low-tech textual warning on the Hackage starting page > would be fine. As it is, things are very opaque... > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > In case it helps anyone, I've started uploading the Haddocks I generate from Stackage builds to stackage.org (e.g. [1]). I'm still working out a few kinks in the process, for example, I'd forgotten to install the htmldocs PPAs on the Jenkins server, so some of the uploaded packagesets are currently missing docs for GHC-provided packages. However, it mostly works, and feedback is definitely appreciated. Of course, this only provides docs for package in Stackage, so you can consider this email as a not-so-subtle encouragement to add your packages to Stackage[2] :). [1] http://www.stackage.org/haddock/21a32ef62e5e60edb49f29e6baa31931fcbaa8dd/index.html [2] https://github.com/fpco/stackage/wiki/Maintainers-Agreement -------------- next part -------------- An HTML attachment was scrubbed... URL: From blamario at acanac.net Wed Oct 29 12:25:56 2014 From: blamario at acanac.net (=?UTF-8?B?TWFyaW8gQmxhxb5ldmnEhw==?=) Date: Wed, 29 Oct 2014 08:25:56 -0400 Subject: [Haskell-cafe] Polymorphic functions over string libraries In-Reply-To: <1414287367539-5758630.post@n5.nabble.com> References: <1414287367539-5758630.post@n5.nabble.com> Message-ID: <5450DCD4.2060304@acanac.net> On 25/10/14 09:36 PM, gonzaw wrote: > Hi. > > I was wondering what would be the best way to create a polymorphic function > over any possible string library (Text, String, Bytestring, etc). I'm a bit late to the party, so let me just mention my monoid-subclasses package as well. It does not (yet) provide any generic IO functions, but it covers the in-memory manipulations. From carter.schonwald at gmail.com Wed Oct 29 13:17:26 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 29 Oct 2014 09:17:26 -0400 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: I spoke with the person owning the doc builder, and seems like the it was a problem with how the doc builder would order its work. It was getting stuck trying to build docs for very old packages instead of newest first. So that's getting fixed this week. What textual warning are you looking for? On Oct 29, 2014 7:04 AM, "Sven Panne" wrote: > 2014-10-26 18:07 GMT+01:00 Carter Schonwald : > > 1) once they finally finish updating the hackage deply to current > > hackage-server master, there will be more visibility into the build > process > > > > 2) i've pinged the person who is owning making sure doc builders are > working > > to ask them to check it out > > Still no documentation. :-( All I'm asking for is some kind of > feedback, even a low-tech textual warning on the Hackage starting page > would be fine. As it is, things are very opaque... > -------------- next part -------------- An HTML attachment was scrubbed... URL: From shumovichy at gmail.com Wed Oct 29 13:59:53 2014 From: shumovichy at gmail.com (Yuras Shumovich) Date: Wed, 29 Oct 2014 16:59:53 +0300 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: <1414591193.2641.1.camel@gmail.com> On Wed, 2014-10-29 at 12:04 +0100, Sven Panne wrote: > All I'm asking for is some kind of > feedback, even a low-tech textual warning on the Hackage starting page > would be fine. As it is, things are very opaque... +1 It is easy to manually upload docs to Hackage, but at least you need to know that doc builder is not working. Probably status.haskell.org should reflect doc builder status? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From simon at joyful.com Wed Oct 29 14:08:50 2014 From: simon at joyful.com (Simon Michael) Date: Wed, 29 Oct 2014 07:08:50 -0700 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: <1414591193.2641.1.camel@gmail.com> References: <543BFBBB.5090809@fuuzetsu.co.uk> <1414591193.2641.1.camel@gmail.com> Message-ID: +1. Why all the secrecy ? From mike at proclivis.com Wed Oct 29 14:13:38 2014 From: mike at proclivis.com (Michael Jones) Date: Wed, 29 Oct 2014 08:13:38 -0600 Subject: [Haskell-cafe] Monads: external questions In-Reply-To: References: Message-ID: <42C27B93-3F2C-4EA9-8847-FE5A6B54638E@proclivis.com> When I took a Lambda Calculus class years ago in Silicon Valley, 90% of the students groaned and complained. They just wanted to learn Java and make money. Having a background in OO design and experience with Eiffel, I was intrigued and stuck with it, building some tools with ML, and later Haskell. In the workplace it was near impossible to avoid the .Net culture, and most of my code has been C#. But the factors that mattered were: - Continuity with past languages and tools - Availability of programmers - Third party libraries - Inter langage operability - Reuse of legacy code etc Best I can tell, there is no way to avoid the business context. I suggest that if you have freedom, you need to be multilingual. Many systems could benefit from applying the proper tool to the corresponding problem. But I will say this, becoming proficient at Haskell really improved my designs by providing an alternative conceptual framework. But, it had a very substantial learning curve. All I can say is trust that even if your core language is procedural, you will be better at that for learning a functional language. To make Haskell a first class citizen in the IT shops, I think focus would have to shift more to the business context and needs. And certainly more focus in the universities that are still dominated by procedural languages. Once that is drilled into ones head, it affects the way one thinks. To give an example, I have these problems: - Update to GHC 7.8.3 from 7.6 caused run time behavior changes breaking USB application - Sandboxes are not completely isolated from the core library and often builds break - Most new grads don?t even know what a functional language is - Documentation gets out of sync with releases (where documentation means Wiki and web) - FFI is difficult to use and debug - Lack of books, user groups, etc Mike On Oct 29, 2014, at 3:48 AM, Alberto G. Corona wrote: > I know that I'm using a different language when talking about monads. The language of the IT industry. > > Many haskellers use the language for toy programming. Others are professional academics. The few that use the language for commercial purposes are too busy developing practical applications rather than thinking deep about how to apply the haskell concepts to their problems. As a result many of such problems remains essentially unsolved. These busy developers try to transcode solutions from other languages that lack the deep and expressiveness of Haskell. > > This lack of interest in one side and the lack of time in the other is disappointing. The symptoms are everywhere. Particularly, I find it in the lack of support and interests for this ticket: > > https://ghc.haskell.org/trac/ghc/ticket/7870 > > I though that there was definitively a shift from "avoid success at all costs" a few years ago, for a commitment for the success, but still there are many minds to change, especially the brilliant ones. > > 2014-10-26 2:02 GMT+01:00 Alberto G. Corona : > > > 2014-10-26 1:23 GMT+02:00 Jeffrey Brown : > As opposed to the internal logic of monads, how they work, I hope to start a discussion about their external logic: how and why to use monads. > > design > ------ > How do monads change the way one > * thinks about a problem? > * structures data? > * refactors? > * tests? > Should I always be giving the monads a lot of cognitive bandwidth, because they reorder the way everything should be, or is it an investment with a high initial cognitive cost but requiring little maintenance thereafter? > > what is their common framework? > ------------------------------- > Monads let data reach farther than it otherwise would. Subjectively, they feel like a controlled way of violating encapsulation. > > Are there other, deeper or more specific, commonalities that explain why monads are a good way to implement exceptions, output, state, and perhaps other services? > > I made monads for execution state recovery, web navigation.. workflows, long running transactions, backtracking, traceback and event chaining in web browser applications. > > I?m confident that the perspectives for monads to solve real IT problems are very promising. And when I mean monad I mean all the associated stuff : applicative, alternative etc. > > I?m confident that there will be a cloud monad (for chaining jobs and work distribution) an orchestration monad for orchestration of web services etc. > > There are problems that are intrinsically procedural among them, almost all problems in IT. instead of using ad-hoc data/control structures like events, handlers, configurations, routes, exceptions, logs, transaction compensations, promises ....the list goes on and on , the monad is the common control structure that can subsume all of them inside his programmable semicolon > > So, once the monad is set up, the user of the monad code the solution for the domain problem in a clean EDSL with absolutely no plumbing, at the level of the problem. so anyone that know the problem can understand the code. > > Is the monad instance, and the applicative etc the ones that subsume under the hood the special data/control structure necessary for the domain problem. > > > Often if your code is general enough, it can be used in any monad. So you benefit from this. I think that in th future there will be a lot of surprises about the shareability of code between monads when the IT industry start to use them seriously. I think that we are just at the beginning. > > I hope that some others of your questions are also answered here > > > > -- > Alberto. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Oct 29 16:37:20 2014 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 29 Oct 2014 12:37:20 -0400 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> <1414591193.2641.1.camel@gmail.com> Message-ID: There is no secrecy. Just no one as yet volunteering to write the tools needed to create the visibility into the doc builder queue progress :-) Go on #haskell-infrastructure on freenode if you want to help make things happen. Nothing else matters :) On Oct 29, 2014 10:09 AM, "Simon Michael" wrote: > +1. Why all the secrecy ? > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstcruz at gmail.com Thu Oct 30 03:25:46 2014 From: dstcruz at gmail.com (Daniel Santa Cruz) Date: Wed, 29 Oct 2014 21:25:46 -0600 Subject: [Haskell-cafe] Haskell Weekly News: Issue 311 Message-ID: Welcome to issue 311 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from October 19 to 25, 2014 Quotes of the Week * trap_exit: isn't darcs this haskell powered quantum physics simulator that happens to also keep revisions of files? Top Reddit Stories * "GHC uses GMP, and its performance is nothing short of extraordinary. GHC is clearly tuned to call into GMP with extremely low overheads." Domain: wilfred.me.uk, Score: 79, Comments: 26 Original: [1] http://goo.gl/n6tXA3 On Reddit: [2] http://goo.gl/zTH1v5 * Video games in Haskell: Chips Challenge demo Domain: vimeo.com, Score: 73, Comments: 22 Original: [3] http://goo.gl/EyUQ6t On Reddit: [4] http://goo.gl/8Lrj3I * HLint now spots bad unsafePerformIO Domain: neilmitchell.blogspot.it, Score: 56, Comments: 29 Original: [5] http://goo.gl/sxFywP On Reddit: [6] http://goo.gl/nA0rvs * Seemingly impossible functional programs Domain: math.andrej.com, Score: 56, Comments: 15 Original: [7] http://goo.gl/gtXO9 On Reddit: [8] http://goo.gl/XdTGd7 * New blog post: "Quasi-quoting DSLs for free" Domain: well-typed.com, Score: 55, Comments: 2 Original: [9] http://goo.gl/QbblTr On Reddit: [10] http://goo.gl/hv43hU * Flocking behaviour simulation written using helm. Source in comments. Domain: gfycat.com, Score: 46, Comments: 9 Original: [11] http://goo.gl/MegczW On Reddit: [12] http://goo.gl/aKma9A * Finished reading Learn You a Haskell, please recommend me book number 2: Domain: self.haskell, Score: 41, Comments: 24 Original: [13] http://goo.gl/uQiplX On Reddit: [14] http://goo.gl/uQiplX * Simple Haskell IRC client in "two lines of code" Domain: self.haskell, Score: 40, Comments: 62 Original: [15] http://goo.gl/7SQpZL On Reddit: [16] http://goo.gl/7SQpZL * GPU Programming in Haskell (video) Domain: looprecur.com, Score: 36, Comments: 0 Original: [17] http://goo.gl/7N0rgb On Reddit: [18] http://goo.gl/kjuFle * Are there ANY good game engines for haskell? Domain: self.haskell, Score: 33, Comments: 38 Original: [19] http://goo.gl/6ugfSM On Reddit: [20] http://goo.gl/6ugfSM * Darcs turns 12 Domain: hub.darcs.net, Score: 30, Comments: 8 Original: [21] http://goo.gl/tnNsyR On Reddit: [22] http://goo.gl/DXIYyW Top StackOverflow Questions * Dependent Types: How is the dependent pair type analogous to a disjoint union? votes: 20, answers: 6 Read on SO: [23] http://goo.gl/HOSXJO * How should I read this GHC Core ?proof?? votes: 11, answers: 0 Read on SO: [24] http://goo.gl/3btTZT * more efficient type-level computations using type families? votes: 11, answers: 0 Read on SO: [25] http://goo.gl/LHYecG * How to make fmap rewrite rules fire? votes: 10, answers: 1 Read on SO: [26] http://goo.gl/JrjnJH * A workaround for the ?Template Haskell + C? bug? votes: 8, answers: 1 Read on SO: [27] http://goo.gl/q9sIHZ * Transform a -> a -> Maybe a to take any combination of a's and Maybe a's votes: 8, answers: 2 Read on SO: [28] http://goo.gl/AS4kC0 * Making numeric functions an instance of Num? votes: 7, answers: 2 Read on SO: [29] http://goo.gl/6uNuWB * Inverting a Type Family votes: 7, answers: 2 Read on SO: [30] http://goo.gl/18XHro * FRP frameworks and IO votes: 7, answers: 1 Read on SO: [31] http://goo.gl/BbEWOM Until next time, [32]+Daniel Santa Cruz References 1. http://www.wilfred.me.uk/blog/2014/10/20/the-fastest-bigint-in-the-west/ 2. http://www.reddit.com/r/haskell/comments/2jt37u/ghc_uses_gmp_and_its_performance_is_nothing_short/ 3. https://vimeo.com/109613639 4. http://www.reddit.com/r/haskell/comments/2jwwlj/video_games_in_haskell_chips_challenge_demo/ 5. http://neilmitchell.blogspot.it/2014/10/hlint-now-spots-bad-unsafeperformio.html 6. http://www.reddit.com/r/haskell/comments/2jsa4c/hlint_now_spots_bad_unsafeperformio/ 7. http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/ 8. http://www.reddit.com/r/haskell/comments/2k0xg2/seemingly_impossible_functional_programs/ 9. http://www.well-typed.com/blog/2014/10/quasi-quoting-dsls/ 10. http://www.reddit.com/r/haskell/comments/2jowjc/new_blog_post_quasiquoting_dsls_for_free/ 11. http://gfycat.com/WearyAnguishedIggypops 12. http://www.reddit.com/r/haskell/comments/2k51kk/flocking_behaviour_simulation_written_using_helm/ 13. http://www.reddit.com/r/haskell/comments/2kbnzw/finished_reading_learn_you_a_haskell_please/ 14. http://www.reddit.com/r/haskell/comments/2kbnzw/finished_reading_learn_you_a_haskell_please/ 15. http://www.reddit.com/r/haskell/comments/2jvc78/simple_haskell_irc_client_in_two_lines_of_code/ 16. http://www.reddit.com/r/haskell/comments/2jvc78/simple_haskell_irc_client_in_two_lines_of_code/ 17. http://looprecur.com/blog/gpu-programming-in-haskell/ 18. http://www.reddit.com/r/haskell/comments/2jp9y9/gpu_programming_in_haskell_video/ 19. http://www.reddit.com/r/haskell/comments/2k93sm/are_there_any_good_game_engines_for_haskell/ 20. http://www.reddit.com/r/haskell/comments/2k93sm/are_there_any_good_game_engines_for_haskell/ 21. http://hub.darcs.net/darcs/darcs-screened/patch/20021020200105-e9342 22. http://www.reddit.com/r/haskell/comments/2jsvnd/darcs_turns_12/ 23. http://stackoverflow.com/questions/26542350/dependent-types-how-is-the-dependent-pair-type-analogous-to-a-disjoint-union 24. http://stackoverflow.com/questions/26524223/how-should-i-read-this-ghc-core-proof 25. http://stackoverflow.com/questions/26538595/more-efficient-type-level-computations-using-type-families 26. http://stackoverflow.com/questions/26568262/how-to-make-fmap-rewrite-rules-fire 27. http://stackoverflow.com/questions/26449154/a-workaround-for-the-template-haskell-c-bug 28. http://stackoverflow.com/questions/26520261/transform-a-a-maybe-a-to-take-any-combination-of-as-and-maybe-as 29. http://stackoverflow.com/questions/26515102/making-numeric-functions-an-instance-of-num 30. http://stackoverflow.com/questions/26541893/inverting-a-type-family 31. http://stackoverflow.com/questions/26560100/frp-frameworks-and-io 32. https://plus.google.com/105107667630152149014/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From simons at cryp.to Thu Oct 30 11:01:09 2014 From: simons at cryp.to (Peter Simons) Date: Thu, 30 Oct 2014 12:01:09 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> Message-ID: <87zjcdbz4a.fsf@write-only.cryp.to> Hi Andreas, > On 28.10.2014 01:38, Mateusz Kowalczyk wrote: > >> 4. I make changes to ap-1.0.0.0, Hackage generates ap-1.0.0.0-fix1 >> package with identical content but new info without any extra effort >> on my side. > > Basically you suggest that there should be a last digit in the > version number that is only used for dependency fixes and is handled > automatically by cabal and hackage. the important part of Mateusz suggestion is that the version number ought to *change* after an edit. The exact mechanics of that change -- i.e. whether Hackage bumps some digit or appends a tag or whatever -- aren't very important. What is important is that it's possible to distinguish the edited version from the original one. As of now, users cannot tell which variant of the package they've installed. > We could as well say that Hackage generates > > ap-1.0.0.0.1 > ap-1.0.0.0.2 -- for the next dependency fix That would be one possible solution, yes. Personally, I think these kind of version numbers are a bit silly, so I would prefer to append a tag, but I don't feel strongly about that. > You cannot specify the 5th digit in cabal commands, so when you say > > cabal install ap-1.0.0.0 > > you get the latest, i.e. ap-1.0.0.0.2. Hackage edits are destructive: the original version is gone afterwards, and it's no longer possible to install it. As such, this point doesn't seem relevant. What is relevant, however, that people who have installed version ap-1.0.0.0.1 prior to the edit can actually tell that there is an update available -- ap-1.0.0.0.2 is *newer*. In the current state of affairs, it's not possible to tell that a package has been updated ("edited") just by looking at its version number. Best regards, Peter From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Thu Oct 30 11:08:48 2014 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Thu, 30 Oct 2014 11:08:48 +0000 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <87zjcdbz4a.fsf@write-only.cryp.to> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> Message-ID: <20141030110848.GC2728@weber> On Thu, Oct 30, 2014 at 12:01:09PM +0100, Peter Simons wrote: > > We could as well say that Hackage generates > > > > ap-1.0.0.0.1 > > ap-1.0.0.0.2 -- for the next dependency fix > > That would be one possible solution, yes. Personally, I think these kind > of version numbers are a bit silly, so I would prefer to append a tag, > but I don't feel strongly about that. How would this be any different from just uploading a new version with an updated cabal file? From hesselink at gmail.com Thu Oct 30 11:09:03 2014 From: hesselink at gmail.com (Erik Hesselink) Date: Thu, 30 Oct 2014 12:09:03 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <87zjcdbz4a.fsf@write-only.cryp.to> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> Message-ID: On Thu, Oct 30, 2014 at 12:01 PM, Peter Simons wrote: > aren't very important. What is important is that it's possible to > distinguish the edited version from the original one. As of now, users > cannot tell which variant of the package they've installed. Why is this important? I believe there is no difference between two revisions after they're installed, at least not currently, since you're only allowed to edit dependency version ranges, and perhaps some informational fields. Erik From ivan.miljenovic at gmail.com Thu Oct 30 11:14:55 2014 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Thu, 30 Oct 2014 22:14:55 +1100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> Message-ID: On 30 October 2014 22:09, Erik Hesselink wrote: > On Thu, Oct 30, 2014 at 12:01 PM, Peter Simons wrote: >> aren't very important. What is important is that it's possible to >> distinguish the edited version from the original one. As of now, users >> cannot tell which variant of the package they've installed. > > Why is this important? I believe there is no difference between two > revisions after they're installed, at least not currently, since > you're only allowed to edit dependency version ranges, and perhaps > some informational fields. * For people doing cabal -> foo converters to know that there _is_ a newer version * "Oh, wait, I can't update the version of library foo because I've got the latest available version of bar and it doesn't support the new version of foo" without knowing there's a (pseudo-) newer version which _does_ allow the newer version of foo. > > Erik > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From simons at cryp.to Thu Oct 30 11:21:55 2014 From: simons at cryp.to (Peter Simons) Date: Thu, 30 Oct 2014 12:21:55 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> Message-ID: <87h9ylby5o.fsf@write-only.cryp.to> Hi Erik, >> What is important is that it's possible to distinguish the edited >> version from the original one. As of now, users cannot tell which >> variant of the package they've installed. > > Why is this important? I believe there is no difference between two > revisions after they're installed, at least not currently, since > you're only allowed to edit dependency version ranges [...]. suppose my application foo-1.0 depends on bar >= 1.0, but it turns out that bar-1.0 has a bug that's fixed in version 1.0.1. So I edit foo-1.0 to depend on bar > 1.0 instead. Now, a user of foo-1.0 sends me an e-mail and complains about crashes in my code. At that point, I cannot know whether he's using bar >= 1.0 or bar > 1.0, because the version number of foo didn't change after the edit. Best regards, Peter From svenpanne at gmail.com Thu Oct 30 11:50:37 2014 From: svenpanne at gmail.com (Sven Panne) Date: Thu, 30 Oct 2014 12:50:37 +0100 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> Message-ID: 2014-10-29 14:17 GMT+01:00 Carter Schonwald : > I spoke with the person owning the doc builder, and seems like the it was a > problem with how the doc builder would order its work. It was getting stuck > trying to build docs for very old packages instead of newest first. So > that's getting fixed this week. > > What textual warning are you looking for? Exactly the stuff you wrote in this email should be in big fat letters on the front page (and probably even on each page header) of Hackage. As I said, it's totally fine that things take some time (it's an open source effort relying on volunteers after all), but it's crucial that the current state of a central piece of the Haskell ecosystem is very visible. Regarding status.haskell.org: This is too indirect for this purpose IMHO. As somebody who is not closely following each and every email on the various Haskell mailing lists, how should you find out that this site even exists? It's not linked from Hackage AFAICT. From svenpanne at gmail.com Thu Oct 30 11:54:29 2014 From: svenpanne at gmail.com (Sven Panne) Date: Thu, 30 Oct 2014 12:54:29 +0100 Subject: [Haskell-cafe] Getting the haddocks back (was: documentation build failing in hackage?) In-Reply-To: References: <543BFBBB.5090809@fuuzetsu.co.uk> <1414591193.2641.1.camel@gmail.com> Message-ID: 2014-10-29 17:37 GMT+01:00 Carter Schonwald : > There is no secrecy. Just no one as yet volunteering to write the tools > needed to create the visibility into the doc builder queue progress :-) [...] Nobody asked for a fully automated tool/status page, a plain visible note on Hackage done by hand would be enough. Problems with the doc builders are not new, see e.g. https://github.com/haskell/hackage-server/issues/244 or https://github.com/haskell/hackage-server/issues/265. From svenpanne at gmail.com Thu Oct 30 12:00:48 2014 From: svenpanne at gmail.com (Sven Panne) Date: Thu, 30 Oct 2014 13:00:48 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <20141030110848.GC2728@weber> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> <20141030110848.GC2728@weber> Message-ID: 2014-10-30 12:08 GMT+01:00 Tom Ellis : > On Thu, Oct 30, 2014 at 12:01:09PM +0100, Peter Simons wrote: >> > We could as well say that Hackage generates >> > >> > ap-1.0.0.0.1 >> > ap-1.0.0.0.2 -- for the next dependency fix >> >> That would be one possible solution, yes. Personally, I think these kind >> of version numbers are a bit silly, so I would prefer to append a tag, >> but I don't feel strongly about that. > > How would this be any different from just uploading a new version with an > updated cabal file? >From a user perspective it wouldn't be different and it shouldn't be. >From a maintainer/trustee POV it's just a convenience feature, which is OK. Having said that, I think that automatically bumping the minor version number would be the right thing to do. Breaking reproducible builds is a horrible idea. From ivan.miljenovic at gmail.com Thu Oct 30 12:40:43 2014 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Thu, 30 Oct 2014 23:40:43 +1100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> <20141030110848.GC2728@weber> Message-ID: On 30 October 2014 23:00, Sven Panne wrote: > 2014-10-30 12:08 GMT+01:00 Tom Ellis > : >> On Thu, Oct 30, 2014 at 12:01:09PM +0100, Peter Simons wrote: >>> > We could as well say that Hackage generates >>> > >>> > ap-1.0.0.0.1 >>> > ap-1.0.0.0.2 -- for the next dependency fix >>> >>> That would be one possible solution, yes. Personally, I think these kind >>> of version numbers are a bit silly, so I would prefer to append a tag, >>> but I don't feel strongly about that. >> >> How would this be any different from just uploading a new version with an >> updated cabal file? > > From a user perspective it wouldn't be different and it shouldn't be. > From a maintainer/trustee POV it's just a convenience feature, which > is OK. Having said that, I think that automatically bumping the minor > version number would be the right thing to do. Breaking reproducible > builds is a horrible idea. I don't think you should bump the minor version (as in the fourth version field) as it doesn't affect any actual changes that may have taken place in SCM, etc. Of course, arbitrarily just adding a fifth field will only work if the package is following PVP (i.e. using 4 version fields), and AFAIK there's no way to explicitly know/state that. -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From semen at trygub.com Thu Oct 30 13:42:41 2014 From: semen at trygub.com (Semen Trygubenko / =?utf-8?B?0KHQtdC80LXQvSDQotGA0LjQs9GD0LHQtdC9?= =?utf-8?B?0LrQvg==?=) Date: Thu, 30 Oct 2014 13:42:41 +0000 Subject: [Haskell-cafe] <|> that short-circuits in IO ? Message-ID: <20141030134241.GA99529@inanna.trygub.com> Dear Haskell-Cafe, Is there a way to get Control.Applicative.<|> to short-circuit when combining two IO actions? E.g. > let a = putStrLn "A" >> return (Left "hehe") > let b = putStrLn "B" >> return (Right 42) > Prelude> liftA2 (<|>) a b A B Right 42 > liftA2 (<|>) b a B A Right 42 (In the latter case I don't want A in the output?) Many thanks for your help, Semen -- ????? ?????????? http://trygub.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: From roma at ro-che.info Thu Oct 30 13:50:02 2014 From: roma at ro-che.info (Roman Cheplyaka) Date: Thu, 30 Oct 2014 15:50:02 +0200 Subject: [Haskell-cafe] <|> that short-circuits in IO ? In-Reply-To: <20141030134241.GA99529@inanna.trygub.com> References: <20141030134241.GA99529@inanna.trygub.com> Message-ID: <5452420A.2080803@ro-che.info> On 30/10/14 15:42, Semen Trygubenko / ????? ?????????? wrote: > Dear Haskell-Cafe, > > Is there a way to get Control.Applicative.<|> to short-circuit when combining two IO actions? > > E.g. > >> let a = putStrLn "A" >> return (Left "hehe") >> let b = putStrLn "B" >> return (Right 42) > >> Prelude> liftA2 (<|>) a b > > A > B > Right 42 > >> liftA2 (<|>) b a > > B > A > Right 42 > > (In the latter case I don't want A in the output?) Wrap it into ExceptT (from the latest transformers), as in runExceptT $ ExceptT a <|> ExceptT b Roman -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From the.dead.shall.rise at gmail.com Thu Oct 30 14:22:06 2014 From: the.dead.shall.rise at gmail.com (Mikhail Glushenkov) Date: Thu, 30 Oct 2014 15:22:06 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <87zjcdbz4a.fsf@write-only.cryp.to> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> Message-ID: Hi, On 30 October 2014 12:01, Peter Simons wrote: > > In the current state of > affairs, it's not possible to tell that a package has been updated > ("edited") just by looking at its version number. There is a 'x-hackage-revision' field in the .cabal file which gets updated each time the package description is edited. May be useful for generating distribution packages, e.g. you could have foo-1.0, foo-1.0-rev1, foo-1.0-rev2, etc. Regarding version tags - they're deprecated and are going to be removed in the 7.12 release of GHC. From svenpanne at gmail.com Thu Oct 30 14:31:12 2014 From: svenpanne at gmail.com (Sven Panne) Date: Thu, 30 Oct 2014 15:31:12 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> <20141030110848.GC2728@weber> Message-ID: 2014-10-30 13:40 GMT+01:00 Ivan Lazar Miljenovic : > I don't think you should bump the minor version (as in the fourth > version field) as it doesn't affect any actual changes that may have > taken place in SCM, etc. [...] Fiddling around with anything which affects compilation in which the package in question involved *must* be reflected somehow in the version number, otherwise we could just live without any versions at all. If we agree that automatic version bumps are not what we want, we should disable editing the .cabal file on Hackage completely. As it is, people with identical output of "ghc-pkg list" could have completely different experiences when they try to compile the same thing, which is horrible. From lsp at informatik.uni-kiel.de Thu Oct 30 14:40:42 2014 From: lsp at informatik.uni-kiel.de (lennart spitzner) Date: Thu, 30 Oct 2014 15:40:42 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> <20141030110848.GC2728@weber> Message-ID: <54524DEA.201@informatik.uni-kiel.de> On 30/10/14 13:40, Ivan Lazar Miljenovic wrote: > Of course, arbitrarily just adding a fifth field will only work if the > package is following PVP (i.e. using 4 version fields), and AFAIK > there's no way to explicitly know/state that. PVP does not mandate exactly 4 components; n>=3 is valid. (and of course bumping (n+1) is not safe, as the maintainer might decide to publish a new version that adds a new component.) From lsp at informatik.uni-kiel.de Thu Oct 30 14:57:33 2014 From: lsp at informatik.uni-kiel.de (lennart spitzner) Date: Thu, 30 Oct 2014 15:57:33 +0100 Subject: [Haskell-cafe] PVP suggestion In-Reply-To: References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> <20141030110848.GC2728@weber> Message-ID: <545251DD.4000503@informatik.uni-kiel.de> now that you remind me: may i make a related suggestion to change the wording in the explanation of the lexicographic ordering: Instead of "For example, 2.1 > 1.3, and 2.1.1 > 2.1." Write "For example, 2.0.0 > 1.3.2, and 2.0.1.0 > 2.0.1." for two reasons 1) an example following the A.B.C definition should have three components (even if we just define "lexicographical" independent of number-of-components; it is mistakable) 2) i once assumed that a.b == a.b.0 ; this change would prevent such. (Or is there any reason against using trailing zeros?) From simons at cryp.to Thu Oct 30 22:55:04 2014 From: simons at cryp.to (Peter Simons) Date: Thu, 30 Oct 2014 23:55:04 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> Message-ID: <877fzhuq0n.fsf@write-only.cryp.to> Hi Mikhail, >> [It's currently impossible] to tell that a package has been updated >> ("edited") just by looking at its version number. > > There is a 'x-hackage-revision' field in the .cabal file which gets > updated each time the package description is edited. May be useful for > generating distribution packages, e.g. you could have foo-1.0, > foo-1.0-rev1, foo-1.0-rev2, etc. so why doesn't Hackage provide these useful version numbers for its users? Best regards, Peter From simons at cryp.to Fri Oct 31 09:56:39 2014 From: simons at cryp.to (Peter Simons) Date: Fri, 31 Oct 2014 10:56:39 +0100 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> <20141030110848.GC2728@weber> <54524DEA.201@informatik.uni-kiel.de> Message-ID: <87zjccpnoo.fsf@write-only.cryp.to> Hi Lennart, > Bumping [the (n+1)th digit] is not safe, as the maintainer might > decide to publish a new version that adds a new component.) Suppose I publish foo-1.0. Then a sequence of edits would produce versions 1.0.1, 1.0.1.1, 1.0.1.1.1, and so on. Why would there be any problem? Best regards, Peter From michael at snoyman.com Fri Oct 31 10:11:31 2014 From: michael at snoyman.com (Michael Snoyman) Date: Fri, 31 Oct 2014 12:11:31 +0200 Subject: [Haskell-cafe] Hackage inconsistent? (pandoc.cabal in 1.13.1) In-Reply-To: <87zjccpnoo.fsf@write-only.cryp.to> References: <20141027182509.GA12570@tatooine.lan> <20141027183029.5398606.63528.429@gsd.uwaterloo.ca> <20141027184751.GB12570@tatooine.lan> <20141027193003.GA2150@berkeley.edu> <544EE59B.5010208@fuuzetsu.co.uk> <544F8959.1050102@ifi.lmu.de> <87zjcdbz4a.fsf@write-only.cryp.to> <20141030110848.GC2728@weber> <54524DEA.201@informatik.uni-kiel.de> <87zjccpnoo.fsf@write-only.cryp.to> Message-ID: Sorry to jump into this thread at a random point. There's another aspect to this discussion that hasn't been brought up. Imagine that I release a package bar-1.0.0.0, that depends on: build-depends: base, foo >= 1.1 Then, suppose foo-1.2 is released and bar-1.0.0.0 is incompatible. If you simply release a new version of bar with a stricter upper bound, cabal may decide to install the original bar-1.0.0.0 together with foo-1.2, which will lead to a broken build. Blackling the package is the theoretical solution to this problem, but may not work correctly[1]. However, by overwriting the original cabal file with a tweaked one, cabal will be able to make a more sensible decision. I'm not trying to advocate anything in particular here, just point out an aspect of the discussion that I think has been missed. [1] https://github.com/haskell/cabal/issues/1792 On Fri, Oct 31, 2014 at 11:56 AM, Peter Simons wrote: > Hi Lennart, > > > Bumping [the (n+1)th digit] is not safe, as the maintainer might > > decide to publish a new version that adds a new component.) > > Suppose I publish foo-1.0. Then a sequence of edits would produce > versions 1.0.1, 1.0.1.1, 1.0.1.1.1, and so on. > > Why would there be any problem? > > Best regards, > Peter > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ky3 at atamo.com Fri Oct 31 21:22:28 2014 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Sat, 1 Nov 2014 04:22:28 +0700 Subject: [Haskell-cafe] <|> that short-circuits in IO ? In-Reply-To: <5452420A.2080803@ro-che.info> References: <20141030134241.GA99529@inanna.trygub.com> <5452420A.2080803@ro-che.info> Message-ID: On Thu, Oct 30, 2014 at 8:50 PM, Roman Cheplyaka wrote: > >> liftA2 (<|>) b a > > > > B > > A > > Right 42 > > > > (In the latter case I don't want A in the output?) > > Wrap it into ExceptT (from the latest transformers), as in > > runExceptT $ ExceptT a <|> ExceptT b With the latest transformers, I still get B A Right 42 i.e. the A hasn't been eliminated. What am I missing? -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From codygman.consulting at gmail.com Fri Oct 31 23:16:32 2014 From: codygman.consulting at gmail.com (Cody Goodman) Date: Fri, 31 Oct 2014 18:16:32 -0500 Subject: [Haskell-cafe] Debugging Wreq/http-client https requests Message-ID: I have a program that is POST'ing some data to a remote server. However, some part of the data I'm sending is wrong I believe. If this were plain http without encryption, wireshark would allow me to see the exact data being sent over the wire. However, with https it is encrypted. Is there an inbuilt way to debug requests sent by wreq or more likely, a way to output debug info for http-client? Alternatively, is there a way to use NSS support with either of these libraries: http://security.stackexchange.com/questions/35639/decrypting-tls-in-wireshark-when-using-dhe-rsa-ciphersuites Thanks in advance to all for your time. From semen at trygub.com Fri Oct 31 23:43:19 2014 From: semen at trygub.com (Semen Trygubenko / =?utf-8?B?0KHQtdC80LXQvSDQotGA0LjQs9GD0LHQtdC9?= =?utf-8?B?0LrQvg==?=) Date: Fri, 31 Oct 2014 23:43:19 +0000 Subject: [Haskell-cafe] <|> that short-circuits in IO ? In-Reply-To: References: <20141030134241.GA99529@inanna.trygub.com> <5452420A.2080803@ro-che.info> Message-ID: <20141031234319.GA16068@inanna.trygub.com> On Sat, Nov 01, 2014 at 04:22:28AM +0700, Kim-Ee Yeoh wrote: > On Thu, Oct 30, 2014 at 8:50 PM, Roman Cheplyaka wrote: > > > >> liftA2 (<|>) b a > > > > > > B > > > A > > > Right 42 > > > > > > (In the latter case I don't want A in the output?) > > > > Wrap it into ExceptT (from the latest transformers), as in > > > > runExceptT $ ExceptT a <|> ExceptT b > > > With the latest transformers, I still get > > B > A > Right 42 > > i.e. the A hasn't been eliminated. > > What am I missing? In the actual use case ErrorT was already wrapping IO and that's what I was combining with <|>, so, for now, lacking the latest transformers, I have written a custom infix operator. I haven't had a chance to test Roman's solution and assumed it to be correct. So your observation is a valuable "data point" ? thank you! Apologies, I should have tested this myself sooner, S. -- ????? ?????????? http://trygub.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 181 bytes Desc: not available URL: