From will.yager at gmail.com Wed Feb 1 00:05:35 2017 From: will.yager at gmail.com (William Yager) Date: Tue, 31 Jan 2017 18:05:35 -0600 Subject: [Haskell-cafe] Ensuring all values of an ADT are explicitly handled OR finding all occurrences of type X in my app In-Reply-To: <37f5d585-2a12-7989-9a98-a24c9f8d3412@ens.fr> References: <9750a089-55aa-1e1f-8868-a0c0da0bf9b3@orlitzky.com> <7FDB999E-5342-466B-BD6F-BDEE2DF3328B@seidel.io> <37f5d585-2a12-7989-9a98-a24c9f8d3412@ens.fr> Message-ID: On Tue, Jan 31, 2017 at 12:56 PM, Li-yao Xia wrote: > > A "default branch" seems to correspond to a wildcard overlapping a > previous pattern. This would be a warning symmetrical to > -Woverlapping-patterns. > > - A wildcard which overlaps with a pattern below it makes the latter > unreachable, which is certainly not intentional. This is caught by > -Woverlapping-patterns. > > case x of > _ -> y > C -> z > > - A wildcard which overlaps with a pattern above it has the risk > mentionned in this thread, that it will catch any new constructor added to > the corresponding ADT, and thus the programmer may forget to update some > case expressions when the new constructor is to be handled differently. > > case x of > C -> y > _ -> z > > Li-yao > > Excellent. That also elegantly covers the case of functions which ignore the argument, like "const x _ = x". Good thinking! --Will -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity at googlemail.com Wed Feb 1 00:18:22 2017 From: icfp.publicity at googlemail.com (Lindsey Kuper) Date: Tue, 31 Jan 2017 16:18:22 -0800 Subject: [Haskell-cafe] Second Call for Papers: ICFP 2017 Message-ID: <5891294ed09fd_f913fec02463bf0583c@landin.mail> ICFP 2017 The 22nd ACM SIGPLAN International Conference on Functional Programming Oxford, United Kingdom http://icfp17.sigplan.org/ Second Call for Papers ### Important dates Submissions due: Monday, February 27, Anywhere on Earth https://icfp17.hotcrp.com Author response: Monday, April 17, 2017, 15:00 (UTC) - Thursday, April 20, 2017, 15:00 (UTC) Notification: Monday, 1 May, 2017 Final copy due: Monday, 5 June 2017 Early registration: TBA Conference: Monday, 4 September - Wednesday, 6 September, 2017 ### Updates for Second Call for Papers This revision, published January 31, 2017, includes the following updates: * A link to the list of frequently asked questions about the double-blind review process. * A new requirement for citations in author-year format. This follows a decision for PACMPL that was made after the original version of this call was distributed. As such, author-year format will be required for final (accepted) versions of papers in ICFP 2017, but not for submissions. * Additional guidance for authors using LaTeX. * A clarification about the expectations for author attendance in the event of visa-related problems. ### New this year Those familiar with previous ICFP conferences should be aware of two significant changes that are being introduced in 2017: 1. Papers selected for ICFP 2017 will be published as the ICFP 2017 issue of a new journal, Proceedings of the ACM on Programming Languages (PACMPL), which replaces the previous ICFP conference proceedings. The move to PACMPL will have two noticeable impacts on authors: * A new, two-phase selection and reviewing process that conforms to ACM’s journal reviewing guidelines. * A new, single-column format for submissions. 2. Authors of papers that are conditionally accepted in the first phase of the reviewing process will have the option to submit materials for Artifact Evaluation. Further details on each of these changes are included in the following text. ### Scope ICFP 2017 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, and from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects, concurrency, or parallelism. Topics of interest include (but are not limited to): * *Language Design*: concurrency, parallelism, and distribution; modules; components and composition; metaprogramming; type systems; interoperability; domain-specific languages; and relations to imperative, object-oriented, or logic programming. * *Implementation*: abstract machines; virtual machines; interpretation; compilation; compile-time and run-time optimization; garbage collection and memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components, or low-level machine resources. * *Software-Development Techniques*: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling. * *Foundations*: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects; program verification; dependent types. * *Analysis and Transformation*: control-flow; data-flow; abstract interpretation; partial evaluation; program calculation. * *Applications*: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia and 3D graphics programming; scripting; system administration; security. * *Education*: teaching introductory programming; parallel programming; mathematical proof; algebra. Submissions will be evaluated according to their relevance, correctness, significance, originality, and clarity. Each submission should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. ICFP 2017 also welcomes submissions in two separate categories --- Functional Pearls and Experience Reports --- that must be marked as such at the time of submission and that need not report original research results. Detailed guidelines on both categories are given at the end of this call. Please contact the program chair if you have questions or are concerned about the appropriateness of a topic. ### Preparation of submissions ICFP 2017 will employ a lightweight double-blind reviewing process, as described below. **Deadline**: The deadline for submissions is Monday, February 27, 2017, Anywhere on Earth (). This deadline will be strictly enforced. **Formatting**: (NOTE: NEW FORMAT REQUIREMENTS FOR ICFP 2017) Submissions must be in PDF format, printable in black and white on US Letter sized paper, and interpretable by common PDF tools. All submissions must adhere to the "ACM Large" template that is available (in both LaTeX and Word formats) from . For authors using LaTeX, a lighter-weight package, including only the essential files, is available from ; the appropriate template for ICFP 2017 authors is in the file `acmart-pacmpl-template.tex`. As documented in the template, submissions should be prepared using the `acmlarge` and `anonymous` options. The use of the `review` option is also strongly encouraged but not required. (The `review` option will add line numbers, which will make it easier for reviewers to reference specific parts of your paper in their comments, but should have absolutely no other effect on the typesetting.) Details of available technical support for LaTeX-specific questions is available at . There is a limit of 24 pages for a full paper or 12 pages for an Experience Report; in either case, the bibliography will not be counted against these limits. These page limits have been chosen to allow essentially the same amount of content with the new single-column format as was possible with the two-column format used in past ICFP conferences. Submissions that exceed the page limits or, for other reasons, do not meet the requirements for formatting, will be summarily rejected. **Citations**: As part of PACMPL, ICFP 2017 papers are expected to use author-year citations for references to other work. Author-year citations may be used as either a noun phrase, such as "The lambda calculus was originally conceived by Church (1932)", or a parenthetic phase, such as "The lambda calculus (Church 1932) was intended as a foundation for mathematics". A useful test for correct usage it to make sure that the text still reads correctly when the parenthesized portions of any references are omitted. Take care with prepositions; in the first example above, "by" is more appropriate than "in" because it allows the text to be read correctly as a reference to the author. Sometimes, readability may be improved by putting parenthetic citations at the end of a clause or a sentence, such as "A foundation for mathematics was provided by the lambda calculus (Church 1932)". In LaTeX, use `\citet{Church-1932}` for citations as a noun phrase, "Church (1932)", and `\citep{Church-1932}` for citations as a parenthetic phrase, "(Church 1932)"; for details, see Sections 2.3--2.5 of the natbib documentation (). **Submission**: Submissions will be accepted at (in preparation at the time of writing). Improved versions of a paper may be submitted at any point before the submission deadline using the same web interface. **Author Response Period**: Authors will have a 72-hour period, starting at 15:00 UTC on Monday, April 17, 2017, to read reviews and respond to them. **Supplementary Materials**: Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. The material should be uploaded at submission time, as a single pdf or a tarball, not via a URL. This supplementary material may or may not be anonymized; if not anonymized, it will only be revealed to reviewers after they have submitted their review of the paper and learned the identity of the author(s). **Authorship Policies**: All submissions are expected to comply with the ACM Policies for Authorship that are detailed at . **Republication Policies**: Each submission must adhere to SIGPLAN's republication policy, as explained on the web at . **Resubmitted Papers**: Authors who submit a revised version of a paper that has previously been rejected by another conference have the option to attach an annotated copy of the reviews of their previous submission(s), explaining how they have addressed these previous reviews in the present submission. If a reviewer identifies him/herself as a reviewer of this previous submission and wishes to see how his/her comments have been addressed, the program chair will communicate to this reviewer the annotated copy of his/her previous review. Otherwise, no reviewer will read the annotated copies of the previous reviews. ### Review Process This section outlines the two-stage process with lightweight double-blind reviewing that will be used to select papers for presentation at ICFP 2017. A [list of frequently asked questions and answers](http://icfp17.sigplan.org/track/icfp-2017-papers#Submission-and-Reviewing-FAQ) that address common concerns is available on the conference website and will be updated as necessary to clarify and expand on this process. **ICFP 2017 will employ a two-stage review process.** The first stage in the review process will assess submitted papers using the criteria stated above and will allow for feedback and input on initial reviews through the author response period mentioned previously. At the PC meeting, a set of papers will be conditionally accepted and all other papers will be rejected. Authors will be notified of these decisions on May 1, 2017. Authors of conditionally accepted papers will be provided with committee reviews (just as in previous conferences) along with a set of mandatory revisions. After five weeks (June 5, 2017), the authors will provide a second submission. The second and final reviewing phase assesses whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. The intent and expectation is that the mandatory revisions can be addressed within five weeks and hence that conditionally accepted papers will in general be accepted in the second phase. The second submission should clearly identify how the mandatory revisions were addressed. To that end, the second submission must be accompanied by a cover letter mapping each mandatory revision request to specific parts of the paper. The cover letter will facilitate a quick second review, allowing for confirmation of final acceptance within two weeks. Conversely, the absence of a cover letter will be grounds for the paper’s rejection. This process is intended as a refinement of the review process that has been used in previous ICFP conferences. By incorporating a second stage, the process will conform to ACM’s journal reviewing guidelines for PACMPL. **ICFP 2017 will employ a lightweight double-blind reviewing process.** To facilitate this, submitted papers must adhere to two rules: 1. **author names and institutions must be omitted**, and 2. **references to authors' own related work should be in the third person** (e.g., not "We build on our previous work ..." but rather "We build on the work of ..."). The purpose of this process is to help the PC and external reviewers come to an initial judgement about the paper without bias, not to make it impossible for them to discover the authors if they were to try. Nothing should be done in the name of anonymity that weakens the submission or makes the job of reviewing the paper more difficult (e.g., important background references should not be omitted or anonymized). In addition, authors should feel free to disseminate their ideas or draft versions of their paper as they normally would. For instance, authors may post drafts of their papers on the web or give talks on their research ideas. ### Information for Authors of Accepted Papers * As a condition of acceptance, final versions of all papers must adhere to the new ACM Large format. The page limits for final versions of papers will be increased to ensure that authors have space to respond to reviewer comments and mandatory revisions. * Authors of accepted submissions will be required to agree to one of the three ACM licensing options: copyright transfer to ACM; retaining copyright but granting ACM exclusive publication rights; or open access on payment of a fee. Further information about ACM author rights is available from . * At least one author of each accepted submission will be expected to attend and present their paper at the conference. (ICFP welcomes all authors, regardless of nationality. If any author of an accepted submission has visa-related difficulties in travelling to the conference, we will make arrangements to enable remote participation, and not require them to attend the conference in order to present their talk.) The schedule for presentations will be determined and shared with authors after the full program has been selected. Presentations will be videotaped and released online if the presenter consents. * We intend that the proceedings will be freely available for download from the ACM Digital Library in perpetuity via the OpenTOC mechanism. * ACM Author-Izer is a unique service that enables ACM authors to generate and post links on either their home page or institutional repository for visitors to download the definitive version of their articles from the ACM Digital Library at no charge. Downloads through Author-Izer links are captured in official ACM statistics, improving the accuracy of usage and impact measurements. Consistently linking to the definitive version of an ACM article should reduce user confusion over article versioning. After an article has been published and assigned to the appropriate ACM Author Profile pages, authors should visit to learn how to create links for free downloads from the ACM DL. * **AUTHORS TAKE NOTE: The official publication date is the date the proceedings are made available in the ACM Digital Library. This date may be up to *two weeks prior* to the first day of the conference. The official publication date affects the deadline for any patent filings related to published work.** ### Artifact Evaluation Authors of papers that are conditionally accepted in the first phase of the review process will be encouraged (but not required) to submit supporting materials for Artifact Evaluation. These items will then be reviewed by a committee, separate from the program committee, whose task is to assess how the artifacts support the work described in the associated paper. Papers that go through the Artifact Evaluation process successfully will receive a seal of approval printed on the papers themselves. Authors of accepted papers will be encouraged to make the supporting materials publicly available upon publication of the proceedings, for example, by including them as "source materials" in the ACM Digital Library. An additional seal will mark papers whose artifacts are made available, as outlined in the ACM guidelines for artifact badging. Participation in Artifact Evaluation is voluntary and will not influence the final decision regarding paper acceptance. Further information about the motivations and expectations for Artifact Evaluation can be found at . ### Special categories of papers In addition to research papers, ICFP solicits two kinds of papers that do not require original research contributions: Functional Pearls, which are full papers, and Experience Reports, which are limited to half the length of a full paper. Authors submitting such papers should consider the following guidelines. #### Functional Pearls A Functional Pearl is an elegant essay about something related to functional programming. Examples include, but are not limited to: * a new and thought-provoking way of looking at an old idea * an instructive example of program calculation or proof * a nifty presentation of an old or new data structure * an interesting application of functional programming techniques * a novel use or exposition of functional programming in the classroom While pearls often demonstrate an idea through the development of a short program, there is no requirement or expectation that they do so. Thus, they encompass the notions of theoretical and educational pearls. Functional Pearls are valued as highly and judged as rigorously as ordinary papers, but using somewhat different criteria. In particular, a pearl is not required to report original research, but, it should be concise, instructive, and entertaining. A pearl is likely to be rejected if its readers get bored, if the material gets too complicated, if too much specialized knowledge is needed, or if the writing is inelegant. The key to writing a good pearl is polishing. A submission that is intended to be treated as a pearl must be marked as such on the submission web page, and should contain the words "Functional Pearl" somewhere in its title or subtitle. These steps will alert reviewers to use the appropriate evaluation criteria. Pearls will be combined with ordinary papers, however, for the purpose of computing the conference's acceptance rate. #### Experience Reports The purpose of an Experience Report is to help create a body of published, refereed, citable evidence that functional programming really works --- or to describe what obstacles prevent it from working. Possible topics for an Experience Report include, but are not limited to: * insights gained from real-world projects using functional programming * comparison of functional programming with conventional programming in the context of an industrial project or a university curriculum * project-management, business, or legal issues encountered when using functional programming in a real-world project * curricular issues encountered when using functional programming in education * real-world constraints that created special challenges for an implementation of a functional language or for functional programming in general An Experience Report is distinguished from a normal ICFP paper by its title, by its length, and by the criteria used to evaluate it. * Both in the proceedings and in any citations, the title of each accepted Experience Report must begin with the words "Experience Report" followed by a colon. The acceptance rate for Experience Reports will be computed and reported separately from the rate for ordinary papers. * Experience Report submissions can be at most 12 pages long, excluding bibliography. * Each accepted Experience Report will be presented at the conference, but depending on the number of Experience Reports and regular papers accepted, authors of Experience reports may be asked to give shorter talks. * Because the purpose of Experience Reports is to enable our community to accumulate a body of evidence about the efficacy of functional programming, an acceptable Experience Report need not add to the body of knowledge of the functional-programming community by presenting novel results or conclusions. It is sufficient if the Report states a clear thesis and provides supporting evidence. The thesis must be relevant to ICFP, but it need not be novel. The program committee will accept or reject Experience Reports based on whether they judge the evidence to be convincing. Anecdotal evidence will be acceptable provided it is well argued and the author explains what efforts were made to gather as much evidence as possible. Typically, more convincing evidence is obtained from papers which show how functional programming was used than from papers which only say that functional programming was used. The most convincing evidence often includes comparisons of situations before and after the introduction or discontinuation of functional programming. Evidence drawn from a single person's experience may be sufficient, but more weight will be given to evidence drawn from the experience of groups of people. An Experience Report should be short and to the point: it should make a claim about how well functional programming worked on a particular project and why, and produce evidence to substantiate this claim. If functional programming worked in this case in the same ways it has worked for others, the paper need only summarize the results --- the main part of the paper should discuss how well it worked and in what context. Most readers will not want to know all the details of the project and its implementation, but the paper should characterize the project and its context well enough so that readers can judge to what degree this experience is relevant to their own projects. The paper should take care to highlight any unusual aspects of the project. Specifics about the project are more valuable than generalities about functional programming; for example, it is more valuable to say that the team delivered its software a month ahead of schedule than it is to say that functional programming made the team more productive. If the paper not only describes experience but also presents new technical results, or if the experience refutes cherished beliefs of the functional-programming community, it may be better off submitted it as a full paper, which will be judged by the usual criteria of novelty, originality, and relevance. The program chair will be happy to advise on any concerns about which category to submit to. ### Organizers General Chair: Jeremy Gibbons (University of Oxford, UK) Program Chair: Mark Jones (Portland State University, USA) Artifact Evaluation Chair: Ryan R. Newton (Indiana University, USA) Industrial Relations Chair: Ryan Trinkle (Obsidian Systems LLC, USA) Programming Contest Organiser: Sam Lindley (University of Edinburgh, UK) Publicity and Web Chair: Lindsey Kuper (Intel Labs, USA) Student Research Competition Chair: Ilya Sergey (University College London, UK) Video Chair: Jose Calderon (Galois, Inc., USA) Workshops Co-Chair: Andres Löh (Well-Typed LLP) Workshops Co-Chair: David Christiansen (Indiana University, USA) Program Committee: Bob Atkey (University of Strathclyde, Scotland) Adam Chlipala (MIT, USA) Dominique Devriese (KU Leuven, Belgium) Martin Erwig (Oregon State, USA) Matthew Flatt (University of Utah, USA) Ronald Garcia (University of British Columbia, Canada) Kathryn Gray (University of Cambridge, England) John Hughes (Chalmers University and Quvik, Sweden) Chung-Kil Hur (Seoul National University, Korea) Graham Hutton (University of Nottingham, England) Alan Jeffrey (Mozilla Research, USA) Ranjit Jhala (University of California, San Diego, USA) Shin-ya Katsumata (Kyoto University, Japan) Lindsey Kuper (Intel Labs, USA) Dan Licata (Wesleyan University, USA) Ben Lippmeier (Digital Asset, Australia) Gabriel Scherer (Northeastern University, USA) Alexandra Silva (University College London, England) Nikhil Swamy (Microsoft Research, USA) Sam Tobin-Hochstadt (Indiana University, USA) Nicolas Wu (University of Bristol, England) Beta Ziliani (CONICET and FAMAF, Universidad Nacional de Córdoba, Argentina) From tmorris at tmorris.net Wed Feb 1 01:46:12 2017 From: tmorris at tmorris.net (Tony Morris) Date: Wed, 1 Feb 2017 11:46:12 +1000 Subject: [Haskell-cafe] Haskell jobs in Brisbane, Australia Message-ID: Hi all, Data61, CSIRO has recently announced three new positions in Brisbane, Australia for work in FP. Haskell will be the primary language used. For a few reasons remote work is not available for these positions, but if you’re willing to relocate, these would be a fantastic opportunity. https://jobs.csiro.au/job/Brisbane%2C-QLD-Senior-Functional-Programming-Engineers/385910400/ https://jobs.csiro.au/job/Brisbane%2C-QLD-Functional-Programming-Engineers/385668100/ https://jobs.csiro.au/job/Brisbane%2C-QLD-Functional-Programming-Engineer/385667500/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at joachim-breitner.de Wed Feb 1 04:55:00 2017 From: mail at joachim-breitner.de (Joachim Breitner) Date: Tue, 31 Jan 2017 23:55:00 -0500 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: <1485894155.1237.7.camel@joachim-breitner.de> References: <1485894155.1237.7.camel@joachim-breitner.de> Message-ID: <1485924900.8920.4.camel@joachim-breitner.de> Hi, Am Dienstag, den 31.01.2017, 15:22 -0500 schrieb Joachim Breitner: > I recently wrote this applicative functor: > >     data OneStep a = OneStep a [a] > >     instance Functor OneStep where >         fmap f (OneStep o s) = OneStep (f o) (map f s) > >     instance Applicative OneStep where >         pure x = OneStep x [] >         OneStep f fs <*> OneStep x xs = OneStep (f x) (map ($x) fs ++ > map f xs) > >     takeOneStep :: OneStep t -> [t] >     takeOneStep (OneStep _ xs) = xs > > This was useful in the context of writing a shrink for QuickCheck, as > discussed at http://stackoverflow.com/a/41944525/946226. > > Now I wonder: Does this functor have a proper name? Does it already > exist in the libraries somewhere? Should it? I guess it does not exist, so I am preparing a package for it here: https://github.com/nomeata/haskell-successors The source code contains (in comments) a proof of the Applicative laws. My gut feeling says that this does not have a Monad instance that is compatible with the given Applicative instance, but it is too late today to substantiate this feeling. If anyone feels like puzzling: Can you come up with a Monad instance, or (more likely) give good reasons why there cannot be one? Greetings, Joachim -- Joachim “nomeata” Breitner   mail at joachim-breitner.de • https://www.joachim-breitner.de/   XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F   Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: From dave at zednenem.com Wed Feb 1 05:28:18 2017 From: dave at zednenem.com (David Menendez) Date: Wed, 1 Feb 2017 00:28:18 -0500 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: <1485924900.8920.4.camel@joachim-breitner.de> References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> Message-ID: On Tue, Jan 31, 2017 at 11:55 PM, Joachim Breitner wrote: > Hi, > > Am Dienstag, den 31.01.2017, 15:22 -0500 schrieb Joachim Breitner: > > I recently wrote this applicative functor: > > > > data OneStep a = OneStep a [a] > > > > instance Functor OneStep where > > fmap f (OneStep o s) = OneStep (f o) (map f s) > > > > instance Applicative OneStep where > > pure x = OneStep x [] > > OneStep f fs <*> OneStep x xs = OneStep (f x) (map ($x) fs ++ > > map f xs) > > > > takeOneStep :: OneStep t -> [t] > > takeOneStep (OneStep _ xs) = xs > > > > This was useful in the context of writing a shrink for QuickCheck, as > > discussed at http://stackoverflow.com/a/41944525/946226. > > > > Now I wonder: Does this functor have a proper name? Does it already > > exist in the libraries somewhere? Should it? > > I guess it does not exist, so I am preparing a package for it here: > https://github.com/nomeata/haskell-successors > > The source code contains (in comments) a proof of the Applicative laws. > > My gut feeling says that this does not have a Monad instance that is > compatible with the given Applicative instance, but it is too late > today to substantiate this feeling. If anyone feels like puzzling: Can > you come up with a Monad instance, or (more likely) give good reasons > why there cannot be one? How about this? hd (OneStep x xs) = x instance Monad OneStep where OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) where OneStep y ys = f x Not sure if it’s good for anything, but it seems valid and consistent based on a preliminary investigation. -- Dave Menendez -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg.grenrus at iki.fi Wed Feb 1 07:34:10 2017 From: oleg.grenrus at iki.fi (Oleg Grenrus) Date: Wed, 1 Feb 2017 09:34:10 +0200 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> Message-ID: These instances are quite similar to https://github.com/ambiata/disorder.hs/blob/ce9ffc1139e32eaa9b82a1a6e2cfeb914d3f705c/disorder-jack/src/Disorder/Jack/Tree.hs#L62-L82 (I wish `disorder-jack` were already on Hackage!) - Oleg On 01.02.2017 07:28, David Menendez wrote: > On Tue, Jan 31, 2017 at 11:55 PM, Joachim Breitner > > wrote: > > Hi, > > Am Dienstag, den 31.01.2017, 15:22 -0500 schrieb Joachim Breitner: > > I recently wrote this applicative functor: > > > > data OneStep a = OneStep a [a] > > > > instance Functor OneStep where > > fmap f (OneStep o s) = OneStep (f o) (map f s) > > > > instance Applicative OneStep where > > pure x = OneStep x [] > > OneStep f fs <*> OneStep x xs = OneStep (f x) (map ($x) > fs ++ > > map f xs) > > > > takeOneStep :: OneStep t -> [t] > > takeOneStep (OneStep _ xs) = xs > > > > This was useful in the context of writing a shrink for > QuickCheck, as > > discussed at http://stackoverflow.com/a/41944525/946226 > . > > > > Now I wonder: Does this functor have a proper name? Does it already > > exist in the libraries somewhere? Should it? > > I guess it does not exist, so I am preparing a package for it here: > https://github.com/nomeata/haskell-successors > > > The source code contains (in comments) a proof of the Applicative > laws. > > My gut feeling says that this does not have a Monad instance that is > compatible with the given Applicative instance, but it is too late > today to substantiate this feeling. If anyone feels like puzzling: Can > you come up with a Monad instance, or (more likely) give good reasons > why there cannot be one? > > > How about this? > > hd (OneStep x xs) = x > > instance Monad OneStep where > OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) > where > OneStep y ys = f x > > Not sure if it’s good for anything, but it seems valid and consistent > based on a preliminary investigation. > > -- > Dave Menendez > > > > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From mail at joachim-breitner.de Wed Feb 1 15:33:53 2017 From: mail at joachim-breitner.de (Joachim Breitner) Date: Wed, 01 Feb 2017 10:33:53 -0500 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> Message-ID: <1485963233.14724.3.camel@joachim-breitner.de> Hi, David wrote: > How about this? > > hd (OneStep x xs) = x > > instance Monad OneStep where >     OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) >         where >         OneStep y ys = f x > > Not sure if it’s good for anything, but it seems valid and consistent > based on a preliminary investigation. Yes, this looks reasonable. Did you happen to already work through the monad laws? Am Mittwoch, den 01.02.2017, 09:34 +0200 schrieb Oleg Grenrus: > These instances are quite similar to > > https://github.com/ambiata/disorder.hs/blob/ce9ffc1139e32eaa9b82a1a6e > 2cfeb914d3f705c/disorder-jack/src/Disorder/Jack/Tree.hs#L62-L82 > well spotted. It is indeed the same idea, with my Succs (or OneStep or whatever name is most appropriate) modeling only one step, and the tree modeling, well, a whole tree. Also thanks for pointing out disorder-jack, that looks like a nice approach! Greetings, Joachim -- Joachim “nomeata” Breitner   mail at joachim-breitner.de • https://www.joachim-breitner.de/   XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F   Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Wed Feb 1 17:39:06 2017 From: mail at joachim-breitner.de (Joachim Breitner) Date: Wed, 01 Feb 2017 12:39:06 -0500 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: <1485963233.14724.3.camel@joachim-breitner.de> References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> <1485963233.14724.3.camel@joachim-breitner.de> Message-ID: <1485970746.14724.5.camel@joachim-breitner.de> Hi, Am Mittwoch, den 01.02.2017, 10:33 -0500 schrieb Joachim Breitner: > Hi, > > David wrote: > > How about this? > > > > hd (OneStep x xs) = x > > > > instance Monad OneStep where > >     OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) > >         where > >         OneStep y ys = f x > > > > Not sure if it’s good for anything, but it seems valid and consistent > > based on a preliminary investigation. > > > Yes, this looks reasonable. Did you happen to already work through the > monad laws?  Just did, all looks fine: https://github.com/nomeata/haskell-successors/blob/c1fd614cb0fc3e3b5dbf0338f835a91ea78e0b63/src/Control/Applicative/Successors.hs#L82 Uploaded to http://hackage.haskell.org/package/successors in case someone wants to play with it. Greetings, Joachim -- Joachim “nomeata” Breitner   mail at joachim-breitner.de • https://www.joachim-breitner.de/   XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F   Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: From simon.jakobi at googlemail.com Wed Feb 1 18:13:43 2017 From: simon.jakobi at googlemail.com (Simon Jakobi) Date: Wed, 1 Feb 2017 19:13:43 +0100 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: <1485970746.14724.5.camel@joachim-breitner.de> References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> <1485963233.14724.3.camel@joachim-breitner.de> <1485970746.14724.5.camel@joachim-breitner.de> Message-ID: Hi Joachim, that's a very interesting type, thanks for sharing it! Please note that in the rendering of the package description at http://hackage.haskell.org/package/successors, the <*> is slightly mangled. Cheers, Simon 2017-02-01 18:39 GMT+01:00 Joachim Breitner : > Hi, > > Am Mittwoch, den 01.02.2017, 10:33 -0500 schrieb Joachim Breitner: >> Hi, >> >> David wrote: >> > How about this? >> > >> > hd (OneStep x xs) = x >> > >> > instance Monad OneStep where >> > OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) >> > where >> > OneStep y ys = f x >> > >> > Not sure if it’s good for anything, but it seems valid and consistent >> > based on a preliminary investigation. >> >> >> Yes, this looks reasonable. Did you happen to already work through the >> monad laws? > > Just did, all looks fine: > https://github.com/nomeata/haskell-successors/blob/c1fd614cb0fc3e3b5dbf0338f835a91ea78e0b63/src/Control/Applicative/Successors.hs#L82 > > Uploaded to http://hackage.haskell.org/package/successors in case > someone wants to play with it. > > Greetings, > Joachim > -- > Joachim “nomeata” Breitner > mail at joachim-breitner.de • https://www.joachim-breitner.de/ > XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F > Debian Developer: nomeata at debian.org > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From gershomb at gmail.com Wed Feb 1 18:50:31 2017 From: gershomb at gmail.com (Gershom B) Date: Wed, 1 Feb 2017 13:50:31 -0500 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> <1485963233.14724.3.camel@joachim-breitner.de> <1485970746.14724.5.camel@joachim-breitner.de> Message-ID: Indeed a very interesting type! In the spirit of the “twisting pointers” paper’s construction of applicative structure from semi-direct products [1], I would speculate that this is a form of applicative created from the _direct product_ of two underlying applicatives that share some sort of mutually distributive relationship… (in this case, identity and list), with one of the actions being trivial. Somethign that might be enlightening, again following twisted pointers, is to reformulate the Applicative Functor instance as a Monoidal Functor instance... [1] http://ozark.hendrix.edu/~yorgey/pub/twisted.pdf Cheers, Gershom On February 1, 2017 at 1:16:08 PM, Simon Jakobi via Haskell-Cafe (haskell-cafe at haskell.org) wrote: > Hi Joachim, > > that's a very interesting type, thanks for sharing it! > > Please note that in the rendering of the package description at > http://hackage.haskell.org/package/successors, the <*> is slightly > mangled. > > Cheers, > Simon > > 2017-02-01 18:39 GMT+01:00 Joachim Breitner : > > Hi, > > > > Am Mittwoch, den 01.02.2017, 10:33 -0500 schrieb Joachim Breitner: > >> Hi, > >> > >> David wrote: > >> > How about this? > >> > > >> > hd (OneStep x xs) = x > >> > > >> > instance Monad OneStep where > >> > OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) > >> > where > >> > OneStep y ys = f x > >> > > >> > Not sure if it’s good for anything, but it seems valid and consistent > >> > based on a preliminary investigation. > >> > >> > >> Yes, this looks reasonable. Did you happen to already work through the > >> monad laws? > > > > Just did, all looks fine: > > https://github.com/nomeata/haskell-successors/blob/c1fd614cb0fc3e3b5dbf0338f835a91ea78e0b63/src/Control/Applicative/Successors.hs#L82 > > > > Uploaded to http://hackage.haskell.org/package/successors in case > > someone wants to play with it. > > > > Greetings, > > Joachim > > -- > > Joachim “nomeata” Breitner > > mail at joachim-breitner.de • https://www.joachim-breitner.de/ > > XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F > > Debian Developer: nomeata at debian.org > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From mail at joachim-breitner.de Wed Feb 1 19:03:47 2017 From: mail at joachim-breitner.de (Joachim Breitner) Date: Wed, 01 Feb 2017 14:03:47 -0500 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> <1485963233.14724.3.camel@joachim-breitner.de> <1485970746.14724.5.camel@joachim-breitner.de> Message-ID: <1485975827.14724.8.camel@joachim-breitner.de> Hi, already fixed in the repo, but not worth an upload. Thanks! Joachim Am Mittwoch, den 01.02.2017, 19:13 +0100 schrieb Simon Jakobi via Haskell-Cafe: > Hi Joachim, > > that's a very interesting type, thanks for sharing it! > > Please note that in the rendering of the package description at > http://hackage.haskell.org/package/successors, the <*> is slightly > mangled. > > Cheers, > Simon > > 2017-02-01 18:39 GMT+01:00 Joachim Breitner >: > > Hi, > > > > Am Mittwoch, den 01.02.2017, 10:33 -0500 schrieb Joachim Breitner: > > > Hi, > > > > > > David wrote: > > > > How about this? > > > > > > > > hd (OneStep x xs) = x > > > > > > > > instance Monad OneStep where > > > >     OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) > > > >         where > > > >         OneStep y ys = f x > > > > > > > > Not sure if it’s good for anything, but it seems valid and > > > > consistent > > > > based on a preliminary investigation. > > > > > > > > > Yes, this looks reasonable. Did you happen to already work > > > through the > > > monad laws? > > > > Just did, all looks fine: > > https://github.com/nomeata/haskell-successors/blob/c1fd614cb0fc3e3b > > 5dbf0338f835a91ea78e0b63/src/Control/Applicative/Successors.hs#L82 > > > > Uploaded to http://hackage.haskell.org/package/successors in case > > someone wants to play with it. > > > > Greetings, > > Joachim > > -- > > Joachim “nomeata” Breitner > >   mail at joachim-breitner.de • https://www.joachim-breitner.de/ > >   XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F > >   Debian Developer: nomeata at debian.org > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Joachim “nomeata” Breitner   mail at joachim-breitner.de • https://www.joachim-breitner.de/   XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F   Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: This is a digitally signed message part URL: From nikivazou at gmail.com Thu Feb 2 14:41:23 2017 From: nikivazou at gmail.com (Niki Vazou) Date: Thu, 2 Feb 2017 09:41:23 -0500 Subject: [Haskell-cafe] Ideas for Haskell Summer of Code Message-ID: Hello, As a preparation for the 2017 edition of Haskell Summer of Code, we are crowdsourcing project ideas. Compiler optimizations, new libraries, desired features, or any other ideas you would like to see in the Haskell ecosystem. You can submit tickets to the Haskell Summer of Code Ideas page: https://ghc.haskell.org/trac/summer-of-code/report/1 Alternatively, you can tell us your SoC idea by responding to this thread (and I can generate the ticket). Best, Niki -------------- next part -------------- An HTML attachment was scrubbed... URL: From dennis.raddle at gmail.com Fri Feb 3 00:50:27 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Thu, 2 Feb 2017 16:50:27 -0800 Subject: [Haskell-cafe] using ghci with compiled code Message-ID: I want to use ghci to interpret parts of my program, and I would like it to pick up pre-compiled object files to speed things up in other parts. Right now whenever I launch ghci it seems to "compile" everything (I think to byte code).. what can I do? D -------------- next part -------------- An HTML attachment was scrubbed... URL: From dennis.raddle at gmail.com Fri Feb 3 01:16:49 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Thu, 2 Feb 2017 17:16:49 -0800 Subject: [Haskell-cafe] segfault with Hint (InterpreterT) Message-ID: My program segfaults the second time it run runInterpreterT. Just wondering if that's not supposed to be allowed. I'm actually not sure what triggers the segfault -- it's also doing some MIDI I/O. D -------------- next part -------------- An HTML attachment was scrubbed... URL: From dennis.raddle at gmail.com Fri Feb 3 09:29:40 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Fri, 3 Feb 2017 01:29:40 -0800 Subject: [Haskell-cafe] is there less available support for beginners these days? Message-ID: I'm a Haskell hobbyist enthusiast -- first learned it in 2008, struggling having come from an imperative language background, and I only get to use it in hobby projects, but I love it more each year. I still consider myself a beginner in many areas. Unfortunately it used to be much easier to get responses on the beginner's list or the #haskell channel. I've now had several posts go completely unanswered on the beginner's list, and can't get help from #haskell most of the time (by "help" I mean someone who takes just a few minutes with me). I've tried posting on Haskell cafe in the hopes I would get more responses and I'm not sure if that's going to work (or is appropriate). D -------------- next part -------------- An HTML attachment was scrubbed... URL: From ollie at ocharles.org.uk Fri Feb 3 10:21:10 2017 From: ollie at ocharles.org.uk (Oliver Charles) Date: Fri, 03 Feb 2017 10:21:10 +0000 Subject: [Haskell-cafe] is there less available support for beginners these days? In-Reply-To: References: Message-ID: Have you tried the Haskell StackOverflow board ? It could just be that people have moved away from mailing lists and IRC. After all, almost a decade has passed! - ocharles On Fri, Feb 3, 2017 at 9:32 AM Dennis Raddle wrote: > I'm a Haskell hobbyist enthusiast -- first learned it in 2008, struggling > having come from an imperative language background, and I only get to use > it in hobby projects, but I love it more each year. I still consider myself > a beginner in many areas. > > Unfortunately it used to be much easier to get responses on the beginner's > list or the #haskell channel. I've now had several posts go completely > unanswered on the beginner's list, and can't get help from #haskell most of > the time (by "help" I mean someone who takes just a few minutes with me). > I've tried posting on Haskell cafe in the hopes I would get more responses > and I'm not sure if that's going to work (or is appropriate). > > D > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aeroboy94 at gmail.com Fri Feb 3 10:51:58 2017 From: aeroboy94 at gmail.com (Arian van Putten) Date: Fri, 03 Feb 2017 10:51:58 +0000 Subject: [Haskell-cafe] is there less available support for beginners these days? In-Reply-To: References: Message-ID: I find #haskell-beginners is pretty active On Fri, 3 Feb 2017, 11:23 Oliver Charles, wrote: > Have you tried the Haskell StackOverflow board > ? It could just be > that people have moved away from mailing lists and IRC. After all, almost a > decade has passed! > > - ocharles > > On Fri, Feb 3, 2017 at 9:32 AM Dennis Raddle > wrote: > > I'm a Haskell hobbyist enthusiast -- first learned it in 2008, struggling > having come from an imperative language background, and I only get to use > it in hobby projects, but I love it more each year. I still consider myself > a beginner in many areas. > > Unfortunately it used to be much easier to get responses on the beginner's > list or the #haskell channel. I've now had several posts go completely > unanswered on the beginner's list, and can't get help from #haskell most of > the time (by "help" I mean someone who takes just a few minutes with me). > I've tried posting on Haskell cafe in the hopes I would get more responses > and I'm not sure if that's going to work (or is appropriate). > > D > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From fr33domlover at riseup.net Fri Feb 3 11:40:44 2017 From: fr33domlover at riseup.net (fr33domlover) Date: Fri, 3 Feb 2017 13:40:44 +0200 Subject: [Haskell-cafe] Project hosting platform - looking for new developer Message-ID: <20170203112243.20B17BC96C@haskell.org> (tl;dr Git and Darcs hosting platform with planned federation written in Yesod, I'm looking for someone excited about the idea to take over development) Hello Haskellers, Several months ago I started developing a project hosting platform called Vervis. It's written in Haskell using the Yesod web framework. The intention was to make it federated and allow people for the first time in git (and darcs) history to enjoy both the full access to the community and avoid the proprietaryness and centralization of githu8. I'm probably still really a beginner and I never made any web application before Vervis, or even an actual mature stable software project. But I made huge progress with Vervis very fast, and I created something you can actually see with your eyes :) However due to certain life preferences I stopped working on it and I may never go back to it. But I was hoping someone else would want to continue its development. The code is hosted both at Darcs Hub and in a Vervis instance, so the project is self-hosting: https://dev.seek-together.space/s/fr33domlover/r/vervis I didn't work on design much, just focused on functionality. Among the unique features already present one one way or another: - Supports both Git and Darcs - Rendering of documents using Pandoc, supporting more formats and variants than any other platform could - Support of Libravatar for user avatar images - Flexible integrated system for project management and issues, on the level you can find in project management platforms, but here it's integrated into the code hosting platform itself - Hierarchical discussion threads - A single project can contain more than one repo, i.e. repos can share the same project plan and the same issue database - Merely being written in Haskell and Yesod makes it very stable once it builds successfully There are still many quirks, including the UI of the registration system and UI in general, so I'm sorry in advance if you try to create an account there and get errors or confusing UIs. It's not polished or anything yet. I also made several support projects and implemented some helper tools, such as some support for parsing darcs repos (attoparsec stuff that can and maybe should be merged into Darcs itself), SSH server component that uses an improved version of the ssh package, hierarchical SQL query API with an interface similar to the FGL library, code for working with git repos... and probably more things I'm forgetting. If you have any questions, I'm here to answer :) --fr33 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 801 bytes Desc: OpenPGP digital signature URL: From toad3k at gmail.com Fri Feb 3 13:24:28 2017 From: toad3k at gmail.com (David McBride) Date: Fri, 3 Feb 2017 08:24:28 -0500 Subject: [Haskell-cafe] is there less available support for beginners these days? In-Reply-To: References: Message-ID: I would say from looking at your last few emails, that you are asking questions, mostly about tooling, that no one really knows the answer to, so they don't answer. Congratulations you are not a newbie anymore. Stackoverflow is better for questions that might not have an answer because people will see unanswered questions for weeks or months whereas on the lists, if someone doesn't have an immediate answer they will forget about it. On Fri, Feb 3, 2017 at 4:29 AM, Dennis Raddle wrote: > I'm a Haskell hobbyist enthusiast -- first learned it in 2008, struggling > having come from an imperative language background, and I only get to use it > in hobby projects, but I love it more each year. I still consider myself a > beginner in many areas. > > Unfortunately it used to be much easier to get responses on the beginner's > list or the #haskell channel. I've now had several posts go completely > unanswered on the beginner's list, and can't get help from #haskell most of > the time (by "help" I mean someone who takes just a few minutes with me). > I've tried posting on Haskell cafe in the hopes I would get more responses > and I'm not sure if that's going to work (or is appropriate). > > D > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From lanablack at amok.cc Fri Feb 3 13:26:07 2017 From: lanablack at amok.cc (Lana Black) Date: Fri, 3 Feb 2017 13:26:07 +0000 Subject: [Haskell-cafe] segfault with Hint (InterpreterT) In-Reply-To: References: Message-ID: <357f1175-e4e3-ec94-2e3f-07ba22636f8c@amok.cc> On 03/02/17 01:16, Dennis Raddle wrote: > My program segfaults the second time it run runInterpreterT. Just > wondering if that's not supposed to be allowed. I'm actually not sure > what triggers the segfault -- it's also doing some MIDI I/O. > > D > > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > Being able to see the code would be useful in order to help you in this case :) Anyway, from my experience, segfaults while using hint are usually caused by invalid type coercions. That's the first thing you should check. From fa-ml at ariis.it Fri Feb 3 14:00:30 2017 From: fa-ml at ariis.it (Francesco Ariis) Date: Fri, 3 Feb 2017 15:00:30 +0100 Subject: [Haskell-cafe] is there less available support for beginners these days? In-Reply-To: References: Message-ID: <20170203140030.GA24501@casa.casa> On Fri, Feb 03, 2017 at 01:29:40AM -0800, Dennis Raddle wrote: > Unfortunately it used to be much easier to get responses on the beginner's > list or the #haskell channel. I've now had several posts go completely > unanswered on the beginner's list, and can't get help from #haskell most of > the time (by "help" I mean someone who takes just a few minutes with me). > I've tried posting on Haskell cafe in the hopes I would get more responses > and I'm not sure if that's going to work (or is appropriate). Your last post on beginners (segfault with Hint (InterpreterT)) doesn't provide code. > My program segfaults the second time it run runInterpreterT. Just wondering > if that's not supposed to be allowed. I'm actually not sure what triggers > the segfault -- it's also doing some MIDI I/O. > > D Few persons will even bother to try without a minimal example which they can replicate on their machine, here or on SO or anywhere else. From dennis.raddle at gmail.com Fri Feb 3 14:19:37 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Fri, 3 Feb 2017 06:19:37 -0800 Subject: [Haskell-cafe] segfault with Hint (InterpreterT) In-Reply-To: <357f1175-e4e3-ec94-2e3f-07ba22636f8c@amok.cc> References: <357f1175-e4e3-ec94-2e3f-07ba22636f8c@amok.cc> Message-ID: You are right, I should try to construct a minimal example. I was hoping there might be some bit of information that could guide me in what to try, as far as taking my rather large program as-is and varying it. Constructing a minimal example will be, potentially a lot of work and may not even segfault -- but that is how it works, you are right, one must provide a minimal example or at least some actual code. D -------------- next part -------------- An HTML attachment was scrubbed... URL: From dennis.raddle at gmail.com Fri Feb 3 14:22:03 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Fri, 3 Feb 2017 06:22:03 -0800 Subject: [Haskell-cafe] is there less available support for beginners these days? In-Reply-To: <20170203140030.GA24501@casa.casa> References: <20170203140030.GA24501@casa.casa> Message-ID: Yes, good points. Most of my questions are not as difficult as a segfault, and it definitely was easier to get newbie help some number of years ago. For my Hint segfault, I definitely need to construct a minimal example and will do that shortly. d On Fri, Feb 3, 2017 at 6:00 AM, Francesco Ariis wrote: > On Fri, Feb 03, 2017 at 01:29:40AM -0800, Dennis Raddle wrote: > > Unfortunately it used to be much easier to get responses on the > beginner's > > list or the #haskell channel. I've now had several posts go completely > > unanswered on the beginner's list, and can't get help from #haskell most > of > > the time (by "help" I mean someone who takes just a few minutes with me). > > I've tried posting on Haskell cafe in the hopes I would get more > responses > > and I'm not sure if that's going to work (or is appropriate). > > Your last post on beginners (segfault with Hint (InterpreterT)) doesn't > provide code. > > > My program segfaults the second time it run runInterpreterT. Just > wondering > > if that's not supposed to be allowed. I'm actually not sure what triggers > > the segfault -- it's also doing some MIDI I/O. > > > > D > > Few persons will even bother to try without a minimal example which they > can replicate on their machine, here or on SO or anywhere else. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at nh2.me Fri Feb 3 15:10:46 2017 From: mail at nh2.me (=?UTF-8?Q?Niklas_Hamb=c3=bcchen?=) Date: Fri, 3 Feb 2017 16:10:46 +0100 Subject: [Haskell-cafe] segfault with Hint (InterpreterT) In-Reply-To: References: <357f1175-e4e3-ec94-2e3f-07ba22636f8c@amok.cc> Message-ID: <17c7b251-b9fa-cef8-5a8a-5c0f0a941a4d@nh2.me> There are also some other quick things you could try (unless you've done that already), e.g. making sure that all C code is compiled with `-g`, and use gdb to attach to the dying process (or the `core` dump file that your OS may write when the segfault happens) and use `bt` to check if the segfault is actually in the Haskell runtime or not. And then of course, if your code is open-source, you might also be able to provide it as a whole before putting in the effort to minimise it. Niklas On 03/02/17 15:19, Dennis Raddle wrote: > You are right, I should try to construct a minimal example. I was hoping > there might be some bit of information that could guide me in what to > try, as far as taking my rather large program as-is and varying it. > Constructing a minimal example will be, potentially a lot of work and > may not even segfault -- but that is how it works, you are right, one > must provide a minimal example or at least some actual code. From parsonsmatt at gmail.com Fri Feb 3 16:32:45 2017 From: parsonsmatt at gmail.com (Matt) Date: Fri, 3 Feb 2017 11:32:45 -0500 Subject: [Haskell-cafe] Best way to provide monad transformer instances in library design? Message-ID: I'm writing a wrapper around ekg which provides an MTL-style class for recording metrics [1], and now I'm trying to figure out how to make the class usable for clients. I'm conflicted on the numerous ways to approach the problem. I would like to provide the best UX for the library, and want to consider viewpoints other than my own. Currently, the class is: class MonadMetrics m where getMetrics :: m Metrics I currently don't provide any concrete transformer, instead requiring that users define it for their own stacks. I'd like to make it easier to use. I can provide a concrete transformer newtype MetricT m a = MetricT (ReaderT Metrics m a) instance Monad m => MonadMetrics (MetricT m) where getMetrics = MetricT ask and then provide a wide variety of pass through instances. This approach requires a large amount of boilerplate, and for any instances I forget to provide, will require that clients make their own orphan instances. It also incurs additional dependencies just for writing instances. I can provide a more abstract transformer and a more general Metrics class: class HasMetrics r where metrics :: Lens' r Metrics newtype MetricT2 m a = MetricT2 (m a) instance (MonadReader r m, HasMetrics r) => MonadMetrics (MetricT2 m) where getMetrics = MetricT (view metrics) but this still requires those pass through instances. Finally, I can scrap `MonadMetrics` as anything other than a class alias: class (MonadReader r m, MonadIO m, HasMetrics r) => MonadMetrics r m instance (MonadReader r m, MonadIO m, HasMetrics r) => MonadMetrics r m but now I have UndecidableInstances and a multiparam type class, and I'm not sure how well this actually plays out in the wild. What are your thoughts on this issue? Matt Parsons [1]: https://github.com/sellerlabs/monad-metrics -------------- next part -------------- An HTML attachment was scrubbed... URL: From aditya.siram at gmail.com Fri Feb 3 17:38:16 2017 From: aditya.siram at gmail.com (aditya siram) Date: Fri, 3 Feb 2017 11:38:16 -0600 Subject: [Haskell-cafe] Getting added to the Haskell group on Github. Message-ID: Hi, Some time ago the maintainership of c2hs [1] was silently passed to me. However I am unable to request access to the repo because I am not on the Haskell team [2]. Apparently I have to be added by someone already on the team but I'm having trouble getting in touch with someone. If anyone reading this is on the team [2] please add me. I'm @deech on Github. Thanks! -deech [1] https://github.com/haskell/c2hs [2] https://github.com/orgs/haskell/people -------------- next part -------------- An HTML attachment was scrubbed... URL: From trebla at vex.net Fri Feb 3 21:50:13 2017 From: trebla at vex.net (Albert Y. C. Lai) Date: Fri, 3 Feb 2017 16:50:13 -0500 Subject: [Haskell-cafe] using ghci with compiled code In-Reply-To: References: Message-ID: <78d1d83c-62c1-f825-ae97-ba532c4571ac@vex.net> On 2017-02-02 07:50 PM, Dennis Raddle wrote: > I want to use ghci to interpret parts of my program, and I would like it > to pick up pre-compiled object files to speed things up in other parts. > Right now whenever I launch ghci it seems to "compile" everything (I > think to byte code).. what can I do? Read the GHC Users Guide section 5.3 "loading compiled code". The GHC Users Guide comes with GHC and is somewhere on your hard disk. From dennis.raddle at gmail.com Sat Feb 4 01:20:17 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Fri, 3 Feb 2017 17:20:17 -0800 Subject: [Haskell-cafe] using ghci with compiled code In-Reply-To: <78d1d83c-62c1-f825-ae97-ba532c4571ac@vex.net> References: <78d1d83c-62c1-f825-ae97-ba532c4571ac@vex.net> Message-ID: I suspect I need to try the -dynamic flag to ghc when compiling-- that may be my problem. I'll try it. On Fri, Feb 3, 2017 at 1:50 PM, Albert Y. C. Lai wrote: > On 2017-02-02 07:50 PM, Dennis Raddle wrote: > >> I want to use ghci to interpret parts of my program, and I would like it >> to pick up pre-compiled object files to speed things up in other parts. >> Right now whenever I launch ghci it seems to "compile" everything (I >> think to byte code).. what can I do? >> > > Read the GHC Users Guide section 5.3 "loading compiled code". The GHC > Users Guide comes with GHC and is somewhere on your hard disk. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gurudev.devanla at gmail.com Sat Feb 4 15:06:55 2017 From: gurudev.devanla at gmail.com (Guru Devanla) Date: Sat, 4 Feb 2017 07:06:55 -0800 Subject: [Haskell-cafe] Purpose of Control.Monad.Base class Message-ID: Hello, I am trying to understand the purpose of the MonadBase class. https://hackage.haskell.org/package/transformers-base-0.4.4/docs/Control-Monad-Base.html Google search did not give me any helpful answers. Please could some one help me understand the purpose of this class and also point me to any good resources. Thanks Guru -------------- next part -------------- An HTML attachment was scrubbed... URL: From headprogrammingczar at gmail.com Sat Feb 4 15:13:35 2017 From: headprogrammingczar at gmail.com (Joe Quinn) Date: Sat, 4 Feb 2017 10:13:35 -0500 Subject: [Haskell-cafe] Purpose of Control.Monad.Base class In-Reply-To: References: Message-ID: <9aa73d02-f97e-7565-1e6a-2f43666c02b8@gmail.com> It's a version of lift that penetrates a long chain of MonadTrans-y types. It's a more general version of things like this: https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-State-Class.html#t:MonadState Pay attention to the instances, and work out how they resolve this: liftBase :: IO a -> IdentityT (IdentityT (IdentityT IO)) a On 2/4/2017 10:06 AM, Guru Devanla wrote: > Hello, > > I am trying to understand the purpose of the MonadBase class. > > https://hackage.haskell.org/package/transformers-base-0.4.4/docs/Control-Monad-Base.html > > Google search did not give me any helpful answers. Please could some > one help me understand the purpose of this class and also point me to > any good resources. > > Thanks > Guru > > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From heraldhoi at gmail.com Sat Feb 4 18:19:31 2017 From: heraldhoi at gmail.com (Geraldus) Date: Sat, 04 Feb 2017 18:19:31 +0000 Subject: [Haskell-cafe] Cleanup obsolete stack stuff (compiler, libraries, etc.) Message-ID: Hi folks! I want to perform some cleanup deleting obsolete compilers located in ~/.stack folder. I know stack places them into ~/.stack/programs// directory, however I think there are also should be something else related, e.g. docs and libs, and especially packages that was built when I used old LTS snapshots. What is the best way to perform such cleanup? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aditya.siram at gmail.com Sat Feb 4 18:19:10 2017 From: aditya.siram at gmail.com (aditya siram) Date: Sat, 4 Feb 2017 12:19:10 -0600 Subject: [Haskell-cafe] Getting added to the Haskell group on Github. In-Reply-To: References: Message-ID: Bump. On Fri, Feb 3, 2017 at 11:38 AM, aditya siram wrote: > Hi, > Some time ago the maintainership of c2hs [1] was silently passed to me. > However I am unable to request access to the repo because I am not on the > Haskell team [2]. Apparently I have to be added by someone already on the > team but I'm having trouble getting in touch with someone. If anyone > reading this is on the team [2] please add me. I'm @deech on Github. > > Thanks! > -deech > > > [1] https://github.com/haskell/c2hs > [2] https://github.com/orgs/haskell/people > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gershomb at gmail.com Sat Feb 4 18:53:21 2017 From: gershomb at gmail.com (Gershom B) Date: Sat, 4 Feb 2017 13:53:21 -0500 Subject: [Haskell-cafe] Getting added to the Haskell group on Github. In-Reply-To: References: Message-ID: Invite sent! -g On February 4, 2017 at 1:23:34 PM, aditya siram (aditya.siram at gmail.com) wrote: > Bump. > > On Fri, Feb 3, 2017 at 11:38 AM, aditya siram > wrote: > > > Hi, > > Some time ago the maintainership of c2hs [1] was silently passed to me. > > However I am unable to request access to the repo because I am not on the > > Haskell team [2]. Apparently I have to be added by someone already on the > > team but I'm having trouble getting in touch with someone. If anyone > > reading this is on the team [2] please add me. I'm @deech on Github. > > > > Thanks! > > -deech > > > > > > [1] https://github.com/haskell/c2hs > > [2] https://github.com/orgs/haskell/people > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From csasarak at mailbox.org Sat Feb 4 19:31:43 2017 From: csasarak at mailbox.org (Christopher Sasarak) Date: Sat, 04 Feb 2017 14:31:43 -0500 Subject: [Haskell-cafe] ghci, running :load on filename provided by variable In-Reply-To: References: Message-ID: <87mve1da74.fsf@mailbox.org> I'm not sure that you can, is there any particular reason to not make the file a module and use import? -Chris Dennis Raddle writes: > How do I load a file in ghci where the filename comes from a variable? > > So like, > let f = "myfile.hs" > :load f > > D > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Best, Chris From gboulougaris at gmail.com Sat Feb 4 20:20:13 2017 From: gboulougaris at gmail.com (George Boulougaris) Date: Sat, 4 Feb 2017 22:20:13 +0200 Subject: [Haskell-cafe] QuickCheck and State monad Message-ID: Hello, I have written a Haskell module that contains functions that operate on some state. Let's say that the code looks like this (the actual functions may return an actual result instead of `()`, but this is irrelevant to the question): data StateContext = StateContext { -- some records } handleEventA :: EventA -> State StateContext () handleEventB :: EventB -> State StateContext () handleEventC :: EventC -> State StateContext () As you can imagine the behavior of each function depends on the current state. For example `handleEventA >> handleEventB` will not produce the same result as `handleEventB >> handleEventA`. So I have several HUnit tests that verify the behavior of each function at several states. But now I would like to write more tests, that exercise all functions at all possible states (the number of states is finite). Writing them with HUnit would be quite labor-itensive, so I thought that using QuickCheck might be helpful in that case (I have only used it before for trivial functions). But I cannot see which properties should I test, or what kind of data should the test generate. I suspect that the test should generate random sequence of events (e.g. `handleEventB >> handleEventC >> handleEventA` etc), but I cannot see what properties should be satisfied. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From qdunkan at gmail.com Sat Feb 4 20:51:49 2017 From: qdunkan at gmail.com (Evan Laforge) Date: Sat, 4 Feb 2017 12:51:49 -0800 Subject: [Haskell-cafe] ghci, running :load on filename provided by variable In-Reply-To: References: Message-ID: Check out the :def command. On Jan 24, 2017 2:34 PM, "Dennis Raddle" wrote: > How do I load a file in ghci where the filename comes from a variable? > > So like, > let f = "myfile.hs" > :load f > > D > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mihai.maruseac at gmail.com Sat Feb 4 21:04:25 2017 From: mihai.maruseac at gmail.com (Mihai Maruseac) Date: Sat, 4 Feb 2017 13:04:25 -0800 Subject: [Haskell-cafe] QuickCheck and State monad In-Reply-To: References: Message-ID: I'm assuming that each state in your example has something to differentiate it from the others. That can be expanded to some properties to test. Another thing is that one event can move you from one state to only a set of states. This can also be encoded as a property. Finally, try to see if there are some properties/invariants that hold when handling an event in a state. Doesn't have to be for all events and all states, but for those where you can find some it should be possible to write some tests. On Sat, Feb 4, 2017 at 12:20 PM, George Boulougaris wrote: > Hello, > > I have written a Haskell module that contains functions that operate on some > state. Let's say that the code looks like this (the actual functions may > return an actual result instead of `()`, but this is irrelevant to the > question): > > data StateContext = StateContext { > -- some records > } > > handleEventA :: EventA -> State StateContext () > handleEventB :: EventB -> State StateContext () > handleEventC :: EventC -> State StateContext () > > As you can imagine the behavior of each function depends on the current > state. For example `handleEventA >> handleEventB` will not produce the same > result as `handleEventB >> handleEventA`. So I have several HUnit tests that > verify the behavior of each function at several states. > > But now I would like to write more tests, that exercise all functions at all > possible states (the number of states is finite). Writing them with HUnit > would be quite labor-itensive, so I thought that using QuickCheck might be > helpful in that case (I have only used it before for trivial functions). > > But I cannot see which properties should I test, or what kind of data should > the test generate. I suspect that the test should generate random sequence > of events (e.g. `handleEventB >> handleEventC >> handleEventA` etc), but I > cannot see what properties should be satisfied. > > Thanks > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Mihai Maruseac (MM) "If you can't solve a problem, then there's an easier problem you can solve: find it." -- George Polya From palotai.robin at gmail.com Sun Feb 5 03:41:54 2017 From: palotai.robin at gmail.com (Robin Palotai) Date: Sun, 5 Feb 2017 04:41:54 +0100 Subject: [Haskell-cafe] QuickCheck and State monad In-Reply-To: References: Message-ID: A very powerful idea is described in Testing Monadic Code With QuickCheck[1] (or a pdf version at [2]). I think the ideas apply to non-monadic (or non IO-like monadic) code as well. The basic idea is to generate a sequence of events as test input, like events = [EventA, EventA, EventC, EventB] and execute the corresponding actions (starting from an initial state). Now you can make assertions on the final state S and events that happened. Some ideas for your case: - If EventB happened, S must be foo - If EventC never happened, S must be bar (note that negative event tests are very powerful) - S must have baz=0 only if the count of EventAs is same as count of EventBs after the first EventC - ... You can also compare final states resulting from different event sequences: - if E1 is a sequence with result S1, sticking EventD anywhere in E1 must also result in S1 - ... The paper goes into details about generating a valid event sequence, if there are restrictions about in which state can a given event happen. Section 3 & 4 are about testing that (the effect of) two given action sequences are equal, independent of previous/subsequent actions. This is useful if you don't only handle events, but can do some custom actions on your state. Like you can test that "foo >> barBaz" is always the same as "foo >> bar >> foo >> unicorn". Section 10-12 bring an other example. Section 13 shows a way to more easily generate a valid action sequence, but only in case you have a parallel abstract (pure) implementation, which is not often the case (except algos), and maybe this is really specific to IO/ST. [1]: www.cse.chalmers.se/~rjmh/Papers/QuickCheckST.ps [2]: https://www.researchgate.net/publication/2831386_Testing_Monadic_Code_with_QuickCheck Robin 2017-02-04 22:04 GMT+01:00 Mihai Maruseac : > I'm assuming that each state in your example has something to > differentiate it from the others. That can be expanded to some > properties to test. > > Another thing is that one event can move you from one state to only a > set of states. This can also be encoded as a property. > > Finally, try to see if there are some properties/invariants that hold > when handling an event in a state. Doesn't have to be for all events > and all states, but for those where you can find some it should be > possible to write some tests. > > On Sat, Feb 4, 2017 at 12:20 PM, George Boulougaris > wrote: > > Hello, > > > > I have written a Haskell module that contains functions that operate on > some > > state. Let's say that the code looks like this (the actual functions may > > return an actual result instead of `()`, but this is irrelevant to the > > question): > > > > data StateContext = StateContext { > > -- some records > > } > > > > handleEventA :: EventA -> State StateContext () > > handleEventB :: EventB -> State StateContext () > > handleEventC :: EventC -> State StateContext () > > > > As you can imagine the behavior of each function depends on the current > > state. For example `handleEventA >> handleEventB` will not produce the > same > > result as `handleEventB >> handleEventA`. So I have several HUnit tests > that > > verify the behavior of each function at several states. > > > > But now I would like to write more tests, that exercise all functions at > all > > possible states (the number of states is finite). Writing them with HUnit > > would be quite labor-itensive, so I thought that using QuickCheck might > be > > helpful in that case (I have only used it before for trivial functions). > > > > But I cannot see which properties should I test, or what kind of data > should > > the test generate. I suspect that the test should generate random > sequence > > of events (e.g. `handleEventB >> handleEventC >> handleEventA` etc), but > I > > cannot see what properties should be satisfied. > > > > Thanks > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > > > > -- > Mihai Maruseac (MM) > "If you can't solve a problem, then there's an easier problem you can > solve: find it." -- George Polya > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aditya.siram at gmail.com Sun Feb 5 18:51:51 2017 From: aditya.siram at gmail.com (aditya siram) Date: Sun, 5 Feb 2017 12:51:51 -0600 Subject: [Haskell-cafe] Removing Hackage packages Message-ID: Hi, I'd like to remove a couple of my packages [1] from Hackage. How do I do that? Thanks! -deech [1] http://hackage.haskell.org/package/fltkhs-demos, http://hackage.haskell.org/package/fltkhs-fluid-demos -------------- next part -------------- An HTML attachment was scrubbed... URL: From fa-ml at ariis.it Sun Feb 5 18:58:17 2017 From: fa-ml at ariis.it (Francesco Ariis) Date: Sun, 5 Feb 2017 19:58:17 +0100 Subject: [Haskell-cafe] Removing Hackage packages In-Reply-To: References: Message-ID: <20170205185817.GA382@casa.casa> On Sun, Feb 05, 2017 at 12:51:51PM -0600, aditya siram wrote: > Hi, > I'd like to remove a couple of my packages [1] from Hackage. How do I do > that? > Thanks! > -deech You can deprecate them from the maintainer's page. I think removing stuff from hackage is not contemplated, for a bunch of good reasons. From aditya.siram at gmail.com Sun Feb 5 19:03:33 2017 From: aditya.siram at gmail.com (aditya siram) Date: Sun, 5 Feb 2017 13:03:33 -0600 Subject: [Haskell-cafe] Removing Hackage packages In-Reply-To: <20170205185817.GA382@casa.casa> References: <20170205185817.GA382@casa.casa> Message-ID: If it's an issue of dependencies nothing should depend on these packages because they are end-user applications and ship only executables. On Sun, Feb 5, 2017 at 12:58 PM, Francesco Ariis wrote: > On Sun, Feb 05, 2017 at 12:51:51PM -0600, aditya siram wrote: > > Hi, > > I'd like to remove a couple of my packages [1] from Hackage. How do I do > > that? > > Thanks! > > -deech > > You can deprecate them from the maintainer's page. I think removing > stuff from hackage is not contemplated, for a bunch of good reasons. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ollie at ocharles.org.uk Sun Feb 5 23:24:23 2017 From: ollie at ocharles.org.uk (Oliver Charles) Date: Sun, 05 Feb 2017 23:24:23 +0000 Subject: [Haskell-cafe] Monad transformer performance - Request to review benchmarking code + results In-Reply-To: References: Message-ID: <87inoop6fs.fsf@nixos.i-did-not-set--mail-host-address--so-tickle-me> Saurabh Nanda writes: >> Why do you keep expecting the compiler to "be smart"? It's just shuffling >> data around, any type of magic efficiency with Monadic computations >> requires specific knowledge about monads, which is not something we encode >> into the compiler. just saying "this should be obvious" is not very >> productive. >> > > Two reasons: > > * If inlining certain functions can give a boost to the performance, then > is it unreasonable to expect the compiler to have better heuristics about > when commonly occurring code patterns should be inlined? In this case > monads and mtl being the commonly occurring code patterns. > > * At a broader level, the promise of writing pure functions was to be able > to talk about 'intent', not 'implementation' -- the classic `map` vs `for > loop` example. Additionally, pure functions give the compiler enough > opportunity to optimise code. Both these higher level promises are being > broken by this experience. Hence, I'm feeling "cheated" Inlining can only happen if the code to be inlined is available. This means explicitly marking things with {-# INLINE #-} or {-# INLINEABLE #-} (or GHC seeing something as "small" and deciding it's worth putting in the .hi file). If I give you "foo True" and tell you nothing more about "foo" - how are you going to optimise that? That's essentially what is happening - GHC has no more information so all it can do is just call the function and hope for the best. > Additionally, pure functions give the compiler enough > opportunity to optimise code. Both these higher level promises are being > broken by this experience. Hence, I'm feeling "cheated" Certainly, but the benefits of purity are different. We use purity to know that we can rewrite ASTs, introduce sharing, lift let-bindings up, move case statements around, and so on. This is very different that "understanding how monad transformers work". You still seem to be suggesting that "it's obvious" a compiler should be able to optimise this code, but without actually being able to inline the code and unleash all of GHC's optimisations, I'm not sure what else the compiler can do. It's just a black box otherwise. Of course, it's a shame that {-# INLINE #-} is almost a requirement for some types of performant code, but right now - it is what it is. -- ocharles From svenpanne at gmail.com Mon Feb 6 08:00:16 2017 From: svenpanne at gmail.com (Sven Panne) Date: Mon, 6 Feb 2017 09:00:16 +0100 Subject: [Haskell-cafe] Cleanup obsolete stack stuff (compiler, libraries, etc.) In-Reply-To: References: Message-ID: 2017-02-04 19:19 GMT+01:00 Geraldus : > I want to perform some cleanup deleting obsolete compilers located in > ~/.stack folder. I know stack places them into ~/.stack/programs/< > platform>/ directory, however I think there are also should be something > else related, e.g. docs and libs, and especially packages that was built > when I used old LTS snapshots. [...] > It's good to hear that I'm not alone with such an obvious(?) undocumented use case... :-) I often want to say something like "Nuke away everything related to nightly-X-Y-Z" (garbage-collecting away any GHC on the way, too) or "Nuke GHC X.Y and all related snapshots". The last time I looked at stack's documentation, I couldn't figure out how to do that, so from time to time I completely remove ~/.stack, but that can't be the recommended way to do this. ~/.stack gets *huge* after some time, so some easy administrative interface for it would be nice. -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Mon Feb 6 08:23:17 2017 From: michael at snoyman.com (Michael Snoyman) Date: Mon, 6 Feb 2017 10:23:17 +0200 Subject: [Haskell-cafe] Cleanup obsolete stack stuff (compiler, libraries, etc.) In-Reply-To: References: Message-ID: On Mon, Feb 6, 2017 at 10:00 AM, Sven Panne wrote: > 2017-02-04 19:19 GMT+01:00 Geraldus : > >> I want to perform some cleanup deleting obsolete compilers located in >> ~/.stack folder. I know stack places them into ~/.stack/programs/> rm>/ directory, however I think there are also should be something else >> related, e.g. docs and libs, and especially packages that was built when I >> used old LTS snapshots. [...] >> > It's good to hear that I'm not alone with such an obvious(?) undocumented > use case... :-) I often want to say something like "Nuke away everything > related to nightly-X-Y-Z" (garbage-collecting away any GHC on the way, too) > or "Nuke GHC X.Y and all related snapshots". The last time I looked at > stack's documentation, I couldn't figure out how to do that, so from time > to time I completely remove ~/.stack, but that can't be the recommended way > to do this. ~/.stack gets *huge* after some time, so some easy > administrative interface for it would be nice. > > Personally, I have always just wiped out the entire ~/.stack directory when it gets too big, I just don't have the patience to individually deal with each snapshot directory. If you just want to get rid of the compiled libraries, you can nuke ~/.stack/snapshots instead, but personally I've found it convenient to get rid of my install GHCs occasionally because I usually don't need them all anymore (e.g. I don't need GHC 7.10.2 or 7.8.4 for any code I've been working on in the past few months). Could there be a nice `gc` command to more intelligently delete stuff that hasn't been used recently? Probably, but I don't think the demand has been very high for it: people seem to either not care about disk space much, or don't mind the occasionally tactical nuke. (FWIW: I would also periodically nuke my ~/.cabal and ~/.ghc directories in the past.) Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From heraldhoi at gmail.com Mon Feb 6 09:39:45 2017 From: heraldhoi at gmail.com (Geraldus) Date: Mon, 06 Feb 2017 09:39:45 +0000 Subject: [Haskell-cafe] Cleanup obsolete stack stuff (compiler, libraries, etc.) In-Reply-To: References: Message-ID: Yeah, I've get used to wipes too, and `stack` made it easy to deal with consequences. But I think some builtin cleanup algorithm would be really helpful. пн, 6 февр. 2017 г. в 13:25, Michael Snoyman : > On Mon, Feb 6, 2017 at 10:00 AM, Sven Panne wrote: > > 2017-02-04 19:19 GMT+01:00 Geraldus : > > I want to perform some cleanup deleting obsolete compilers located in > ~/.stack folder. I know stack places them into > ~/.stack/programs// directory, however I think there are also > should be something else related, e.g. docs and libs, and especially > packages that was built when I used old LTS snapshots. [...] > > It's good to hear that I'm not alone with such an obvious(?) undocumented > use case... :-) I often want to say something like "Nuke away everything > related to nightly-X-Y-Z" (garbage-collecting away any GHC on the way, too) > or "Nuke GHC X.Y and all related snapshots". The last time I looked at > stack's documentation, I couldn't figure out how to do that, so from time > to time I completely remove ~/.stack, but that can't be the recommended way > to do this. ~/.stack gets *huge* after some time, so some easy > administrative interface for it would be nice. > > > > Personally, I have always just wiped out the entire ~/.stack directory > when it gets too big, I just don't have the patience to individually deal > with each snapshot directory. If you just want to get rid of the compiled > libraries, you can nuke ~/.stack/snapshots instead, but personally I've > found it convenient to get rid of my install GHCs occasionally because I > usually don't need them all anymore (e.g. I don't need GHC 7.10.2 or 7.8.4 > for any code I've been working on in the past few months). > > Could there be a nice `gc` command to more intelligently delete stuff that > hasn't been used recently? Probably, but I don't think the demand has been > very high for it: people seem to either not care about disk space much, or > don't mind the occasionally tactical nuke. > > (FWIW: I would also periodically nuke my ~/.cabal and ~/.ghc directories > in the past.) > > Michael > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From snthibaud at gmail.com Tue Feb 7 01:49:26 2017 From: snthibaud at gmail.com (=?UTF-8?Q?St=C3=A9phane_Thibaud?=) Date: Tue, 07 Feb 2017 01:49:26 +0000 Subject: [Haskell-cafe] Network.Download stops after 10 downloads Message-ID: I have tried the Network.Download library in order to download CSV files from Yahoo Finance, but after the 10th download every next download fails. Does Network.Download keep connections open? I did consume the result of the openURI function (even with deepseq). Any ideas? Thanks in advance! Stéphane -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Tue Feb 7 01:53:56 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 6 Feb 2017 20:53:56 -0500 Subject: [Haskell-cafe] Network.Download stops after 10 downloads In-Reply-To: References: Message-ID: On Mon, Feb 6, 2017 at 8:49 PM, Stéphane Thibaud wrote: > I have tried the Network.Download library in order to download CSV files > from Yahoo Finance, but after the 10th download every next download fails. > Does Network.Download keep connections open? I did consume the result of > the openURI function (even with deepseq). Any ideas? Can you get any details about why/how it fails? It could well be something as simple as Yahoo throttling you for too many connections in too short a time or something; in that case, the error from Yahoo should indicate it, but if all you get back is a 4xx or 5xx code then it won't be obvious. (Which may well mean something like running it under strace with +RTS -V0 to see the actual error returned.) -- 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 saurabhnanda at gmail.com Tue Feb 7 02:49:25 2017 From: saurabhnanda at gmail.com (Saurabh Nanda) Date: Tue, 7 Feb 2017 08:19:25 +0530 Subject: [Haskell-cafe] Monad transformer performance - Request to review benchmarking code + results In-Reply-To: <87inoop6fs.fsf@nixos.i-did-not-set--mail-host-address--so-tickle-me> References: <87inoop6fs.fsf@nixos.i-did-not-set--mail-host-address--so-tickle-me> Message-ID: Inlining can only happen if the code to be inlined is available. This means explicitly marking things with {-# INLINE #-} or {-# INLINEABLE #-} (or GHC seeing something as "small" and deciding it's worth putting in the .hi file). If I give you "foo True" and tell you nothing more about "foo" - how are you going to optimise that? That's essentially what is happening - GHC has no more information so all it can do is just call the function and hope for the best. I don't understand. If the compiler can figure out how to inline certain functions automatically (without the use of the INLINE pragma), what's causing Monad binds and lifts to be out of the consideration set? Why do you say GHC has "no more information"? How does it have "more information" about functions that it does decide to inline automatically? -- Saurabh. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dct25-561bs at mythic-beasts.com Tue Feb 7 05:58:33 2017 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Tue, 7 Feb 2017 05:58:33 +0000 Subject: [Haskell-cafe] Monad transformer performance - Request to review benchmarking code + results In-Reply-To: References: <87inoop6fs.fsf@nixos.i-did-not-set--mail-host-address--so-tickle-me> Message-ID: On 7 Feb 2017 02:49, "Saurabh Nanda" wrote: Inlining can only happen if the code to be inlined is available. This means explicitly marking things with {-# INLINE #-} or {-# INLINEABLE #-} (or GHC seeing something as "small" and deciding it's worth putting in the .hi file). If I give you "foo True" and tell you nothing more about "foo" - how are you going to optimise that? That's essentially what is happening - GHC has no more information so all it can do is just call the function and hope for the best. I don't understand. If the compiler can figure out how to inline certain functions automatically (without the use of the INLINE pragma), what's causing Monad binds and lifts to be out of the consideration set? Why do you say GHC has "no more information"? How does it have "more information" about functions that it does decide to inline automatically? The question is not _how_ to inline, it's _whether_ to do so at all. Inlining the wrong things can make performance worse. Because of this there's some heuristics that indicate things that are worth inlining. It is reasonable to question whether these heuristics could be improved, and even to offer improvements to GHC if you are so inclined. There's no magic "inline all the right things for optimal performance" algorithm, just a large and growing body of experience and test cases showing some of the things that work well and some of the things that don't. You are encouraged to add to it. The thing about "more information" is related to how GHC implements cross-module inlining while also supporting separate compilation. There's a decision when compiling the definition of a function about whether it's worth including in the module's interface file. If it is so included then there's a second inlining decision made at each of its use sites. If it's not included in the interface then the calling modules just see an opaque function, which cannot be inlined as there is no more information about what to inline. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Tue Feb 7 23:55:29 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Wed, 8 Feb 2017 10:55:29 +1100 Subject: [Haskell-cafe] Lifting a value into a DataKind Message-ID: Is it possible to automatically lift an arbitrary value into a type? i.e. I'm after a function of type `a -> Proxy (b :: a)`. More specifically, I'm wanting to be able to write a function that can convert an Enum (e.g. Bool or Ord) into such a Proxy, so I can actually write a function that looks like: `a -> (forall b. Proxy (b :: a) -> r) -> r` and use the `a` type as a selector value (to e.g. choose between type class instances). -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From rae at cs.brynmawr.edu Wed Feb 8 01:55:27 2017 From: rae at cs.brynmawr.edu (Richard Eisenberg) Date: Tue, 7 Feb 2017 20:55:27 -0500 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: References: Message-ID: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> The singletons library's `toSing` (or `withSing`) may be what you want. Note that if you use Proxy, you won't be able to make any runtime decisions on the choice of `b`. Richard > On Feb 7, 2017, at 6:55 PM, Ivan Lazar Miljenovic wrote: > > Is it possible to automatically lift an arbitrary value into a type? > i.e. I'm after a function of type `a -> Proxy (b :: a)`. > > More specifically, I'm wanting to be able to write a function that can > convert an Enum (e.g. Bool or Ord) into such a Proxy, so I can > actually write a function that looks like: `a -> (forall b. Proxy (b > :: a) -> r) -> r` and use the `a` type as a selector value (to e.g. > choose between type class instances). > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From snthibaud at gmail.com Wed Feb 8 02:33:48 2017 From: snthibaud at gmail.com (=?UTF-8?Q?St=C3=A9phane_Thibaud?=) Date: Wed, 08 Feb 2017 02:33:48 +0000 Subject: [Haskell-cafe] Network.Download stops after 10 downloads In-Reply-To: References: Message-ID: Thank you for your answer! I get 200 OK status codes (I think after I get one 404 first) and it does seem like some (pieces of) data are sent (as tcpflow was printing data when the requests were failing - even when I started tcpflow after the failing requests started). Network.Download gives back the following error: Left "Failed to connect: Not Found" I have attached my code. Best regards, Stéphane 2017年2月7日(火) 10:53 Brandon Allbery : > > On Mon, Feb 6, 2017 at 8:49 PM, Stéphane Thibaud > wrote: > > I have tried the Network.Download library in order to download CSV files > from Yahoo Finance, but after the 10th download every next download fails. > Does Network.Download keep connections open? I did consume the result of > the openURI function (even with deepseq). Any ideas? > > > Can you get any details about why/how it fails? It could well be something > as simple as Yahoo throttling you for too many connections in too short a > time or something; in that case, the error from Yahoo should indicate it, > but if all you get back is a 4xx or 5xx code then it won't be obvious. > (Which may well mean something like running it under strace with +RTS -V0 > to see the actual error returned.) > > > -- > 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: -------------- next part -------------- A non-text attachment was scrubbed... Name: stockdatafetcher.zip Type: application/zip Size: 12481 bytes Desc: not available URL: From ivan.miljenovic at gmail.com Wed Feb 8 03:32:56 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Wed, 8 Feb 2017 14:32:56 +1100 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> References: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> Message-ID: Thanks for the suggestion; I think singletons is a bit of a large hammer for a small bit of extra functionality I was thinking of adding though (especially with people needing to use TH to make their datatypes instances of SingI as well). On 8 February 2017 at 12:55, Richard Eisenberg wrote: > The singletons library's `toSing` (or `withSing`) may be what you want. Note that if you use Proxy, you won't be able to make any runtime decisions on the choice of `b`. > > Richard > >> On Feb 7, 2017, at 6:55 PM, Ivan Lazar Miljenovic wrote: >> >> Is it possible to automatically lift an arbitrary value into a type? >> i.e. I'm after a function of type `a -> Proxy (b :: a)`. >> >> More specifically, I'm wanting to be able to write a function that can >> convert an Enum (e.g. Bool or Ord) into such a Proxy, so I can >> actually write a function that looks like: `a -> (forall b. Proxy (b >> :: a) -> r) -> r` and use the `a` type as a selector value (to e.g. >> choose between type class instances). >> >> -- >> Ivan Lazar Miljenovic >> Ivan.Miljenovic at gmail.com >> http://IvanMiljenovic.wordpress.com >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From rae at cs.brynmawr.edu Wed Feb 8 03:35:14 2017 From: rae at cs.brynmawr.edu (Richard Eisenberg) Date: Tue, 7 Feb 2017 22:35:14 -0500 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: References: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> Message-ID: <4D52E0FC-9079-4CDD-A802-3CD64171BEC0@cs.brynmawr.edu> I fear, though, that you'll need a big hammer to be able to do what you want. Could you draw out your example a bit, and then we can see what the smaller hammer might look like. Richard > On Feb 7, 2017, at 10:32 PM, Ivan Lazar Miljenovic wrote: > > Thanks for the suggestion; I think singletons is a bit of a large > hammer for a small bit of extra functionality I was thinking of adding > though (especially with people needing to use TH to make their > datatypes instances of SingI as well). > > On 8 February 2017 at 12:55, Richard Eisenberg wrote: >> The singletons library's `toSing` (or `withSing`) may be what you want. Note that if you use Proxy, you won't be able to make any runtime decisions on the choice of `b`. >> >> Richard >> >>> On Feb 7, 2017, at 6:55 PM, Ivan Lazar Miljenovic wrote: >>> >>> Is it possible to automatically lift an arbitrary value into a type? >>> i.e. I'm after a function of type `a -> Proxy (b :: a)`. >>> >>> More specifically, I'm wanting to be able to write a function that can >>> convert an Enum (e.g. Bool or Ord) into such a Proxy, so I can >>> actually write a function that looks like: `a -> (forall b. Proxy (b >>> :: a) -> r) -> r` and use the `a` type as a selector value (to e.g. >>> choose between type class instances). >>> >>> -- >>> Ivan Lazar Miljenovic >>> Ivan.Miljenovic at gmail.com >>> http://IvanMiljenovic.wordpress.com >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> To (un)subscribe, modify options or view archives go to: >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> Only members subscribed via the mailman list are allowed to post. >> > > > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com From snthibaud at gmail.com Wed Feb 8 05:34:58 2017 From: snthibaud at gmail.com (=?UTF-8?Q?St=C3=A9phane_Thibaud?=) Date: Wed, 08 Feb 2017 05:34:58 +0000 Subject: [Haskell-cafe] Network.Download stops after 10 downloads In-Reply-To: References: Message-ID: I tried the same thing with the Network.Download.Curl library and that worked! I gueas something was wrong with the Network.Download library. Best regards, Stéphane 2017年2月8日(水) 11:33 Stéphane Thibaud : > Thank you for your answer! > I get 200 OK status codes (I think after I get one 404 first) and it does > seem like some (pieces of) data are sent (as tcpflow was printing data when > the requests were failing - even when I started tcpflow after the failing > requests started). > Network.Download gives back the following error: Left "Failed to connect: > Not Found" > I have attached my code. > > > Best regards, > > Stéphane > > 2017年2月7日(火) 10:53 Brandon Allbery : > > > On Mon, Feb 6, 2017 at 8:49 PM, Stéphane Thibaud > wrote: > > I have tried the Network.Download library in order to download CSV files > from Yahoo Finance, but after the 10th download every next download fails. > Does Network.Download keep connections open? I did consume the result of > the openURI function (even with deepseq). Any ideas? > > > Can you get any details about why/how it fails? It could well be something > as simple as Yahoo throttling you for too many connections in too short a > time or something; in that case, the error from Yahoo should indicate it, > but if all you get back is a 4xx or 5xx code then it won't be obvious. > (Which may well mean something like running it under strace with +RTS -V0 > to see the actual error returned.) > > > -- > 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 ivan.miljenovic at gmail.com Wed Feb 8 05:43:17 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Wed, 8 Feb 2017 16:43:17 +1100 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: <4D52E0FC-9079-4CDD-A802-3CD64171BEC0@cs.brynmawr.edu> References: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> <4D52E0FC-9079-4CDD-A802-3CD64171BEC0@cs.brynmawr.edu> Message-ID: As a sample implementation of the current state that I'd like to simplify, see https://github.com/erikd/fastpack/blob/master/bench/bench.hs (specifically, the `compareFunc` usage and the definition of `withLibrary`). I've found myself writing similar patterns of late and wanted to try and automate it a bit. Specifically, it's the withLibrary function I'm trying to work out how I could automatically generate for similar types (as I've even written such type+function combinations in other unrelated instances; I've found it a useful approach when I want to select between typeclass instances). On 8 February 2017 at 14:35, Richard Eisenberg wrote: > I fear, though, that you'll need a big hammer to be able to do what you want. Could you draw out your example a bit, and then we can see what the smaller hammer might look like. > > Richard > >> On Feb 7, 2017, at 10:32 PM, Ivan Lazar Miljenovic wrote: >> >> Thanks for the suggestion; I think singletons is a bit of a large >> hammer for a small bit of extra functionality I was thinking of adding >> though (especially with people needing to use TH to make their >> datatypes instances of SingI as well). >> >> On 8 February 2017 at 12:55, Richard Eisenberg wrote: >>> The singletons library's `toSing` (or `withSing`) may be what you want. Note that if you use Proxy, you won't be able to make any runtime decisions on the choice of `b`. >>> >>> Richard >>> >>>> On Feb 7, 2017, at 6:55 PM, Ivan Lazar Miljenovic wrote: >>>> >>>> Is it possible to automatically lift an arbitrary value into a type? >>>> i.e. I'm after a function of type `a -> Proxy (b :: a)`. >>>> >>>> More specifically, I'm wanting to be able to write a function that can >>>> convert an Enum (e.g. Bool or Ord) into such a Proxy, so I can >>>> actually write a function that looks like: `a -> (forall b. Proxy (b >>>> :: a) -> r) -> r` and use the `a` type as a selector value (to e.g. >>>> choose between type class instances). >>>> >>>> -- >>>> Ivan Lazar Miljenovic >>>> Ivan.Miljenovic at gmail.com >>>> http://IvanMiljenovic.wordpress.com >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> To (un)subscribe, modify options or view archives go to: >>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>>> Only members subscribed via the mailman list are allowed to post. >>> >> >> >> >> -- >> Ivan Lazar Miljenovic >> Ivan.Miljenovic at gmail.com >> http://IvanMiljenovic.wordpress.com > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From andreas.abel at ifi.lmu.de Wed Feb 8 18:58:47 2017 From: andreas.abel at ifi.lmu.de (Andreas Abel) Date: Wed, 8 Feb 2017 19:58:47 +0100 Subject: [Haskell-cafe] ESSLLI student session CFP: Deadline extended until Feb 14 Message-ID: <6c681faa-b8bd-642d-1dff-09ee7a80b3ec@ifi.lmu.de> *Deadline Extension to February 14* *ESSLLI 2017 STUDENT SESSION* Held during the 29th European Summer School in Logic, Language and Information Toulouse, France, July 17-28, 2017 *NEW* *Deadline for submissions: February 14, 2017* https://easychair.org/conferences/?conf=stus2017 *ABOUT:* The Student Session of the 29th European Summer School in Logic, Language, and Information (ESSLLI) will take place in Toulouse, France, July 17th to 28th, 2017 (https://www.irit.fr/esslli2017/). We invite submissions of original, unpublished work from students in any area at the intersection of Logic & Language, Language & Computation, or Logic & Computation. Submissions will be reviewed by several experts in the field, and accepted papers will be presented orally or as posters and selected papers will appear in the Student Session proceedings by Springer. This is an excellent opportunity to receive valuable feedback from expert readers and to present your work to a diverse audience. *ORAL/POSTER PRESENTATIONS:* Note that there are two separate kinds of submissions, one for oral presentations and one for posters. This means that papers are directly submitted either as oral presentations or as poster presentations. Reviewing and ranking will be done separately. We particularly encourage submissions for posters, as they offer an excellent opportunity to present smaller research projects and research in progress. *SUBMISSION GUIDELINES:* Authors must be students, and submissions may be singly or jointly authored. Each author may submit at most one single and one jointly authored contribution. Submissions should not be longer than 8 pages for an oral presentation or 4 pages for a poster presentation (including examples and references). Submissions must be anonymous, without any identifying information. More detailed guidelines regarding submission can be found on the Student Session website: http://www2.sfs.uni-tuebingen.de/esslli-stus-2017/. *SPONSORSHIP AND PRIZES* As in previous years, Springer has kindly agreed to sponsor the ESSLLI student session. The best poster and best talk will be awarded Springer book vouchers of 500€ each. *FURTHER INFORMATION:* Please direct inquiries about submission procedures or other matters relating to the Student Session to johannes.wahle at uni-tuebingen.de and karoliina.lohiniva at unige.ch. ESSLLI 2017 will feature a wide range of foundational and advanced courses and workshops in all areas of Logic, Language, and Computation. For further information, including registration information and course listings, and for general inquiries about ESSLLI 2017, please consult the main ESSLLI 2017 page: https://www.irit.fr/esslli2017/. Kind regards, The ESSLLI 2017 Student Session Organization Committee Chairs: Johannes Wahle (Universität Tübingen) Karoliina Lohiniva (Université de Genève) LoCo co-chairs: Marie Farrell (National University of Ireland Maynooth) Herbert Lange (University of Gothenburg) LoLa co-chairs: Milica Denic (École normale supérieure de Paris) Mora Maldonado (École normale supérieure de Paris) LaCo co-chairs: Emmanuele Chersoni (Université d'Aix-Marseille) Jennifer Sikos (Universität Heidelberg) -- Andreas Abel <>< Du bist der geliebte Mensch. Department of Computer Science and Engineering Chalmers and Gothenburg University, Sweden andreas.abel at gu.se http://www.cse.chalmers.se/~abela/ From rae at cs.brynmawr.edu Thu Feb 9 02:31:19 2017 From: rae at cs.brynmawr.edu (Richard Eisenberg) Date: Wed, 8 Feb 2017 21:31:19 -0500 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: References: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> <4D52E0FC-9079-4CDD-A802-3CD64171BEC0@cs.brynmawr.edu> Message-ID: Is this the wrong link? I don't see any text matching compareFunc or withLibrary on that page... Sorry! Richard > On Feb 8, 2017, at 12:43 AM, Ivan Lazar Miljenovic wrote: > > As a sample implementation of the current state that I'd like to > simplify, see https://github.com/erikd/fastpack/blob/master/bench/bench.hs > (specifically, the `compareFunc` usage and the definition of > `withLibrary`). From ivan.miljenovic at gmail.com Thu Feb 9 03:40:32 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Thu, 9 Feb 2017 14:40:32 +1100 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: References: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> <4D52E0FC-9079-4CDD-A802-3CD64171BEC0@cs.brynmawr.edu> Message-ID: Yeah, Erik ended up reverting those changes. Here's what it should have been: https://github.com/ivan-m/fastpack/blob/ccf08a96e351b3a6ecac651971a1023f830c8f59/bench/bench.hs On 9 February 2017 at 13:31, Richard Eisenberg wrote: > Is this the wrong link? I don't see any text matching compareFunc or withLibrary on that page... Sorry! > > Richard > >> On Feb 8, 2017, at 12:43 AM, Ivan Lazar Miljenovic wrote: >> >> As a sample implementation of the current state that I'd like to >> simplify, see https://github.com/erikd/fastpack/blob/master/bench/bench.hs >> (specifically, the `compareFunc` usage and the definition of >> `withLibrary`). > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From aditya.siram at gmail.com Thu Feb 9 03:40:26 2017 From: aditya.siram at gmail.com (aditya siram) Date: Wed, 8 Feb 2017 21:40:26 -0600 Subject: [Haskell-cafe] Cabal Conditional For Detecting GHCi Message-ID: Hi all, I was wondering if Cabal has a predicate which allows me to only enable options when running GHCi. The use-case is I have a set of `ghc-options` that I do *not* want enabled when I run `cabal repl` or `stack repl`. Ideally I'm looking for something along the lines of: if !repl ghc-options: ... -deech -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Thu Feb 9 03:48:08 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Thu, 9 Feb 2017 14:48:08 +1100 Subject: [Haskell-cafe] Cabal Conditional For Detecting GHCi In-Reply-To: References: Message-ID: On 9 February 2017 at 14:40, aditya siram wrote: > Hi all, > I was wondering if Cabal has a predicate which allows me to only enable > options when running GHCi. The use-case is I have a set of `ghc-options` > that I do *not* want enabled when I run `cabal repl` or `stack repl`. If you're not using either of these, then what role does Cabal have to play if you open a file in ghci? Though if it's for ghci options, why not just launch ghci with those options (using a .ghci file in the current directory, etc.)? -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From aditya.siram at gmail.com Thu Feb 9 04:21:03 2017 From: aditya.siram at gmail.com (aditya siram) Date: Wed, 8 Feb 2017 22:21:03 -0600 Subject: [Haskell-cafe] Cabal Conditional For Detecting GHCi In-Reply-To: References: Message-ID: I have ghc-options that are used to link with a static library when building. But the same options don't work in GHCi where I need to the shared version of the library. Currently when I do `stack repl ...` the static library linking options are also passed to `ghc`. -deech On Wed, Feb 8, 2017 at 9:48 PM, Ivan Lazar Miljenovic < ivan.miljenovic at gmail.com> wrote: > On 9 February 2017 at 14:40, aditya siram wrote: > > Hi all, > > I was wondering if Cabal has a predicate which allows me to only enable > > options when running GHCi. The use-case is I have a set of `ghc-options` > > that I do *not* want enabled when I run `cabal repl` or `stack repl`. > > If you're not using either of these, then what role does Cabal have to > play if you open a file in ghci? > > Though if it's for ghci options, why not just launch ghci with those > options (using a .ghci file in the current directory, etc.)? > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Thu Feb 9 04:29:52 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Thu, 9 Feb 2017 15:29:52 +1100 Subject: [Haskell-cafe] Cabal Conditional For Detecting GHCi In-Reply-To: References: Message-ID: If this is just for local development, what about adding a new flag that is disabled by default but you can configure with locally? On 9 February 2017 at 15:21, aditya siram wrote: > I have ghc-options that are used to link with a static library when > building. But the same options don't work in GHCi where I need to the shared > version of the library. Currently when I do `stack repl ...` the static > library linking options are also passed to `ghc`. > -deech > > On Wed, Feb 8, 2017 at 9:48 PM, Ivan Lazar Miljenovic > wrote: >> >> On 9 February 2017 at 14:40, aditya siram wrote: >> > Hi all, >> > I was wondering if Cabal has a predicate which allows me to only enable >> > options when running GHCi. The use-case is I have a set of `ghc-options` >> > that I do *not* want enabled when I run `cabal repl` or `stack repl`. >> >> If you're not using either of these, then what role does Cabal have to >> play if you open a file in ghci? >> >> Though if it's for ghci options, why not just launch ghci with those >> options (using a .ghci file in the current directory, etc.)? >> >> -- >> Ivan Lazar Miljenovic >> Ivan.Miljenovic at gmail.com >> http://IvanMiljenovic.wordpress.com > > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From aditya.siram at gmail.com Thu Feb 9 04:48:08 2017 From: aditya.siram at gmail.com (aditya siram) Date: Wed, 8 Feb 2017 22:48:08 -0600 Subject: [Haskell-cafe] Cabal Conditional For Detecting GHCi In-Reply-To: References: Message-ID: If nothing like the predicate I want exists in Cabal I guess a custom flag would be next best option. I was hoping to keep it transparent to the user. On Wed, Feb 8, 2017 at 10:29 PM, Ivan Lazar Miljenovic < ivan.miljenovic at gmail.com> wrote: > If this is just for local development, what about adding a new flag > that is disabled by default but you can configure with locally? > > On 9 February 2017 at 15:21, aditya siram wrote: > > I have ghc-options that are used to link with a static library when > > building. But the same options don't work in GHCi where I need to the > shared > > version of the library. Currently when I do `stack repl ...` the static > > library linking options are also passed to `ghc`. > > -deech > > > > On Wed, Feb 8, 2017 at 9:48 PM, Ivan Lazar Miljenovic > > wrote: > >> > >> On 9 February 2017 at 14:40, aditya siram > wrote: > >> > Hi all, > >> > I was wondering if Cabal has a predicate which allows me to only > enable > >> > options when running GHCi. The use-case is I have a set of > `ghc-options` > >> > that I do *not* want enabled when I run `cabal repl` or `stack repl`. > >> > >> If you're not using either of these, then what role does Cabal have to > >> play if you open a file in ghci? > >> > >> Though if it's for ghci options, why not just launch ghci with those > >> options (using a .ghci file in the current directory, etc.)? > >> > >> -- > >> Ivan Lazar Miljenovic > >> Ivan.Miljenovic at gmail.com > >> http://IvanMiljenovic.wordpress.com > > > > > > > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cepete02 at gmail.com Thu Feb 9 13:14:42 2017 From: cepete02 at gmail.com (Carl Petersen) Date: Thu, 9 Feb 2017 05:14:42 -0800 (PST) Subject: [Haskell-cafe] Loading JSON into a set of nested index-able structures Message-ID: <606bbfe3-8026-4e98-9cf8-32c36749c350@googlegroups.com> Hello All, I've used Aeson to load a JSON object with nested lists into a set of data structures, but what I really need is to load it into a set of data structures that are index-able such as a HashMap. I've had success loading the JSON into a structure with the lowest level being a HashMap using !Object, but I'm having difficulty in figuring out how to nest the HashMaps. Any hints or direction would be appreciated. Thanks, Carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From rae at cs.brynmawr.edu Thu Feb 9 13:48:09 2017 From: rae at cs.brynmawr.edu (Richard Eisenberg) Date: Thu, 9 Feb 2017 08:48:09 -0500 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: References: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> <4D52E0FC-9079-4CDD-A802-3CD64171BEC0@cs.brynmawr.edu> Message-ID: Ah. Now I get it! You originally described a type `a -> (forall b. Proxy (b :: a) -> r) -> r`, which doesn't seem very useful to me. The continuation function in there doesn't get any new information, so it can't make any decisions based on the choice of a. On the other hand, Erik's withLibrary has this type: `Library -> (forall (l :: Library). PutGet l => Proxy l -> k) -> k`. The key difference is that the continuation now has a constraint on it, which means a dictionary will be passed at runtime. Then, the proxy argument is useful, as it can be used to select the dictionary. So, perhaps this is what you want: with :: forall (a :: Type) (c :: a -> Constraint) (r :: Type). a -> (forall (b :: a). c b => Proxy b -> r) -> r `with` would look at the value of type `a` that has been provided, select a dictionary based on that choice, and then pass the dictionary to the continuation. Now, I can answer your original question: No, GHC can't do that. GHC internally is unaware of the relationship between, say, the value True and the type 'True. And even if it were, this would be a hard function to write, as it really does have to case-match at runtime to select the right dictionary. Given that the instances available might not exactly match the constructors of the type `a`, more processing might be necessary. It's conceivable, I suppose, that this ability could be baked in, but it would be non-trivial to do so. By the way, you're right that singletons is way too large a hammer for this. I would just do what Erik did. :) Richard > On Feb 8, 2017, at 10:40 PM, Ivan Lazar Miljenovic wrote: > > Yeah, Erik ended up reverting those changes. Here's what it should > have been: https://github.com/ivan-m/fastpack/blob/ccf08a96e351b3a6ecac651971a1023f830c8f59/bench/bench.hs > > On 9 February 2017 at 13:31, Richard Eisenberg wrote: >> Is this the wrong link? I don't see any text matching compareFunc or withLibrary on that page... Sorry! >> >> Richard >> >>> On Feb 8, 2017, at 12:43 AM, Ivan Lazar Miljenovic wrote: >>> >>> As a sample implementation of the current state that I'd like to >>> simplify, see https://github.com/erikd/fastpack/blob/master/bench/bench.hs >>> (specifically, the `compareFunc` usage and the definition of >>> `withLibrary`). >> > > > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com From stphndemos at gmail.com Thu Feb 9 18:20:12 2017 From: stphndemos at gmail.com (Stephen Demos) Date: Thu, 9 Feb 2017 13:20:12 -0500 Subject: [Haskell-cafe] Typeclass constraints not inferred when defining a function Message-ID: Hi all, A professor showed me a function today that looks like this - `append = flip (foldr (:))` GHC spits back an error when this is compiled - ``` • Ambiguous type variable ‘t0’ arising from a use of ‘foldr’ prevents the constraint ‘(Foldable t0)’ from being solved. Relevant bindings include append :: t0 a -> [a] -> [a] (bound at test.hs:4:1) Probable fix: use a type annotation to specify what ‘t0’ should be. ``` It's obvious from this error message the problem is that the type GHC infers doesn't include the typeclass constraint. In this case, it's Foldable, but you can easily think of other situations where the same error comes up with different typeclasses (a silly example that comes to mind is `fmap (const [])`). It's pretty easy to fix this error by just providing a type for the function that is more specific than the one GHC infers. However, he showed me that defining the same function in ghci using a let binding doesn't yield the same error. In fact, when using `:t`, it shows that ghci successfully infers the typeclass constraint on the function - ``` > :t flip (foldr (:)) flip (foldr (:)) :: Foldable t => t a -> [a] -> [a] ``` I was wondering if anyone could explain this apparent discrepancy to me. Thanks! Stephen Demos From kiss.csongor.kiss at gmail.com Thu Feb 9 18:26:35 2017 From: kiss.csongor.kiss at gmail.com (Kiss Csongor) Date: Thu, 9 Feb 2017 18:26:35 +0000 Subject: [Haskell-cafe] Typeclass constraints not inferred when defining a function In-Reply-To: References: Message-ID: <2EBBBE5F-D059-4A90-BBB3-8739F16893DE@gmail.com> Hi, It’s because the monomorphism restriction turned off by default in GHCi sessions. If you put this at the beginning of your source file, it should work: {-# LANGUAGE NoMonomorphismRestriction #-} You can read up about it here: https://wiki.haskell.org/Monomorphism_restriction — Csongor > On 9 Feb 2017, at 18:20, Stephen Demos wrote: > > Hi all, > > A professor showed me a function today that looks like this - > > `append = flip (foldr (:))` > > GHC spits back an error when this is compiled - > > ``` > • Ambiguous type variable ‘t0’ arising from a use of ‘foldr’ > prevents the constraint ‘(Foldable t0)’ from being solved. > Relevant bindings include > append :: t0 a -> [a] -> [a] (bound at test.hs:4:1) > Probable fix: use a type annotation to specify what ‘t0’ should be. > ``` > > It's obvious from this error message the problem is that the type GHC > infers doesn't include the typeclass constraint. In this case, it's > Foldable, but you can easily think of other situations where the same > error comes up with different typeclasses (a silly example that comes > to mind is `fmap (const [])`). It's pretty easy to fix this error by > just providing a type for the function that is more specific than the > one GHC infers. > > However, he showed me that defining the same function in ghci using a > let binding doesn't yield the same error. In fact, when using `:t`, it > shows that ghci successfully infers the typeclass constraint on the > function - > > ``` >> :t flip (foldr (:)) > flip (foldr (:)) :: Foldable t => t a -> [a] -> [a] > ``` > > I was wondering if anyone could explain this apparent discrepancy to me. > > Thanks! > Stephen Demos > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From trebla at vex.net Thu Feb 9 20:31:57 2017 From: trebla at vex.net (Albert Y. C. Lai) Date: Thu, 9 Feb 2017 15:31:57 -0500 Subject: [Haskell-cafe] Typeclass constraints not inferred when defining a function In-Reply-To: References: Message-ID: On 2017-02-09 01:20 PM, Stephen Demos wrote: > However, he showed me that defining the same function in ghci using a > let binding doesn't yield the same error. In fact, when using `:t`, it > shows that ghci successfully infers the typeclass constraint on the > function - ghci deliberately deviates from normal behaviour for convenience. Unfortunately it is not very documented in the user's guide. From ivan.miljenovic at gmail.com Thu Feb 9 20:56:46 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Fri, 10 Feb 2017 07:56:46 +1100 Subject: [Haskell-cafe] Lifting a value into a DataKind In-Reply-To: References: <8DE084A4-92EA-43EC-94D1-21A62F1B3681@cs.brynmawr.edu> <4D52E0FC-9079-4CDD-A802-3CD64171BEC0@cs.brynmawr.edu> Message-ID: On 10 February 2017 at 00:48, Richard Eisenberg wrote: > Ah. Now I get it! > > You originally described a type `a -> (forall b. Proxy (b :: a) -> r) -> r`, which doesn't seem very useful to me. The continuation function in there doesn't get any new information, so it can't make any decisions based on the choice of a. On the other hand, Erik's withLibrary has this type: `Library -> (forall (l :: Library). PutGet l => Proxy l -> k) -> k`. The key difference is that the continuation now has a constraint on it, which means a dictionary will be passed at runtime. Then, the proxy argument is useful, as it can be used to select the dictionary. > > So, perhaps this is what you want: > > with :: forall (a :: Type) (c :: a -> Constraint) (r :: Type). a -> (forall (b :: a). c b => Proxy b -> r) -> r > > `with` would look at the value of type `a` that has been provided, select a dictionary based on that choice, and then pass the dictionary to the continuation. > > Now, I can answer your original question: No, GHC can't do that. GHC internally is unaware of the relationship between, say, the value True and the type 'True. And even if it were, this would be a hard function to write, as it really does have to case-match at runtime to select the right dictionary. Given that the instances available might not exactly match the constructors of the type `a`, more processing might be necessary. It's conceivable, I suppose, that this ability could be baked in, but it would be non-trivial to do so. > > By the way, you're right that singletons is way too large a hammer for this. I would just do what Erik did. :) Well, I wrote it in a pull request for Erik, but yes, it appears that just writing it each time is easier :) > > Richard > >> On Feb 8, 2017, at 10:40 PM, Ivan Lazar Miljenovic wrote: >> >> Yeah, Erik ended up reverting those changes. Here's what it should >> have been: https://github.com/ivan-m/fastpack/blob/ccf08a96e351b3a6ecac651971a1023f830c8f59/bench/bench.hs >> >> On 9 February 2017 at 13:31, Richard Eisenberg wrote: >>> Is this the wrong link? I don't see any text matching compareFunc or withLibrary on that page... Sorry! >>> >>> Richard >>> >>>> On Feb 8, 2017, at 12:43 AM, Ivan Lazar Miljenovic wrote: >>>> >>>> As a sample implementation of the current state that I'd like to >>>> simplify, see https://github.com/erikd/fastpack/blob/master/bench/bench.hs >>>> (specifically, the `compareFunc` usage and the definition of >>>> `withLibrary`). >>> >> >> >> >> -- >> Ivan Lazar Miljenovic >> Ivan.Miljenovic at gmail.com >> http://IvanMiljenovic.wordpress.com > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From damian.nadales at gmail.com Thu Feb 9 21:40:34 2017 From: damian.nadales at gmail.com (Damian Nadales) Date: Thu, 9 Feb 2017 22:40:34 +0100 Subject: [Haskell-cafe] In case there are some other Haskellers around Eindhoven, NL Message-ID: On a very unmemorable day, lost somewhere in a province of the Netherlands, a new Haskell meetup has been born http://meetu.ps/c/32F0Z/tJxcH/f Best, Damian. From anthony_clayden at clear.net.nz Fri Feb 10 05:35:13 2017 From: anthony_clayden at clear.net.nz (Anthony Clayden) Date: Fri, 10 Feb 2017 18:35:13 +1300 Subject: [Haskell-cafe] Lenses and records and ecosystem Message-ID: <589d5111.25c.1add.11732@clear.net.nz> I see Simon PJ's comment here https://github.com/ghc-proposals/ghc-proposals/pull/6#issuecomment-277971802 and the lengthy discussions from different advocates. How much is it true there's a fractured "Haskell ecosystem" with 2 (3?) incompatible approaches: * H98 style labelled records with various extensions to ease the pain. * newtype-wrapped Lenses * 'raw' (unwrapped) Lenses Can you mix those three styles inside one program? How much pain does it cause? Can you import libraries with a mix of styles? How does a program cope? I see the plethora of operators Lenses come with (mostly to keep the types coherent?). Except that Lens composition is plain function composition (.). I remember something from SPJ's video/lecture on Lenses: that having Lens composition turn out to be function composition is "cute". That suggests to me it's more of a happy accident than a necessary feature. I also see in the ORF proposal, OverloadedLabels part, that composing with Control.Category.(.) can lead to type ambiguity. I wonder: Could there be a dedicated operator for composing Lenses, that has the same semantics as (.), but a more specialised type? To strengthen type inference/reduce ambiguity. AntC From tonymorris at gmail.com Fri Feb 10 07:10:21 2017 From: tonymorris at gmail.com (Tony Morris) Date: Fri, 10 Feb 2017 17:10:21 +1000 Subject: [Haskell-cafe] Lenses and records and ecosystem In-Reply-To: <589d5111.25c.1add.11732@clear.net.nz> References: <589d5111.25c.1add.11732@clear.net.nz> Message-ID: <2363db41-cb44-a372-9fed-79c2bd4ab887@gmail.com> On 10/02/17 15:35, Anthony Clayden wrote: > I see Simon PJ's comment here > https://github.com/ghc-proposals/ghc-proposals/pull/6#issuecomment-277971802 > and the lengthy discussions from different advocates. > > How much is it true there's a fractured "Haskell ecosystem" > with 2 (3?) incompatible approaches: > * H98 style labelled records with various extensions to ease > the pain. > * newtype-wrapped Lenses > * 'raw' (unwrapped) Lenses Yearss ago, many of us spent a long time on different designs of lenses, running up against different and diverse walls, arguing amongst ourselves. The result is that there appears to be agreement on where those deeper problems actually are. We also seem to agree that the lens package at least correctly identifies the problems and excitingly, even resolves them in many cases. This was a significant step forward at the time and it would be foolish to concede that ground for no significant benefit. > > Can you mix those three styles inside one program? How much > pain does it cause? > > Can you import libraries with a mix of styles? How does a > program cope? Why would you? For what practical purpose? > > I see the plethora of operators Lenses come with > (mostly to keep the types coherent?). > Except that Lens composition is plain function composition > (.). > > I remember something from SPJ's video/lecture on Lenses: > that having Lens composition turn out to be function > composition is "cute". The use of (.) here was deliberately designed that way to assist in working against existing code. > That suggests to me it's more of a happy accident than a > necessary feature. Not necessary, just useful. I am less excited about this feature than many others, but it is useful nonetheless, and was specifically designed that way. > > > I also see in the ORF proposal, OverloadedLabels part, > that composing with Control.Category.(.) can lead to type > ambiguity. > > I wonder: > Could there be a dedicated operator for composing Lenses, > that has the same semantics as (.), > but a more specialised type? > To strengthen type inference/reduce ambiguity. > > > AntC > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From trebla at vex.net Fri Feb 10 19:27:28 2017 From: trebla at vex.net (Albert Y. C. Lai) Date: Fri, 10 Feb 2017 14:27:28 -0500 Subject: [Haskell-cafe] In case there are some other Haskellers around Eindhoven, NL In-Reply-To: References: Message-ID: <9d94c36a-c345-cdf5-e608-8d7046c8e87b@vex.net> On 2017-02-09 04:40 PM, Damian Nadales wrote: > On a very unmemorable day, lost somewhere in a province of the > Netherlands, a new Haskell meetup has been born > http://meetu.ps/c/32F0Z/tJxcH/f Eindhoven, in my heart, is ground zero of well-reasoned programming because Dijkstra. From anthony_clayden at clear.net.nz Sat Feb 11 00:53:59 2017 From: anthony_clayden at clear.net.nz (Anthony Clayden) Date: Sat, 11 Feb 2017 13:53:59 +1300 Subject: [Haskell-cafe] Lenses and records and ecosystem Message-ID: <589e60a7.335.65d3.25413@clear.net.nz> > ON 10/02/17 07:10, Tony Morris wrote: >> On 10/02/17 15:35, Anthony Clayden wrote: >> I see Simon PJ's comment here >> https://github.com/ghc-proposals/ghc-proposals/pull/6#issuecomment-277971802 >> and the lengthy discussions from different advocates. >> >> How much is it true there's a fractured "Haskell ecosystem" >> with 2 (3?) incompatible approaches: >> * H98 style labelled records with various extensions >> to ease the pain. >> * newtype-wrapped Lenses >> * 'raw' (unwrapped) Lenses > Yearss ago, many of us spent a long time > on different designs of lenses, ... > ... it would be foolish to concede that ground > for no significant benefit. Thanks Tony, but I don't understand: concede what ground? You're perhaps saying that one style of lenses is the 'right' one(?) I am asking if they can co-exist. > > Can you mix those three styles inside one program? > How much pain does it cause? > > Can you import libraries with a mix of styles? How does a > program cope? Why would you? For what practical purpose? A lens/a structure/a record is a means to an end. Applications that are putting/getting stuff are doing it for some purpose. Not merely because lenses are a nice application of category theory. So say you want to use the functionality from 3 different libraries, but each is written using a different style. >> >> I see the plethora of operators Lenses come with >> (mostly to keep the types coherent?). >> Except that Lens composition is plain function composition >> (.). >> >> I remember something from SPJ's video/lecture on Lenses: >> that having Lens composition turn out to be function >> composition is "cute". > The use of (.) here was deliberately designed that way to > assist in working against existing code. Is "against" some clever pun here? Like Concerto for Piano against Orchestra? Certainly (.) for lenses works 'backwards' (i.e. suffix style) compared to function-prefix style. (As any Lens tutorial will say.) >> That suggests to me it's more of a happy accident than a >> necessary feature. > Not necessary, just useful. I am less excited about this > feature than many others, but it is useful nonetheless, > and was specifically designed that way. Whether or not that's justified [**] it's counter-intuitive w.r.t. Haskell, so I don't see a need to use the same symbol. Hence my "wondering" below. >> >> I also see in the ORF proposal, OverloadedLabels part, >> that composing with Control.Category.(.) can lead to type >> ambiguity. >> >> I wonder: >> Could there be a dedicated operator for composing Lenses, >> that has the same semantics as (.), >> but a more specialised type? >> To strengthen type inference/reduce ambiguity. >> [**] the justification for postfix style seems to be so it's more like OO. Seems strange: FP just isn't very like OO. And in particular, functional data structures, just aren't like OO/procedural data structures. Anthony From fumiexcel at gmail.com Sat Feb 11 09:30:39 2017 From: fumiexcel at gmail.com (Fumiaki Kinoshita) Date: Sat, 11 Feb 2017 18:30:39 +0900 Subject: [Haskell-cafe] Lenses and records and ecosystem In-Reply-To: <589d5111.25c.1add.11732@clear.net.nz> References: <589d5111.25c.1add.11732@clear.net.nz> Message-ID: Are there any real cases that the polymorphism of Control.Category.. becomes a real problem? I think ambiguity rarely occurs on the kind (* -> * -> *). 2017-02-10 14:35 GMT+09:00 Anthony Clayden : > I see Simon PJ's comment here > https://github.com/ghc-proposals/ghc-proposals/pull/ > 6#issuecomment-277971802 > and the lengthy discussions from different advocates. > > How much is it true there's a fractured "Haskell ecosystem" > with 2 (3?) incompatible approaches: > * H98 style labelled records with various extensions to ease > the pain. > * newtype-wrapped Lenses > * 'raw' (unwrapped) Lenses > > Can you mix those three styles inside one program? How much > pain does it cause? > > Can you import libraries with a mix of styles? How does a > program cope? > > I see the plethora of operators Lenses come with > (mostly to keep the types coherent?). > Except that Lens composition is plain function composition > (.). > > I remember something from SPJ's video/lecture on Lenses: > that having Lens composition turn out to be function > composition is "cute". > That suggests to me it's more of a happy accident than a > necessary feature. > > I also see in the ORF proposal, OverloadedLabels part, > that composing with Control.Category.(.) can lead to type > ambiguity. > > I wonder: > Could there be a dedicated operator for composing Lenses, > that has the same semantics as (.), > but a more specialised type? > To strengthen type inference/reduce ambiguity. > > > AntC > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony_clayden at clear.net.nz Sat Feb 11 11:20:08 2017 From: anthony_clayden at clear.net.nz (Anthony Clayden) Date: Sun, 12 Feb 2017 00:20:08 +1300 Subject: [Haskell-cafe] Lenses and records and ecosystem Message-ID: <589ef368.2f3.2ad5.21575@clear.net.nz> > 2017-02-11 09:30 UTC Fumiaki Kinoshita: > Are there any real cases that the polymorphism of > Control.Category.. becomes a real problem? I think > ambiguity rarely occurs on the kind (* -> * -> *). > Hi Fumiaki, the remark is here https://github.com/adamgundry/ghc-proposals/blob/overloaded-record-fields/proposals/0000-overloaded-record-fields.rst#Example_of_ambiguity_under_IsLabel_interpretation The composition is: fooBar = #foo . #bar ... However, if labels are interpreted using IsLabel, the inferred type of fooBar is (Category cat, IsLabel "foo" (cat s t), IsLabel "bar" (cat r s)) => cat r t There's no FunDep on IsLabel (nor could there be). So `s` is ambiguous. Same as the classical (show . read). The usual type for raw/unwrapped Lenses is: type Lens s t a b = forall f. Functor f => (a -> f b) -> (s -> f t) Which is of kind (* -> * -> *), but you need to squint a bit. > > 2017-02-10 14:35 GMT+09:00 Anthony Clayden: > > > > > > I see the plethora of operators Lenses come with > > (mostly to keep the types coherent?). > > Except that Lens composition is plain function > > composition (.). > > > > I remember something from SPJ's video/lecture on Lenses: > > that having Lens composition turn out to be function > > composition is "cute". > > That suggests to me it's more of a happy accident than a > > necessary feature. > > > > I also see in the ORF proposal, OverloadedLabels part, > > that composing with Control.Category.(.) can lead to > > type ambiguity. > > > > I wonder: > > Could there be a dedicated operator for composing Lenses > > , that has the same semantics as (.), > > but a more specialised type? > > To strengthen type inference/reduce ambiguity. > > AntC From dave at zednenem.com Sat Feb 11 21:04:03 2017 From: dave at zednenem.com (David Menendez) Date: Sat, 11 Feb 2017 16:04:03 -0500 Subject: [Haskell-cafe] Lenses and records and ecosystem In-Reply-To: <589e60a7.335.65d3.25413@clear.net.nz> References: <589e60a7.335.65d3.25413@clear.net.nz> Message-ID: On Fri, Feb 10, 2017 at 7:53 PM, Anthony Clayden < anthony_clayden at clear.net.nz> wrote: > > Certainly (.) for lenses works 'backwards' > (i.e. suffix style) > compared to function-prefix style. > (As any Lens tutorial will say.) > Those tutorials are oversimplifying. Lenses (and their relatives) transform operations, not values. Composition of lenses is exactly like composition of functions, with the inner-most operation on the right. A lens foo :: Lens O I transforms an operation on I into an operation on O. A composition outer.inner turns an operation on the target of inner into an operation on the source of outer. This is demonstrated by the way over distributes with (.): over (outer . inner) = over outer . over inner What confuses people is view, which is contravariant: view (outer . inner) = view inner . view outer but you can’t avoid having one of over and view be contravariant. -- Dave Menendez -------------- next part -------------- An HTML attachment was scrubbed... URL: From dennis.raddle at gmail.com Sun Feb 12 05:06:03 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Sat, 11 Feb 2017 21:06:03 -0800 Subject: [Haskell-cafe] here's my solution for scripting/interpreter approach Message-ID: My application needed the flexibility of writing test code and running it, or configuring its job (playback of music) through Haskell code and immediately testing the result (i.e. making sound and listening). I thought I would use GHCI, but I ran into some trouble. For one thing, my program forks a thread to do the timed control of the music, while the main thread implements a REPL-like "control loop" -- i.e. let me enter commands to influence the playback or halt it. I think this was crashing GHCI, perhaps when an interpreted script forks a thread which is still alive when control returns to the GHCI prompt. Not sure. Anyway here's what I did. Now the process that does real-time control of the playback is an entirely separate process. The control loop is started by me first, and depending on the command I enter, it builds the playback program with "ghc --make" and then spawns it. I send it signals from the control loop. This turns out to be great. I can make changes anywhere in my playback application, from the deepest utility library to the top-level configuration script, and it builds as needed before running. And, in the case it doesn't need to build anything, "ghc --make" finishes quickly so it doesn't feel inefficient to invoke it after every command I enter in the control loop. D -------------- next part -------------- An HTML attachment was scrubbed... URL: From amindfv at gmail.com Sun Feb 12 22:11:39 2017 From: amindfv at gmail.com (amindfv at gmail.com) Date: Sun, 12 Feb 2017 16:11:39 -0600 Subject: [Haskell-cafe] here's my solution for scripting/interpreter approach In-Reply-To: References: Message-ID: Hi Dennis -- responses inline: > El 11 feb 2017, a las 23:06, Dennis Raddle escribió: > > My application needed the flexibility of writing test code and running it, or configuring its job (playback of music) through Haskell code and immediately testing the result (i.e. making sound and listening). I thought I would use GHCI, but I ran into some trouble. For one thing, my program forks a thread to do the timed control of the music, while the main thread implements a REPL-like "control loop" -- i.e. let me enter commands to influence the playback or halt it. I think this was crashing GHCI, perhaps when an interpreted script forks a thread which is still alive when control returns to the GHCI prompt. Not sure. > Would you mind sharing your code? GHCi should certainly not be crashing just because there was a forked background thread. I have done lots of the interaction you're describing (for music, also) and never had a problem like that. > Anyway here's what I did. Now the process that does real-time control of the playback is an entirely separate process. The control loop is started by me first, and depending on the command I enter, it builds the playback program with "ghc --make" and then spawns it. I send it signals from the control loop. > > This turns out to be great. I can make changes anywhere in my playback application, from the deepest utility library to the top-level configuration script, and it builds as needed before running. > > And, in the case it doesn't need to build anything, "ghc --make" finishes quickly so it doesn't feel inefficient to invoke it after every command I enter in the control loop. > This seems like a great solution, the only downside being that you can't directly share memory between the processes. If you'd like to do that, I recommend (careful use of!) the "foreign-store" library, which allows you to regain references you stored before a ":r" in ghci. Tom > D > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From dennis.raddle at gmail.com Mon Feb 13 00:34:10 2017 From: dennis.raddle at gmail.com (Dennis Raddle) Date: Sun, 12 Feb 2017 16:34:10 -0800 Subject: [Haskell-cafe] here's my solution for scripting/interpreter approach In-Reply-To: References: Message-ID: On Sun, Feb 12, 2017 at 2:11 PM, wrote: > Hi Dennis -- responses inline: > > > El 11 feb 2017, a las 23:06, Dennis Raddle > escribió: > > > > My application needed the flexibility of writing test code and running > it, or configuring its job (playback of music) through Haskell code and > immediately testing the result (i.e. making sound and listening). I thought > I would use GHCI, but I ran into some trouble. For one thing, my program > forks a thread to do the timed control of the music, while the main thread > implements a REPL-like "control loop" -- i.e. let me enter commands to > influence the playback or halt it. I think this was crashing GHCI, perhaps > when an interpreted script forks a thread which is still alive when control > returns to the GHCI prompt. Not sure. > > > > Would you mind sharing your code? GHCi should certainly not be crashing > just because there was a forked background thread. I have done lots of the > interaction you're describing (for music, also) and never had a problem > like that. > > Thanks for your comments. I am not very organized.. I'm using git, but I didn't tag or branch on my GHCi experiments so it will be hard to reconstruct what I did. Note that I'm using Sound.PortMidi in the forked thread, so maybe that's the issue. Also I thought about the possibility of compiling with -dynamic when I was trying to get interpreted code working with compiled code, but I never tried it and don't need to now. D > > > Anyway here's what I did. Now the process that does real-time control of > the playback is an entirely separate process. The control loop is started > by me first, and depending on the command I enter, it builds the playback > program with "ghc --make" and then spawns it. I send it signals from the > control loop. > > > > This turns out to be great. I can make changes anywhere in my playback > application, from the deepest utility library to the top-level > configuration script, and it builds as needed before running. > > > > And, in the case it doesn't need to build anything, "ghc --make" > finishes quickly so it doesn't feel inefficient to invoke it after every > command I enter in the control loop. > > > > This seems like a great solution, the only downside being that you can't > directly share memory between the processes. If you'd like to do that, I > recommend (careful use of!) the "foreign-store" library, which allows you > to regain references you stored before a ":r" in ghci. > > Tom > > > > D > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From scooter.phd at gmail.com Mon Feb 13 06:40:09 2017 From: scooter.phd at gmail.com (Scott Michel) Date: Sun, 12 Feb 2017 22:40:09 -0800 Subject: [Haskell-cafe] Sublime2/3 hsdev patch: testers needed Message-ID: Was wondering if there are any Sublime Text users out there who also use hsdev as their Haskell IDE backend. I'd recently (within the last 2 weeks) encountered random lockups, error messages about resources no longer available. I was able to track them down to half-closed pipes and ended up revamping subprocess interaction. So far, I have left a SublimeText session open for 3 days, done some fair amount of work and haven't had any problems. If you are a SublimeText 2/3 hsdev user and are comfortable with checking out Sublime packages directly from github, I could use some extra help shaking out the code to ensure that it is as robust as I think it is. The URL to my Github fork is: https://github.com/bscottm/SublimeHaskell.git Once you've cloned my fork, check out the 'stderr_stdout' branch and test away -- I'm looking for unexpected lockups (e.g., when you've saved a file and ST's status line says "... Checking and Linting" forever.) Thanks! -scooter -------------- next part -------------- An HTML attachment was scrubbed... URL: From komendantskaya at gmail.com Mon Feb 13 10:58:40 2017 From: komendantskaya at gmail.com (Ekaterina Komendantskaya) Date: Mon, 13 Feb 2017 10:58:40 +0000 Subject: [Haskell-cafe] Fully funded PhD position in CS at Heriot-Watt University, Edinburgh, Scotland Message-ID: Dependable System group, School of Mathematical and Computer Sciences, Heriot-Watt University, Edinburgh, is looking to fill in one PhD position (a PhD stipend of £14,300 per annum, for 48 months, and a fee waiver are offered, no nationality restrictions apply). We are looking for a talented person, with 1st class degree in Mathematics or Computer Science, with keen interest in Logic and Programming languages and good programming skills. The successful candidate will be working under supervision of Dr Ekaterina Komendantskaya (http://www.macs.hw.ac.uk/~ek19/). The exact topic of the PhD dissertation will be determined in the course of discussions with the successful candidate, and will be related to both the student’s and the supervisor's research interests. To apply please contact Ekaterina directly: ek19 at hw.ac.uk Heriot-Watt University. With a history dating back to 1821, Heriot-Watt University is a research-led university located in Edinburgh, UK. Currently it is Scotland’s most international university, delivering degree programmes to 31,000 students globally and with campuses in Edinburgh, Scottish Borders, Orkney, Dubai and Malaysia. The university is consistently highly ranked, having been The Sunday Times; Scottish University of Year between 2011 and 2013. The university has a strong track record in attracting funding for research from national Research Councils, UK government departments, charities, the European Commission and industrial sponsors. In the REF 2014 survey of all UK universities, 82% of our research was found to be world-class. Dependable Systems group. The Computer Science department, hosting this PhD position, had 78% of its outputs rated `world-leading' or `internationally excellent' in REF 2014.The proposed work will be carried out within the Dependable Systems Group (DSG). With members of staff working on programming languages and compilers (Fensch, Loidl, Michaelson, Scholz), Automated Reasoning and Formal Methods (Georgieva, Grov, Ireland, Komendantskaya), Type Theory (Gabbay), this group will provide an ideal environment for the PhD research. Additionally, the DSG is an active member of the multi-site Mathematical Reasoning Group (joint with U. Edinburgh); the sites holding weekly research meetings and a joint platform grant. ******************************* Dr Ekaterina Komendantskaya Associate Professor in Computer Science School of Mathematical and Computer Sciences Earl Mountbatten Building [ building 21, office G26 ] Heriot-Watt University Edinburgh, UK, EH14 4AS +44 (0)131 451 8283 http://www.macs.hw.ac.uk/~ek19/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at ara.io Mon Feb 13 15:11:45 2017 From: me at ara.io (Ara Adkins) Date: Mon, 13 Feb 2017 15:11:45 +0000 Subject: [Haskell-cafe] Sublime2/3 hsdev patch: testers needed Message-ID: <5B7EA06D-68BF-468A-AC09-9F61F550AE6A@ara.io> Looks like this has fixed an issue I've been having! Seems to have just been merged into master as of ~4 hours ago at the time of writing. Thanks Scott! - Ara > On 13 Feb 2017, at 06:40, Scott Michel wrote: > > Was wondering if there are any Sublime Text users out there who also use hsdev as their Haskell IDE backend. I'd recently (within the last 2 weeks) encountered random lockups, error messages about resources no longer available. I was able to track them down to half-closed pipes and ended up revamping subprocess interaction. So far, I have left a SublimeText session open for 3 days, done some fair amount of work and haven't had any problems. > > If you are a SublimeText 2/3 hsdev user and are comfortable with checking out Sublime packages directly from github, I could use some extra help shaking out the code to ensure that it is as robust as I think it is. The URL to my Github fork is: > > https://github.com/bscottm/SublimeHaskell.git > > Once you've cloned my fork, check out the 'stderr_stdout' branch and test away -- I'm looking for unexpected lockups (e.g., when you've saved a file and ST's status line says "... Checking and Linting" forever.) > > Thanks! > > > -scooter -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok at cs.otago.ac.nz Mon Feb 13 21:15:21 2017 From: ok at cs.otago.ac.nz (ok at cs.otago.ac.nz) Date: Tue, 14 Feb 2017 10:15:21 +1300 Subject: [Haskell-cafe] A question about GHC test coverage Message-ID: Step 1: write a module defining a data type. Step 2: write a module with lots of QuickCheck tests for it. Step 3: Compile with gcc -fhpc to get coverage data. Step 4: run, find bugs, fix bugs, repeat from step 3. Step 5: view coverage .html files, note functions not covered, add tests to step 2 file, repeat. Step 6: Step back with a sigh of content. Coverage high. Step 7, some time later: encounter a bug in an untested function. Why? Because Step 1 includes instance Ord MyType where compare ... ... = ... and the untested function was max. The "inherited" definition is of course fully consistent with compare, and comparison had been tested because I thought of that, but there was an extra requirement which need not detain us here. My problem was that (a) I was too dumb to think of writing tests for a function I hadn't written. (b) Because I hadn't written max, 'hpc' didn't show it to me as something needing a test. Obviously this was my fault: if I have declared instance it's my responsibility to test all of the functions in the type-class. But I might not actually *know* what all the functions in the type-class are; Haskell does change from time to type. And being a bear of very little brain, I could use some reminders "Hey, you've inherited this function but not tested it". Is that possible using ghc -hpc? From scooter.phd at gmail.com Tue Feb 14 01:12:54 2017 From: scooter.phd at gmail.com (Scott Michel) Date: Mon, 13 Feb 2017 17:12:54 -0800 Subject: [Haskell-cafe] Sublime2/3 hsdev patch: testers needed In-Reply-To: <5B7EA06D-68BF-468A-AC09-9F61F550AE6A@ara.io> References: <5B7EA06D-68BF-468A-AC09-9F61F550AE6A@ara.io> Message-ID: Ara: Hack in good health! -scooter On Mon, Feb 13, 2017 at 7:11 AM, Ara Adkins wrote: > Looks like this has fixed an issue I've been having! Seems to have just > been merged into master as of ~4 hours ago at the time of writing. > > Thanks Scott! > > - Ara > > On 13 Feb 2017, at 06:40, Scott Michel wrote: > > Was wondering if there are any Sublime Text users out there who also use > hsdev as their Haskell IDE backend. I'd recently (within the last 2 weeks) > encountered random lockups, error messages about resources no longer > available. I was able to track them down to half-closed pipes and ended up > revamping subprocess interaction. So far, I have left a SublimeText session > open for 3 days, done some fair amount of work and haven't had any problems. > > If you are a SublimeText 2/3 hsdev user and are comfortable with checking > out Sublime packages directly from github, I could use some extra help > shaking out the code to ensure that it is as robust as I think it is. The > URL to my Github fork is: > > https://github.com/bscottm/SublimeHaskell.git > > Once you've cloned my fork, check out the 'stderr_stdout' branch and test > away -- I'm looking for unexpected lockups (e.g., when you've saved a file > and ST's status line says "... Checking and Linting" forever.) > > Thanks! > > > -scooter > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony_clayden at clear.net.nz Tue Feb 14 09:36:13 2017 From: anthony_clayden at clear.net.nz (Anthony Clayden) Date: Tue, 14 Feb 2017 22:36:13 +1300 Subject: [Haskell-cafe] Lenses and records and ecosystem Message-ID: <58a2cf8d.109.93b.11421@clear.net.nz> > On Sat, Feb 11, 2017 at 21:04, David Menendez wrote: > > On Fri, Feb 10, 2017 at 7:53 PM, Anthony Clayden wrote: > > > > Certainly (.) for lenses works 'backwards' > > (i.e. suffix style) > > compared to function-prefix style. > > (As any Lens tutorial will say.) > > > > Those tutorials are oversimplifying. Thank you David, ho hum I'm not getting much feedback about ecosystem/ co-existence; nor a specialised composition operator. > Lenses (and their relatives) transform operations, not values. So it must be a stubborn superstition on my part that getting/putting from/to structures is about values. I'm not here to 'knock' lenses (of whichever model), but every time I scratch the surface, the answers wander off into category theory and higher-order types. I'll draw a comparison with another place in Haskell where category theory has huge benefits: monads. There's less than a handful of operators for monads, and those are conveniently handled behind some elegant syntactic sugar (do-notation). So a newbie doesn't really need to grok monads. They can get on and use them; learn the theory later. Can that be said of lenses? I guess part of the trouble is that H98 record operations have gobbled up so much of the syntactic design space. Nevertheless I don't see what syntactic sugar could help with lenses. > Composition of lenses is exactly like composition of functions, with > the inner-most operation on the right. That doesn't seem to say more than "it's composition". If I want to get a foo out of a bar out of a baz in a s, I'd (perhaps naievely) go foo (bar (baz s)) -- i.e. (foo . bar . baz) s And I'm using function application all the way through. I'd only think of doing s.baz.bar.foo If I was trying to mimic OO style methods. And anyway with lenses, that's exactly what I _can't_ do. Lenses do not use function application of the lens to the structure. You need an extra operator (view, over). Then I'm not seeing the syntactic merit of using composition (.) for lenses. It's certainly making the mental machinery incompatible for lenses vs records, even if they can co-exist semantically. > A lens foo :: Lens > O I transforms an operation on I into an operation on O. A > composition outer.inner turns an operation on the target > of inner into an operation on the source of outer. > > This is demonstrated by the way over distributes with (.): > > over (outer . inner) = over outer . over inner > > What confuses people is view, which is contravariant: > > view (outer . inner) = view inner . view outer > > but you can't avoid having one of over and view be > contravariant. OK. (Why did it need so much category theory to explain that?) And why do those nifty equivalences have to intrude so much into the surface syntax, just to get a value out of a structure? AntC From joe at myrtlesoftware.com Tue Feb 14 12:31:33 2017 From: joe at myrtlesoftware.com (Joe Hermaszewski) Date: Tue, 14 Feb 2017 12:31:33 +0000 Subject: [Haskell-cafe] Myrtle Software is hiring for Haskell positions in Hardware and Machine Learning! Message-ID: Myrtle is looking for multiple skilled Haskell developers to join our growing development team writing a compiler for generating highly efficient hardware designs implementing machine learning solutions. We use Haskell for every aspect of our work and developers will get the chance to be involved in every part of the project. As an example, some things we’ve worked on recently are a tiny CPU to implement a custom network protocol to communicate between a PC and an FPGA and a Haskell implementation of part of the Caffe deep learning framework. Specific tasks you could be working on soon include: implementing fixed point neural network evaluation support in our compiler, supporting AWS F1 instances as a backend, investigating and implementing exciting techniques for neural network evaluation such as the Winograd small convolution algorithm and realising full hardware implementations of existing neural networks. A familiarity and interest with hardware design would be viewed positively but is not essential. Applicants should be familiar with Unix based systems; all our development is done on Ubuntu or NixOS. Applicants should send a resume and covering email, stating your suitability for this role, to jobs at myrtlesoftware.com. Please include any links to blog posts, repositories or any other media which demonstrates your skill set. Roles will be based at our offices in Cambridge, UK. Closing date for applications 5pm, 13th March 2017 About Myrtle Myrtle is a software company based in Cambridge UK with a long history of working at the forefront of compiler technology. We are best known for having helped produce computer generated images for over twenty major Hollywood movies including the Transformers franchise. Myrtle’s clients have included NYSE and NASDAQ listed companies in LA, Vancouver and London. -- Joe https://www.myrtlesoftware.com/vacancies/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From harendra.kumar at gmail.com Tue Feb 14 18:50:33 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Wed, 15 Feb 2017 00:20:33 +0530 Subject: [Haskell-cafe] Extensible records & mandatory/optional record fields Message-ID: In my application, I want some of the fields in a record to have default values while others must always be specified by the user. I can implement this using the rawr records library (http://hackage.haskell.org/package/rawr) like so: def :: ("b" := String) -> R ("a" := Int, "b" := String) def t = (R (#a := 0) :*: R t) -- merge with defaults let r = def (#b := "hello") Here field "a" has a default value (i.e. it is optional when "def" is used) but field "b" does not have a default value and has to be explicitly specified by the user. This is made possible by record merging feature of rawr, making the record extensible. I could not find an equivalent way of achieving this using overloaded records (http://hackage.haskell.org/package/overloaded-records). Is record merging possible or can be made possible using overloaded-records or with the ghc overloaded records poposal? If not, is there a plan to make something like this possible in future? Or will this never be possible with the in built record syntax? Note that, this is handy to simulate mandatory and optional keyword arguments to a function by passing them in the form of a record. Something which is available in other languages like python. -harendra -------------- next part -------------- An HTML attachment was scrubbed... URL: From cepete02 at gmail.com Tue Feb 14 18:55:48 2017 From: cepete02 at gmail.com (Carl Petersen) Date: Tue, 14 Feb 2017 10:55:48 -0800 (PST) Subject: [Haskell-cafe] Loading JSON into a set of nested index-able structures In-Reply-To: <606bbfe3-8026-4e98-9cf8-32c36749c350@googlegroups.com> References: <606bbfe3-8026-4e98-9cf8-32c36749c350@googlegroups.com> Message-ID: Thanks for the replies! Adam, I believe you have hit the mark, I think that I am attempting to use Generics for more than they are able to handle. I'll have to write custom FromJson instances in order to get the results I am looking for. Thanks Again, Carl On Thursday, February 9, 2017 at 7:14:43 AM UTC-6, Carl Petersen wrote: > > Hello All, > > I've used Aeson to load a JSON object with nested lists into a set of data > structures, but what I really need is to load it into a set of data > structures that are index-able such as a HashMap. I've had success loading > the JSON into a structure with the lowest level being a HashMap using > !Object, but I'm having difficulty in figuring out how to nest the > HashMaps. Any hints or direction would be appreciated. > > Thanks, > > Carl > -------------- next part -------------- An HTML attachment was scrubbed... URL: From olf at aatal-apotheke.de Tue Feb 14 21:35:37 2017 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Tue, 14 Feb 2017 22:35:37 +0100 Subject: [Haskell-cafe] A question about GHC test coverage Message-ID: <434A0C8C-C184-42D3-BA1F-A6FD091539AA@aatal-apotheke.de> You should not have to write tests for functions you did not define. Correct me if I'm wrong, but any property of max can be derived from the properties of <=. Sadly, the laws for Ord are not stated in the documentation of Data.Ord. (Because there is no consensus?) They are: Reflexive: if x == y then x <= y Transitive: if x <= y and y <= z then x <= z Antisymmetric: if x <= y and y <= x then x == y Olaf From gershomb at gmail.com Tue Feb 14 21:46:34 2017 From: gershomb at gmail.com (Gershom B) Date: Tue, 14 Feb 2017 16:46:34 -0500 Subject: [Haskell-cafe] Haskell.org committee financial statement 2016 Message-ID: Dear Haskellers, The Haskell.org Committee [1] manages funds for haskell.org and oversees haskell.org infrastructure. The funds available to Haskell.org have historically come from two sources: 1) Mentor payments from the Google Summer of Code program. 2) Donations [2] from the Haskell community at large. Haskell.org is a registered 501(c)3 nonprofit. A portion of our funds are held by Software in the Public Interest, also a 501(c)3 US non-profit, through which we also accept donations. In 2016 we were not accepted into the GSoC program, and ran a summer of haskell program along similar lines, funded by earmarked donations provided by individual and corporate sponsors and from our pool of general funds. A full list of sponsors is on the soh webpage [3]. According to our charter, "Each year, the committee will post a statement of the haskell.org assets, and the transactions for that year." Included in this message is a brief statement of Haskell.org assets over the period 1 December 2015 - 31 December 2016. Aside from the SOH disbursements, our expenses are nearly entirely hosting, with a small overhead incurred by payment processing. SOH thus accounts for both our increased revenue (in the form of earmarked donations) and expenses this year. We do not have full statements from our SPI account yet, as their treasury reports are only complete through october at this time [4] although I hope that will be changed shortly. So this statement is produced as though the income and expenses on our spi account for the last for months of 2016 were net zero, though that was obviously not the case. Even in this incomplete state, I think it is better to provide this than nothing. Additionally, as this covers holdings in our haskell.org bank account, it does not reflect when funds received via paypal donations, are received by paypal, but rather when the lump sum transfers from them are received by us. So paypal donations made in December 2016, for example, will likely be reflected in our 2017 statement. A portion of the income in 2016 is also attributable to gsoc mentor payment from our participation in the 2015 program. Thanks to many generous donations, despite the substantial haskell summer of code expenditures, we are nonetheless net-positive in income (though the difference just about amounts to the outstanding gsoc payments from 2015). We hope to find good opportunity to put our reserves to use again in the coming year. 1. Income and Expenses Total revenue over 2016: 54,802.56 Total expenses over 2016: 48,344.05 ---- Net income over 2016: 6,458.51 2. Total Balance Balance as of 31 December 2015: 32,882.34 Balance as of 31 December 2016: 39,340.85 [1] https://wiki.haskell.org/Haskell.org_committee [2] https://wiki.haskell.org/Donate_to_Haskell.org [3] https://summer.haskell.org/ [5] http://spi-inc.org/treasurer/reports/ Best, Gershom for the Haskell.org Committee From dave at zednenem.com Tue Feb 14 22:48:26 2017 From: dave at zednenem.com (David Menendez) Date: Tue, 14 Feb 2017 17:48:26 -0500 Subject: [Haskell-cafe] Lenses and records and ecosystem In-Reply-To: <58a2cf8d.109.93b.11421@clear.net.nz> References: <58a2cf8d.109.93b.11421@clear.net.nz> Message-ID: On Tue, Feb 14, 2017 at 4:36 AM, Anthony Clayden < anthony_clayden at clear.net.nz> wrote: > > On Sat, Feb 11, 2017 at 21:04, David Menendez wrote: > > > Lenses (and their relatives) transform operations, not > values. > > So it must be a stubborn superstition on my part > that getting/putting from/to structures is about values. > I don’t understand what you mean. Ultimately, the operations that you use with lenses are all about retrieving or modifying values. > I'm not here to 'knock' lenses (of whichever model), > but every time I scratch the surface, > the answers wander off into category theory > and higher-order types. > I’ll agree that the internal structure of lenses is pretty involved, and there are some historical design decisions that arguably make them more complicated than necessary, and that keeping compatibility between the various flavors of lens-like things prevents hiding those details from the user. I’m not sure who’s bringing category theory into the discussion. I don’t know that it has much to say about lenses and lens-like things. > I'll draw a comparison with another place in Haskell > where category theory has huge benefits: monads. > > There's less than a handful of operators for monads, > and those are conveniently handled behind some elegant > syntactic sugar (do-notation). > > So a newbie doesn't really need to grok monads. > They can get on and use them; learn the theory later. > > Can that be said of lenses? > Reasonable people can disagree about the operators in the lens package, but the only one you really need is (.), which comes from the prelude. Everything else has a named function equivalent. > I guess part of the trouble is that H98 record operations > have gobbled up so much of the syntactic design space. > > Nevertheless I don't see what syntactic sugar could help > with lenses. > > > Composition of lenses is exactly like composition of > functions, with > > the inner-most operation on the right. > > That doesn't seem to say more than "it's composition". > If I want to get a foo out of a bar out of a baz in a s, > I'd (perhaps naievely) go > > foo (bar (baz s)) -- i.e. > (foo . bar . baz) s > > And I'm using function application all the way through. > Lenses are not functions that retrieve values from structures, but they can be used to create those functions. If you had written (view foo . view bar . view baz) s, that would be okay. > Lenses do not use function application of the lens to the > structure. > You need an extra operator (view, over). > Exactly. > Then I'm not seeing the syntactic merit of using > composition (.) for lenses. The power of the lens package is that it uses a common functional representation across a spectrum of lens-like things, ranging from widely-applicable (Fold) to highly-flexible (Iso), all of which can be sensibly composed using function composition. > It's certainly making the mental machinery incompatible > for lenses vs records, even if they can co-exist > semantically. > How so? Records don’t use (.) at all. > > A lens foo :: Lens > > O I transforms an operation on I into an operation on O. A > > composition outer.inner turns an operation on the target > > of inner into an operation on the source of outer. > > > > This is demonstrated by the way over distributes with (.): > > > > over (outer . inner) = over outer . over inner > > > > What confuses people is view, which is contravariant: > > > > view (outer . inner) = view inner . view outer > > > > but you can't avoid having one of over and view be > > contravariant. > > OK. (Why did it need so much category theory to explain > that?) > What category theory did I use? > And why do those nifty equivalences have to intrude so much > into the surface syntax, just to get a value out of a > structure? > What do you mean? If all you want to do is retrieve a value from a structure, you can just use simple functions. The whole point of lenses is that they do more than that. -- Dave Menendez -------------- next part -------------- An HTML attachment was scrubbed... URL: From pieter at laeremans.org Wed Feb 15 14:36:30 2017 From: pieter at laeremans.org (Pieter Laeremans) Date: Wed, 15 Feb 2017 15:36:30 +0100 Subject: [Haskell-cafe] Self updating binary Message-ID: <1487169390.2416474.881862208.1808690E@webmail.messagingengine.com> Hi there, Has anyone experience suggestions with writing self updating binaries for windows ? I have a small utility that I have to install on two "unmanaged" pc's, I would like to let the program check an url, for new versions, download a new versions, some how check that the program is valid (with a build in key, or certificate) and replace itself when necessary. Has anyone already done this in Haskell? Any suggestions, links ? Thanks, Pieter -- Pieter Laeremans pieter at laeremans.org From P.Achten at cs.ru.nl Wed Feb 15 15:18:29 2017 From: P.Achten at cs.ru.nl (Peter Achten) Date: Wed, 15 Feb 2017 16:18:29 +0100 Subject: [Haskell-cafe] 1st call for papers: Trends in Functional Programming, 19-21 june 2017, University of Kent, Canterbury Message-ID: <04cbd276-f3c2-56c5-8aba-e7623599ba28@cs.ru.nl> ----------------------------- C A L L F O R P A P E R S ----------------------------- ======== TFP 2017 =========== 18th Symposium on Trends in Functional Programming 19-21 June, 2017 University of Kent, Canterbury https://www.cs.kent.ac.uk/events/tfp17/index.html The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming, taking a broad view of current and future trends in the area. It aspires to be a lively environment for presenting the latest research results, and other contributions (see below). Authors of draft papers will be invited to submit revised papers based on the feedback receive at the symposium. A post-symposium refereeing process will then select a subset of these articles for formal publication. TFP 2017 will be the main event of a pair of functional programming events. TFP 2017 will be accompanied by the International Workshop on Trends in Functional Programming in Education (TFPIE), which will take place on 22 June. The TFP symposium is the heir of the successful series of Scottish Functional Programming Workshops. Previous TFP symposia were held in * Edinburgh (Scotland) in 2003; * Munich (Germany) in 2004; * Tallinn (Estonia) in 2005; * Nottingham (UK) in 2006; * New York (USA) in 2007; * Nijmegen (The Netherlands) in 2008; * Komarno (Slovakia) in 2009; * Oklahoma (USA) in 2010; * Madrid (Spain) in 2011; * St. Andrews (UK) in 2012; * Provo (Utah, USA) in 2013; * Soesterberg (The Netherlands) in 2014; * Inria Sophia-Antipolis (France) in 2015; * and Maryland (USA) in 2016. For further general information about TFP please see the TFP homepage. (http://www.tifp.org/). == SCOPE == The symposium recognizes that new trends may arise through various routes. As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: Research Articles: leading-edge, previously unpublished research work Position Articles: on what new trends should or should not be Project Articles: descriptions of recently started new projects Evaluation Articles: what lessons can be drawn from a finished project Overview Articles: summarizing work with respect to a trendy subject Articles must be original and not simultaneously submitted for publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or experience-oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Topics suitable for the symposium include, but are not limited to: Functional programming and multicore/manycore computing Functional programming in the cloud High performance functional computing Extra-functional (behavioural) properties of functional programs Dependently typed functional programming Validation and verification of functional programs Debugging and profiling for functional languages Functional programming in different application areas: security, mobility, telecommunications applications, embedded systems, global computing, grids, etc. Interoperability with imperative programming languages Novel memory management techniques Program analysis and transformation techniques Empirical performance studies Abstract/virtual machines and compilers for functional languages (Embedded) domain specific languages New implementation strategies Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2017 program chairs, Scott Owens and Meng Wang. == BEST PAPER AWARDS == To reward excellent contributions, TFP awards a prize for the best paper accepted for the formal proceedings. TFP traditionally pays special attention to research students, acknowledging that students are almost by definition part of new subject trends. A student paper is one for which the authors state that the paper is mainly the work of students, the students are listed as first authors, and a student would present the paper. A prize for the best student paper is awarded each year. In both cases, it is the PC of TFP that awards the prize. In case the best paper happens to be a student paper, that paper will then receive both prizes. == SPONSORS == TBD == PAPER SUBMISSIONS == Acceptance of articles for presentation at the symposium is based on a lightweight peer review process of extended abstracts (4 to 10 pages in length) or full papers (20 pages). The submission must clearly indicate which category it belongs to: research, position, project, evaluation, or overview paper. It should also indicate which authors are research students, and whether the main author(s) are students. A draft paper for which ALL authors are students will receive additional feedback by one of the PC members shortly after the symposium has taken place. We use EasyChair for the refereeing process. Papers must be submitted at: https://easychair.org/conferences/?conf=tfp17 Papers must be written in English, and written using the LNCS style. For more information about formatting please consult the Springer LNCS web site: http://www.springer.com/computer/lncs?SGWID=0-164-6-793341-0 == IMPORTANT DATES == Submission of draft papers: 5 May, 2017 Notification: 12 May, 2017 Registration: 11 June, 2017 TFP Symposium: 19-21 June, 2017 Student papers feedback: 29 June, 2017 Submission for formal review: 2 August, 2017 Notification of acceptance: 3 November, 2017 Camera ready paper: 2 December, 2017 == PROGRAM COMMITTEE == TBD From lachrist at vub.ac.be Wed Feb 15 17:01:37 2017 From: lachrist at vub.ac.be (Laurent Christophe) Date: Wed, 15 Feb 2017 18:01:37 +0100 Subject: [Haskell-cafe] Applicative transformers Message-ID: <5473A7B2-284D-4DF7-BBA1-A90408555C09@vub.ac.be> Hi guys, the way `StateT` are implemented as `Applicative` have been buggling my mind for some time. https://hackage.haskell.org/package/transformers-0.5.2.0/docs/src/Control.Monad.Trans.State.Lazy.html#line-201 instance (Functor m, Monad m) => Applicative (StateT s m) where pure a = StateT $ \ s -> return (a, s) StateT mf <*> StateT mx = StateT $ \ s -> do (f, s') <- mf s (x, s'') <- mx s' return (f x, s'') Using dependant monadic computations, this implementation cannot be expressed in term of applicative. This explains why we cannot have `instance (Applicative m) => Applicative (State s m)`. However using real monadic style computations for implementing `<*>` buggles my mind. Moreover `liftA2 (<*>)` can be used to generically compose applicative functors so why monads are needed? https://www.haskell.org/haskellwiki/Applicative_functor#Applicative_transfomers Any inputs would be greatly appreciated! Cheers, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From will.yager at gmail.com Wed Feb 15 18:03:38 2017 From: will.yager at gmail.com (Will Yager) Date: Wed, 15 Feb 2017 12:03:38 -0600 Subject: [Haskell-cafe] Applicative transformers In-Reply-To: <5473A7B2-284D-4DF7-BBA1-A90408555C09@vub.ac.be> References: <5473A7B2-284D-4DF7-BBA1-A90408555C09@vub.ac.be> Message-ID: Given StateT mf <*> StateT mx mf :: s -> m (a -> b, s) mx :: s -> m (a, s) We have (s :: s) in scope. We can apply mf to s no problem. Now what do we do with mx? We also need to give it (_ :: s). We could give it the same s we gave mf, but that would be wrong. It would ignore any state changes in mf. So the correct option is to use the s value returned by mf. But there's no way to get it out of the monad. You could use the functor properties of m to get fmap (\(s, f) -> fmap (\(s, a) -> (s, f a)) (mx s)) (mf s) Which has type m (m (s, b)) So you still need a monadic join to get the desired result. The applicative instance doesn't really help as far as I can tell because it doesn't let you do anything to things of the form x -> m y Which is what StateT is made of. Will > On Feb 15, 2017, at 11:01 AM, Laurent Christophe wrote: > > Hi guys, the way `StateT` are implemented as `Applicative` have been buggling my mind for some time. > https://hackage.haskell.org/package/transformers-0.5.2.0/docs/src/Control.Monad.Trans.State.Lazy.html#line-201 > > instance (Functor m, Monad m) => Applicative (StateT s m) where > pure a = StateT $ \ s -> return (a, s) > StateT mf <*> StateT mx = StateT $ \ s -> do > (f, s') <- mf s > (x, s'') <- mx s' > return (f x, s'') > > Using dependant monadic computations, this implementation cannot be expressed in term of applicative. > This explains why we cannot have `instance (Applicative m) => Applicative (State s m)`. > However using real monadic style computations for implementing `<*>` buggles my mind. > Moreover `liftA2 (<*>)` can be used to generically compose applicative functors so why monads are needed? > https://www.haskell.org/haskellwiki/Applicative_functor#Applicative_transfomers > > Any inputs would be greatly appreciated! > > Cheers, > Laurent > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony_clayden at clear.net.nz Wed Feb 15 21:01:06 2017 From: anthony_clayden at clear.net.nz (Anthony Clayden) Date: Thu, 16 Feb 2017 10:01:06 +1300 Subject: [Haskell-cafe] Extensible records & mandatory/optional record fields Message-ID: <58a4c192.9a.58.14861@clear.net.nz> > On Tue, 14 Feb 2017 at 18:50, Harendra Kumar said: > In my application, I want some of the fields in a record to have default > values while others must always be specified by the user. I can implement > this using the rawr records library (http://hackage.haskell.org/package/rawr) Hi Harendra. I believe rawr builds on some of the work in 'overloaded records'. That's a suite of features being developed right now look here for what's coming soon https://github.com/adamgundry/ghc-proposals/blob/overloaded-record-fields/proposals/0000-overloaded-record-fields.rst > like so: > > def :: ("b" := String) -> R ("a" := Int, "b" := String) > def t = (R (#a := 0) :*: R t) -- merge with defaults > > let r = def (#b := "hello") That looks like some sort of anonymous/extensible records system. What is data constructor `R`; where is it defined? There's a few mentions of 'anonymous' records on that link above. (And mention of rawr.) It's not clear what you're trying to do. Do you need anonymous/extensible records? Why use `let` to bind a value for `r`? > Here field "a" has a default value (i.e. it is optional when "def" is used) > but field "b" does not have a default value and has to be explicitly > specified by the user. This is made possible by record merging feature of > rawr, making the record extensible. > I could not find an equivalent way of achieving this using overloaded > records (http://hackage.haskell.org/package/overloaded-records). So far, overloaded records is based on standard-ish Haskell record decls. So you must declare a distinct record constructor and field labels. Like data MyR = MyR { a :: Int, b :: String }; If you want default values: myRdef = MyR{ a = 0 }; -- don't have to give b Then bind some value, to incorp defaults. r = myRdef { b = "hello" }; -- takes the defult for a > Is record merging possible or can be made possible It looks to me like you don't need '"record merging". What do you think it is; why do you think you need it? > using overloaded-records or with the ghc overloaded records poposal? > If not, is there a plan to make something like this possible in future? I'd say it's on the radar, but a long way off. > Or will this never be possible with the in built record syntax? I think that built-in record syntax will fit your requirements. > Note that, this is handy to simulate mandatory and optional keyword > arguments to a function by passing them in the form of a record. Sure. Keyword arguments to a function are fixed. No need for building dynamic/anonymous structures. Yes it's good (and standard practice) to pass as a record. So you can use a standard built-in Haskell record decl, as I used above. > Something which is available in other languages like python. It looks to me that you're trying to write Python code in Haskell. Not a good idea. Use built-in/static features first. Think about the difference between a compiled vs interpreted language. Only when static features really really aren't working, consider dynamic/extensible. AntC From dave at zednenem.com Wed Feb 15 21:29:58 2017 From: dave at zednenem.com (David Menendez) Date: Wed, 15 Feb 2017 16:29:58 -0500 Subject: [Haskell-cafe] Applicative transformers In-Reply-To: <5473A7B2-284D-4DF7-BBA1-A90408555C09@vub.ac.be> References: <5473A7B2-284D-4DF7-BBA1-A90408555C09@vub.ac.be> Message-ID: On Wed, Feb 15, 2017 at 12:01 PM, Laurent Christophe wrote: > Hi guys, the way `StateT` are implemented as `Applicative` have been > buggling my mind for some time. > https://hackage.haskell.org/package/transformers-0.5.2.0/ > docs/src/Control.Monad.Trans.State.Lazy.html#line-201 > > instance (Functor m, Monad m) => Applicative (StateT s m) where > pure a = StateT $ \ s -> return (a, s) > StateT mf <*> StateT mx = StateT $ \ s -> do > (f, s') <- mf s > (x, s'') <- mx s' > return (f x, s'') > > Using dependant monadic computations, this implementation cannot be > expressed in term of applicative. > This explains why we cannot have `instance (Applicative m) => Applicative > (State s m)`. > However using real monadic style computations for implementing `<*>` > buggles my mind. > Moreover `liftA2 (<*>)` can be used to generically compose applicative > functors so why monads are needed? > https://www.haskell.org/haskellwiki/Applicative_functor#Applicative_ > transfomers > StateT s m is not a composition of applicative functors. It allows two-way communication between the state and the underlying monad m. Like Compose m (State s), effects in m can affect how the state evolves. Like Compose (State s) m, the state can influence what effects occur in m. For example, StateT s Maybe will discard changes to the state if a subcomputation returns Nothing and permits subcomputations to choose whether to return Nothing based on the state. No applicative composition of State s and Maybe can do both. These limitations are implied by the underlying types: Compose m (State s) a = m (s -> (a, s)) Compose (State s) m a = s -> (m a, s) StateT s m a = s -> m (a, s) -- Dave Menendez -------------- next part -------------- An HTML attachment was scrubbed... URL: From wangbj at gmail.com Wed Feb 15 22:57:45 2017 From: wangbj at gmail.com (Baojun Wang) Date: Wed, 15 Feb 2017 22:57:45 +0000 Subject: [Haskell-cafe] possible bug in latest hackage Elf (Elf-0.27) In-Reply-To: References: <20140515073052.GA23472@sniper> Message-ID: Hi cafe, It's been for quite a while and there's no version upgrade of this package, may I ask to take maintainer ship of this package? Regards baojun On Fri, May 16, 2014 at 2:04 AM Markus Läll wrote: > I would argue *for* forking. Hackage is big and consists of many packages > which have only a few users, or maybe just one -- the author. I don't see > all these packages if I don't go on the page and look. But when I do, I > will be looking for *them*. If some popular package stops working then I > would be happy to find a fork, because now I can just tell cabal about it. > And if the original gets fixed, I can go back. I don't think people who > fork are looking for aquiring yet another package to maintain forever, or > to take it over. > > > > On Thu, May 15, 2014 at 11:18 AM, Sven Panne wrote: > > 2014-05-15 9:30 GMT+02:00 Roman Cheplyaka : > > If there's no response, then you have two choices: > > Actually three: Fix things locally until the "official" package is fixed. > > > * request package maintainership, which will take several weeks > > I really hope that this will take months, not weeks, see the other > discussion > > > * fork the package (i.e. upload your patched version to hackage under a > > different name) > > This proposal worries me quite a bit, because if everybody follows > that advice, it will turn Hackage into a chaotic collection of > packages with various degrees of being fixed/maintained/etc. Imagine a > package 'foo', which needs a fix, and several pepole think it's a good > idea to fork and fix the issue at hand. Now we have 'foo', 'foo-XY', > 'foo-my-cool-acronym', ... Of course people normally have no incentive > to really take over maintainership for 'foo', they just want a working > 'foo' right now for their own project. Later the real maintainer > re-appears after vacation/sabbatical/whatever, fixes 'foo', and > continues to work on it, adding new features. Now somebody new comes > to Hackage to see if there is already a package for some use case, and > finds 'foo', 'foo-XY', 'foo-my-cool-acronym', ... Then it takes some > non-trivial detective work to find out which packages are actually > dead (again) and which is the real one. => Chaos IMHO. > > In a nutshell: If you are really in a hurry, fix things locally. > Hackage is not the place to fork like hell. > > _______________________________________________ > 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 harendra.kumar at gmail.com Wed Feb 15 23:06:59 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Thu, 16 Feb 2017 04:36:59 +0530 Subject: [Haskell-cafe] Extensible records & mandatory/optional record fields In-Reply-To: <58a4c192.9a.58.14861@clear.net.nz> References: <58a4c192.9a.58.14861@clear.net.nz> Message-ID: Hi Anthony, Please see my comments below. On 16 February 2017 at 02:31, Anthony Clayden wrote: > > On Tue, 14 Feb 2017 at 18:50, Harendra Kumar said: > > Hi Harendra. I believe rawr builds on some of the work in > 'overloaded records'. > I am aware of the ghc "overloaded records" proposal. rawr provides anonymous extensible records using the overloaded labels feature of ghc 8. Records can be merged or partitioned. I believe, the key difference between "overloaded records" and rawr is that the latter provides extensible records while the former does not. Though overloaded records can match a record based on the fields it contains. > > It's not clear what you're trying to do. > Do you need anonymous/extensible records? > I am trying to write a program which provides a friendly high level DSL to the user. I want a pure function like API but instead of passing positional parameters I want the user to be able to specify arguments based on keywords and be able to skip any optional arguments. Something like the following, name is mandatory and email is optional: maintainer (#name := "Harendra Kumar", #email := "xyz at gmail.com") I can achieve this using rawr. The argument to the function is an anonymous record and we can pattern match partially using the mandatory fields in the record to statically check that those fields are present. The optional fields are then supplied by applying the user supplied record on a default record. Here is a full working program for this example (you will need the latest rawr from github): {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedLabels #-} {-# LANGUAGE ScopedTypeVariables#-} {-# LANGUAGE TypeOperators#-} import Data.Rawr pr t = print $ case (R t) of r@(P (_ := name :: "name" := String)) -> R (#email := " default at gmail.com") :<= r main = do -- both name and email are specified by the user. pr (#name := "Harendra Kumar", #email := "xyz at gmail.com") -- only name is supplied by the user, the default value of the optional field "email" will be used pr (#name := "Harendra Kumar") -- This will not compile since name is a mandatory field -- pr (#email := "xyz at gmail.com") I am pretty sure that I am not writing python code in Haskell I was only trying to say that this is a pretty useful feature in python and I guess in some other imperative languages too. It allows you to write self documenting code where necessary. It will be nice if we have a way to achieve something like this. > >Like > > data MyR = MyR { a :: Int, b :: String }; > > If you want default values: > > myRdef = MyR{ a = 0 }; -- don't have to give b > > Then bind some value, to incorp defaults. > > r = myRdef { b = "hello" }; -- takes the defult for a > > This is the first approach that I tried, this is commonly used in many libraries. The only drawback with this is that I cannot enforce mandatory/optional fields statically. All fields are optional in this case. -harendra -------------- next part -------------- An HTML attachment was scrubbed... URL: From anthony_clayden at clear.net.nz Thu Feb 16 01:52:19 2017 From: anthony_clayden at clear.net.nz (Anthony Clayden) Date: Thu, 16 Feb 2017 14:52:19 +1300 Subject: [Haskell-cafe] Extensible records & mandatory/optional record fields Message-ID: <58a505d3.17a.2821.6715@clear.net.nz> > On 15 February 2017 at 23:06 Harendra Kumar wrote: >> On 16 February 2017 at 02:31, Anthony Clayden wrote: > > > I am aware of the ghc "overloaded records" proposal. rawr > provides anonymous extensible records using the overloaded > labels feature of ghc 8. Records can be merged or > partitioned. I believe, the key difference between > "overloaded records" and rawr is that the latter provides > extensible records while the former does not. Yes. But you seem to be talking about a different 'feature' of rawr. For gathering params to a function, I see no need for extensible records. The params are known at compile time. If for a DSL you want 'optional' fields, make them Maybe's, with a default of Nothing. > > I am trying to write a program which provides a friendly > high level DSL to the user. 'user' here seems to mean programmer, if you're looking for static guarantees. > I want a pure function like > API but instead of passing positional parameters I want > the user to be able to specify arguments based on keywords > and be able to skip any optional arguments. Something like > the following, name is mandatory and email is optional: > > maintainer (#name := "Harendra Kumar", #email := > "xyz at gmail.com") > > I can achieve this using rawr. The argument to the > function is an anonymous record ... OK. But I'm not seeing why it has to be anonymous. Again, if it's for a specific function, it needs specific parameters. An anonymous record might provide keywords not valid, as well as fail to provide keywords expected. > and we can pattern match > partially using the mandatory fields in the record to > statically check that those fields are present. OK. That's the critical feature you want, then. It wasn't clear from your O.P. > > I was only trying to say that this is a pretty > useful feature in python and I guess in some other > imperative languages too. (I don't think it's anything to do with programming paradigm.) > It allows you to write self > documenting code where necessary. No the code you posted was not self-documenting. (The comments were useful, thank you.) Only a python-charmer would claim code full of graphic chars is 'self-documenting'. I have no idea what it was that made #name mandatory but #email not. > It will be nice if we have a way to achieve something like this. > There's nothing in the standard language currently. > > [example] > This is the first approach that I tried, this is commonly > used in many libraries. The only drawback with this is > that I cannot enforce mandatory/optional fields > statically. All fields are optional in this case. So your DSL is going to be compiled? Not intepreted? Including putting in values like #name? I'd expect #name would come from end-user input at run time(?) Yes the approach I illustrated is common in many libraries. Perhaps authors of those libraries are listening in, and could comment. AntC From harendra.kumar at gmail.com Thu Feb 16 03:01:21 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Thu, 16 Feb 2017 08:31:21 +0530 Subject: [Haskell-cafe] Extensible records & mandatory/optional record fields In-Reply-To: <58a505d3.17a.2821.6715@clear.net.nz> References: <58a505d3.17a.2821.6715@clear.net.nz> Message-ID: On 16 February 2017 at 07:22, Anthony Clayden wrote: > > On 15 February 2017 at 23:06 Harendra Kumar wrote: > > >> On 16 February 2017 at 02:31, Anthony Clayden wrote: > > For gathering params to a function, I see no need for > extensible records. > The params are known at compile time. > If for a DSL you want 'optional' fields, make them Maybe's, > with a default of Nothing. > The point is - I do not want the user to specify all parameters explicitly. There may be a whole bunch of optional parameters in the record but only a few are to be specified in general. I do not want 2 values and 10 Nothings or explicit defaults there. > > > > I am trying to write a program which provides a friendly > > high level DSL to the user. > > 'user' here seems to mean programmer, > if you're looking for static guarantees. > Yes, but more of a declarative programmer. > > > I want a pure function like > > API but instead of passing positional parameters I want > > the user to be able to specify arguments based on keywords > > and be able to skip any optional arguments. Something like > > the following, name is mandatory and email is optional: > > > > maintainer (#name := "Harendra Kumar", #email := > > "xyz at gmail.com") > > > > I can achieve this using rawr. The argument to the > > function is an anonymous record ... > > OK. But I'm not seeing why it has to be anonymous. > Again, if it's for a specific function, it needs specific > parameters. > An anonymous record might provide keywords not valid, > as well as fail to provide keywords expected. > It does not necessarily have to be anonymous. But I see no problem if it is anonymous. Type checking catches missing keywords or invalid keywords. The example I gave does not have correct type constraints but by fixing it you cannot give it incorrect keywords, I just tested it. -harendra -------------- next part -------------- An HTML attachment was scrubbed... URL: From icfp.publicity at googlemail.com Thu Feb 16 04:43:26 2017 From: icfp.publicity at googlemail.com (Lindsey Kuper) Date: Wed, 15 Feb 2017 20:43:26 -0800 Subject: [Haskell-cafe] Final Call for Papers: ICFP 2017 Message-ID: <58a52dee3cf81_1ae73fdf45c55be863836@landin.local.mail> ICFP 2017 The 22nd ACM SIGPLAN International Conference on Functional Programming Oxford, United Kingdom http://icfp17.sigplan.org/ Final Call for Papers ### Important dates Submissions due: Monday, February 27, Anywhere on Earth https://icfp17.hotcrp.com Author response: Monday, April 17, 2017, 15:00 (UTC) - Thursday, April 20, 2017, 15:00 (UTC) Notification: Monday, 1 May, 2017 Final copy due: Monday, 5 June 2017 Early registration: TBA Conference: Monday, 4 September - Wednesday, 6 September, 2017 ### New this year Those familiar with previous ICFP conferences should be aware of two significant changes that are being introduced in 2017: 1. Papers selected for ICFP 2017 will be published as the ICFP 2017 issue of a new journal, Proceedings of the ACM on Programming Languages (PACMPL), which replaces the previous ICFP conference proceedings. The move to PACMPL will have two noticeable impacts on authors: * A new, two-phase selection and reviewing process that conforms to ACM’s journal reviewing guidelines. * A new, single-column format for submissions. 2. Authors of papers that are conditionally accepted in the first phase of the reviewing process will have the option to submit materials for Artifact Evaluation. Further details on each of these changes are included in the following text. ### Scope ICFP 2017 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, and from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects, concurrency, or parallelism. Topics of interest include (but are not limited to): * *Language Design*: concurrency, parallelism, and distribution; modules; components and composition; metaprogramming; type systems; interoperability; domain-specific languages; and relations to imperative, object-oriented, or logic programming. * *Implementation*: abstract machines; virtual machines; interpretation; compilation; compile-time and run-time optimization; garbage collection and memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components, or low-level machine resources. * *Software-Development Techniques*: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling. * *Foundations*: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects; program verification; dependent types. * *Analysis and Transformation*: control-flow; data-flow; abstract interpretation; partial evaluation; program calculation. * *Applications*: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia and 3D graphics programming; scripting; system administration; security. * *Education*: teaching introductory programming; parallel programming; mathematical proof; algebra. Submissions will be evaluated according to their relevance, correctness, significance, originality, and clarity. Each submission should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. ICFP 2017 also welcomes submissions in two separate categories --- Functional Pearls and Experience Reports --- that must be marked as such at the time of submission and that need not report original research results. Detailed guidelines on both categories are given at the end of this call. Please contact the program chair if you have questions or are concerned about the appropriateness of a topic. ### Preparation of submissions ICFP 2017 will employ a lightweight double-blind reviewing process, as described below. **Deadline**: The deadline for submissions is Monday, February 27, 2017, Anywhere on Earth (). This deadline will be strictly enforced. **Formatting**: (NOTE: NEW FORMAT REQUIREMENTS FOR ICFP 2017) Submissions must be in PDF format, printable in black and white on US Letter sized paper, and interpretable by common PDF tools. All submissions must adhere to the "ACM Large" template that is available (in both LaTeX and Word formats) from . For authors using LaTeX, a lighter-weight package, including only the essential files, is available from ; the appropriate template for ICFP 2017 authors is in the file `acmart-pacmpl-template.tex`. As documented in the template, submissions should be prepared using the `acmlarge` and `anonymous` options. The use of the `review` option is also strongly encouraged but not required. (The `review` option will add line numbers, which will make it easier for reviewers to reference specific parts of your paper in their comments, but should have absolutely no other effect on the typesetting.) Details of available technical support for LaTeX-specific questions is available at . There is a limit of 24 pages for a full paper or 12 pages for an Experience Report; in either case, the bibliography will not be counted against these limits. These page limits have been chosen to allow essentially the same amount of content with the new single-column format as was possible with the two-column format used in past ICFP conferences. Submissions that exceed the page limits or, for other reasons, do not meet the requirements for formatting, will be summarily rejected. **Citations**: As part of PACMPL, ICFP 2017 papers are expected to use author-year citations for references to other work. Author-year citations may be used as either a noun phrase, such as "The lambda calculus was originally conceived by Church (1932)", or a parenthetic phrase, such as "The lambda calculus (Church 1932) was intended as a foundation for mathematics". A useful test for correct usage it to make sure that the text still reads correctly when the parenthesized portions of any references are omitted. Take care with prepositions; in the first example above, "by" is more appropriate than "in" because it allows the text to be read correctly as a reference to the author. Sometimes, readability may be improved by putting parenthetic citations at the end of a clause or a sentence, such as "A foundation for mathematics was provided by the lambda calculus (Church 1932)". In LaTeX, use `\citet{Church-1932}` for citations as a noun phrase, "Church (1932)", and `\citep{Church-1932}` for citations as a parenthetic phrase, "(Church 1932)"; for details, see Sections 2.3--2.5 of the natbib documentation (). **Submission**: Submissions will be accepted at . Improved versions of a paper may be submitted at any point before the submission deadline using the same web interface. **Author Response Period**: Authors will have a 72-hour period, starting at 15:00 UTC on Monday, April 17, 2017, to read reviews and respond to them. **Supplementary Materials**: Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. The material should be uploaded at submission time, as a single pdf or a tarball, not via a URL. This supplementary material may or may not be anonymized; if not anonymized, it will only be revealed to reviewers after they have submitted their review of the paper and learned the identity of the author(s). **Authorship Policies**: All submissions are expected to comply with the ACM Policies for Authorship that are detailed at . **Republication Policies**: Each submission must adhere to SIGPLAN's republication policy, as explained on the web at . **Resubmitted Papers**: Authors who submit a revised version of a paper that has previously been rejected by another conference have the option to attach an annotated copy of the reviews of their previous submission(s), explaining how they have addressed these previous reviews in the present submission. If a reviewer identifies him/herself as a reviewer of this previous submission and wishes to see how his/her comments have been addressed, the program chair will communicate to this reviewer the annotated copy of his/her previous review. Otherwise, no reviewer will read the annotated copies of the previous reviews. ### Review Process This section outlines the two-stage process with lightweight double-blind reviewing that will be used to select papers for presentation at ICFP 2017. A [list of frequently asked questions and answers](http://icfp17.sigplan.org/track/icfp-2017-papers#Submission-and-Reviewing-FAQ) that address common concerns is available on the conference website and will be updated as necessary to clarify and expand on this process. **ICFP 2017 will employ a two-stage review process.** The first stage in the review process will assess submitted papers using the criteria stated above and will allow for feedback and input on initial reviews through the author response period mentioned previously. At the PC meeting, a set of papers will be conditionally accepted and all other papers will be rejected. Authors will be notified of these decisions on May 1, 2017. Authors of conditionally accepted papers will be provided with committee reviews (just as in previous conferences) along with a set of mandatory revisions. After five weeks (June 5, 2017), the authors will provide a second submission. The second and final reviewing phase assesses whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. The intent and expectation is that the mandatory revisions can be addressed within five weeks and hence that conditionally accepted papers will in general be accepted in the second phase. The second submission should clearly identify how the mandatory revisions were addressed. To that end, the second submission must be accompanied by a cover letter mapping each mandatory revision request to specific parts of the paper. The cover letter will facilitate a quick second review, allowing for confirmation of final acceptance within two weeks. Conversely, the absence of a cover letter will be grounds for the paper’s rejection. This process is intended as a refinement of the review process that has been used in previous ICFP conferences. By incorporating a second stage, the process will conform to ACM’s journal reviewing guidelines for PACMPL. **ICFP 2017 will employ a lightweight double-blind reviewing process.** To facilitate this, submitted papers must adhere to two rules: 1. **author names and institutions must be omitted**, and 2. **references to authors' own related work should be in the third person** (e.g., not "We build on our previous work ..." but rather "We build on the work of ..."). The purpose of this process is to help the PC and external reviewers come to an initial judgement about the paper without bias, not to make it impossible for them to discover the authors if they were to try. Nothing should be done in the name of anonymity that weakens the submission or makes the job of reviewing the paper more difficult (e.g., important background references should not be omitted or anonymized). In addition, authors should feel free to disseminate their ideas or draft versions of their paper as they normally would. For instance, authors may post drafts of their papers on the web or give talks on their research ideas. ### Information for Authors of Accepted Papers * As a condition of acceptance, final versions of all papers must adhere to the new ACM Large format. The page limits for final versions of papers will be increased to ensure that authors have space to respond to reviewer comments and mandatory revisions. * Authors of accepted submissions will be required to agree to one of the three ACM licensing options: copyright transfer to ACM; retaining copyright but granting ACM exclusive publication rights; or open access on payment of a fee. Further information about ACM author rights is available from . * At least one author of each accepted submission will be expected to attend and present their paper at the conference. (ICFP welcomes all authors, regardless of nationality. If any author of an accepted submission has visa-related difficulties in travelling to the conference, we will make arrangements to enable remote participation, and not require them to attend the conference in order to present their talk. In such a case contact us (icfp2017 at cs.ox.ac.uk) for further guidance.) The schedule for presentations will be determined and shared with authors after the full program has been selected. Presentations will be videotaped and released online if the presenter consents. * We intend that the proceedings will be freely available for download from the ACM Digital Library in perpetuity via the OpenTOC mechanism. * ACM Author-Izer is a unique service that enables ACM authors to generate and post links on either their home page or institutional repository for visitors to download the definitive version of their articles from the ACM Digital Library at no charge. Downloads through Author-Izer links are captured in official ACM statistics, improving the accuracy of usage and impact measurements. Consistently linking to the definitive version of an ACM article should reduce user confusion over article versioning. After an article has been published and assigned to the appropriate ACM Author Profile pages, authors should visit to learn how to create links for free downloads from the ACM DL. * **AUTHORS TAKE NOTE: The official publication date is the date the proceedings are made available in the ACM Digital Library. This date may be up to *two weeks prior* to the first day of the conference. The official publication date affects the deadline for any patent filings related to published work.** ### Artifact Evaluation Authors of papers that are conditionally accepted in the first phase of the review process will be encouraged (but not required) to submit supporting materials for Artifact Evaluation. These items will then be reviewed by a committee, separate from the program committee, whose task is to assess how the artifacts support the work described in the associated paper. Papers that go through the Artifact Evaluation process successfully will receive a seal of approval printed on the papers themselves. Authors of accepted papers will be encouraged to make the supporting materials publicly available upon publication of the proceedings, for example, by including them as "source materials" in the ACM Digital Library. An additional seal will mark papers whose artifacts are made available, as outlined in the ACM guidelines for artifact badging. Participation in Artifact Evaluation is voluntary and will not influence the final decision regarding paper acceptance. Further information about the motivations and expectations for Artifact Evaluation can be found at . ### Special categories of papers In addition to research papers, ICFP solicits two kinds of papers that do not require original research contributions: Functional Pearls, which are full papers, and Experience Reports, which are limited to half the length of a full paper. Authors submitting such papers should consider the following guidelines. #### Functional Pearls A Functional Pearl is an elegant essay about something related to functional programming. Examples include, but are not limited to: * a new and thought-provoking way of looking at an old idea * an instructive example of program calculation or proof * a nifty presentation of an old or new data structure * an interesting application of functional programming techniques * a novel use or exposition of functional programming in the classroom While pearls often demonstrate an idea through the development of a short program, there is no requirement or expectation that they do so. Thus, they encompass the notions of theoretical and educational pearls. Functional Pearls are valued as highly and judged as rigorously as ordinary papers, but using somewhat different criteria. In particular, a pearl is not required to report original research, but, it should be concise, instructive, and entertaining. A pearl is likely to be rejected if its readers get bored, if the material gets too complicated, if too much specialized knowledge is needed, or if the writing is inelegant. The key to writing a good pearl is polishing. A submission that is intended to be treated as a pearl must be marked as such on the submission web page, and should contain the words "Functional Pearl" somewhere in its title or subtitle. These steps will alert reviewers to use the appropriate evaluation criteria. Pearls will be combined with ordinary papers, however, for the purpose of computing the conference's acceptance rate. #### Experience Reports The purpose of an Experience Report is to help create a body of published, refereed, citable evidence that functional programming really works --- or to describe what obstacles prevent it from working. Possible topics for an Experience Report include, but are not limited to: * insights gained from real-world projects using functional programming * comparison of functional programming with conventional programming in the context of an industrial project or a university curriculum * project-management, business, or legal issues encountered when using functional programming in a real-world project * curricular issues encountered when using functional programming in education * real-world constraints that created special challenges for an implementation of a functional language or for functional programming in general An Experience Report is distinguished from a normal ICFP paper by its title, by its length, and by the criteria used to evaluate it. * Both in the proceedings and in any citations, the title of each accepted Experience Report must begin with the words "Experience Report" followed by a colon. The acceptance rate for Experience Reports will be computed and reported separately from the rate for ordinary papers. * Experience Report submissions can be at most 12 pages long, excluding bibliography. * Each accepted Experience Report will be presented at the conference, but depending on the number of Experience Reports and regular papers accepted, authors of Experience reports may be asked to give shorter talks. * Because the purpose of Experience Reports is to enable our community to accumulate a body of evidence about the efficacy of functional programming, an acceptable Experience Report need not add to the body of knowledge of the functional-programming community by presenting novel results or conclusions. It is sufficient if the Report states a clear thesis and provides supporting evidence. The thesis must be relevant to ICFP, but it need not be novel. The program committee will accept or reject Experience Reports based on whether they judge the evidence to be convincing. Anecdotal evidence will be acceptable provided it is well argued and the author explains what efforts were made to gather as much evidence as possible. Typically, more convincing evidence is obtained from papers which show how functional programming was used than from papers which only say that functional programming was used. The most convincing evidence often includes comparisons of situations before and after the introduction or discontinuation of functional programming. Evidence drawn from a single person's experience may be sufficient, but more weight will be given to evidence drawn from the experience of groups of people. An Experience Report should be short and to the point: it should make a claim about how well functional programming worked on a particular project and why, and produce evidence to substantiate this claim. If functional programming worked in this case in the same ways it has worked for others, the paper need only summarize the results --- the main part of the paper should discuss how well it worked and in what context. Most readers will not want to know all the details of the project and its implementation, but the paper should characterize the project and its context well enough so that readers can judge to what degree this experience is relevant to their own projects. The paper should take care to highlight any unusual aspects of the project. Specifics about the project are more valuable than generalities about functional programming; for example, it is more valuable to say that the team delivered its software a month ahead of schedule than it is to say that functional programming made the team more productive. If the paper not only describes experience but also presents new technical results, or if the experience refutes cherished beliefs of the functional-programming community, it may be better off submitted it as a full paper, which will be judged by the usual criteria of novelty, originality, and relevance. The program chair will be happy to advise on any concerns about which category to submit to. ### Organizers General Chair: Jeremy Gibbons (University of Oxford, UK) Program Chair: Mark Jones (Portland State University, USA) Artifact Evaluation Chair: Ryan R. Newton (Indiana University, USA) Industrial Relations Chair: Ryan Trinkle (Obsidian Systems LLC, USA) Programming Contest Organiser: Sam Lindley (University of Edinburgh, UK) Publicity and Web Chair: Lindsey Kuper (Intel Labs, USA) Student Research Competition Chair: Ilya Sergey (University College London, UK) Video Chair: Jose Calderon (Galois, Inc., USA) Workshops Co-Chair: Andres Löh (Well-Typed LLP) Workshops Co-Chair: David Christiansen (Indiana University, USA) Program Committee: Bob Atkey (University of Strathclyde, Scotland) Adam Chlipala (MIT, USA) Dominique Devriese (KU Leuven, Belgium) Martin Erwig (Oregon State, USA) Matthew Flatt (University of Utah, USA) Ronald Garcia (University of British Columbia, Canada) Kathryn Gray (University of Cambridge, England) John Hughes (Chalmers University and Quvik, Sweden) Chung-Kil Hur (Seoul National University, Korea) Graham Hutton (University of Nottingham, England) Alan Jeffrey (Mozilla Research, USA) Ranjit Jhala (University of California, San Diego, USA) Shin-ya Katsumata (Kyoto University, Japan) Lindsey Kuper (Intel Labs, USA) Dan Licata (Wesleyan University, USA) Ben Lippmeier (Digital Asset, Australia) Gabriel Scherer (Northeastern University, USA) Alexandra Silva (University College London, England) Nikhil Swamy (Microsoft Research, USA) Sam Tobin-Hochstadt (Indiana University, USA) Nicolas Wu (University of Bristol, England) Beta Ziliani (CONICET and FAMAF, Universidad Nacional de Córdoba, Argentina) From gershomb at gmail.com Thu Feb 16 07:56:27 2017 From: gershomb at gmail.com (Gershom B) Date: Thu, 16 Feb 2017 02:56:27 -0500 Subject: [Haskell-cafe] possible bug in latest hackage Elf (Elf-0.27) In-Reply-To: References: <20140515073052.GA23472@sniper> Message-ID: CCing admin at hackage which is the group of folks who can take care of such a request :-) -g On February 15, 2017 at 6:00:59 PM, Baojun Wang (wangbj at gmail.com) wrote: > Hi cafe, > > It's been for quite a while and there's no version upgrade of this package, > may I ask to take maintainer ship of this package? > > Regards > baojun > > On Fri, May 16, 2014 at 2:04 AM Markus Läll wrote: > > > I would argue *for* forking. Hackage is big and consists of many packages > > which have only a few users, or maybe just one -- the author. I don't see > > all these packages if I don't go on the page and look. But when I do, I > > will be looking for *them*. If some popular package stops working then I > > would be happy to find a fork, because now I can just tell cabal about it. > > And if the original gets fixed, I can go back. I don't think people who > > fork are looking for aquiring yet another package to maintain forever, or > > to take it over. > > > > > > > > On Thu, May 15, 2014 at 11:18 AM, Sven Panne wrote: > > > > 2014-05-15 9:30 GMT+02:00 Roman Cheplyaka : > > > If there's no response, then you have two choices: > > > > Actually three: Fix things locally until the "official" package is fixed. > > > > > * request package maintainership, which will take several weeks > > > > I really hope that this will take months, not weeks, see the other > > discussion > > > > > * fork the package (i.e. upload your patched version to hackage under a > > > different name) > > > > This proposal worries me quite a bit, because if everybody follows > > that advice, it will turn Hackage into a chaotic collection of > > packages with various degrees of being fixed/maintained/etc. Imagine a > > package 'foo', which needs a fix, and several pepole think it's a good > > idea to fork and fix the issue at hand. Now we have 'foo', 'foo-XY', > > 'foo-my-cool-acronym', ... Of course people normally have no incentive > > to really take over maintainership for 'foo', they just want a working > > 'foo' right now for their own project. Later the real maintainer > > re-appears after vacation/sabbatical/whatever, fixes 'foo', and > > continues to work on it, adding new features. Now somebody new comes > > to Hackage to see if there is already a package for some use case, and > > finds 'foo', 'foo-XY', 'foo-my-cool-acronym', ... Then it takes some > > non-trivial detective work to find out which packages are actually > > dead (again) and which is the real one. => Chaos IMHO. > > > > In a nutshell: If you are really in a hurry, fix things locally. > > Hackage is not the place to fork like hell. > > > > _______________________________________________ > > 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 > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From ivanperezdominguez at gmail.com Thu Feb 16 13:31:03 2017 From: ivanperezdominguez at gmail.com (Ivan Perez) Date: Thu, 16 Feb 2017 13:31:03 +0000 Subject: [Haskell-cafe] Self updating binary In-Reply-To: <1487169390.2416474.881862208.1808690E@webmail.messagingengine.com> References: <1487169390.2416474.881862208.1808690E@webmail.messagingengine.com> Message-ID: Hi Pieter Not recently, but back when I tried this for keera-posture, I had difficulties with one binary substituting itself *on windows*. If the file was being executed, I could not erase it. (keera-posture did check a URL for new versions.) You can download a setup program that you can run without user intervention, closing your main program while it updates. Some installation building systems support unattended updates/installations. Otherwise, what you can do is to *rename* the current executable, store the new one in place of the old one, and erase old executables every time you start the app. Yes, it's a hack. It would be great if we could have automatic updates of programs from remote archives using the package manager like on linux :( Ivan On 15 February 2017 at 14:36, Pieter Laeremans wrote: > Hi there, > > Has anyone experience suggestions with writing self updating binaries > for windows ? > I have a small utility that I have to install on two "unmanaged" pc's, > I would like to let the program check an url, for new versions, download > a new versions, > some how check that the program is valid (with a build in key, or > certificate) and replace itself when necessary. > > Has anyone already done this in Haskell? Any suggestions, links ? > > Thanks, > > Pieter > -- > Pieter Laeremans > pieter at laeremans.org > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kcvinu82 at gmail.com Thu Feb 16 13:35:27 2017 From: kcvinu82 at gmail.com (vinod kc) Date: Thu, 16 Feb 2017 19:05:27 +0530 Subject: [Haskell-cafe] How to code Haskell in KDevelop in Windows Message-ID: Hi, I am new in Haskell. I installed GHC and KDevelop. But i don't know how to setup Haskell in KDevelop. Can anybody help me ? Thanks in advance -Vinod -------------- next part -------------- An HTML attachment was scrubbed... URL: From michael at snoyman.com Thu Feb 16 13:41:11 2017 From: michael at snoyman.com (Michael Snoyman) Date: Thu, 16 Feb 2017 15:41:11 +0200 Subject: [Haskell-cafe] Self updating binary In-Reply-To: References: <1487169390.2416474.881862208.1808690E@webmail.messagingengine.com> Message-ID: We implemented that trick for Windows in Stack, which you can see at: https://github.com/commercialhaskell/stack/blob/c3e05b3b4c3649aa6c182eaf661102e170d459a9/src/Stack/Setup.hs#L1749 On Thu, Feb 16, 2017 at 3:31 PM, Ivan Perez wrote: > Hi Pieter > > Not recently, but back when I tried this for keera-posture, I had > difficulties with one binary substituting itself *on windows*. If the file > was being executed, I could not erase it. > > (keera-posture did check a URL for new versions.) > > You can download a setup program that you can run without user > intervention, closing your main program while it updates. Some installation > building systems support unattended updates/installations. > > Otherwise, what you can do is to *rename* the current executable, store > the new one in place of the old one, and erase old executables every time > you start the app. Yes, it's a hack. > > It would be great if we could have automatic updates of programs from > remote archives using the package manager like on linux :( > > Ivan > > On 15 February 2017 at 14:36, Pieter Laeremans > wrote: > >> Hi there, >> >> Has anyone experience suggestions with writing self updating binaries >> for windows ? >> I have a small utility that I have to install on two "unmanaged" pc's, >> I would like to let the program check an url, for new versions, download >> a new versions, >> some how check that the program is valid (with a build in key, or >> certificate) and replace itself when necessary. >> >> Has anyone already done this in Haskell? Any suggestions, links ? >> >> Thanks, >> >> Pieter >> -- >> Pieter Laeremans >> pieter at laeremans.org >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timmelzer at gmail.com Thu Feb 16 13:58:59 2017 From: timmelzer at gmail.com (Norbert Melzer) Date: Thu, 16 Feb 2017 13:58:59 +0000 Subject: [Haskell-cafe] How to code Haskell in KDevelop in Windows In-Reply-To: References: Message-ID: According to https://www.kdevelop.org/features there is no support for Haskell. So you can't setup KDevelop for Haskell. Please consider using Emacs, Vim, Atom, IntelliJ, Sublime, all of them have some Haskell Plugins available that go beyond syntax highlighting, all are very different to setup though. vinod kc schrieb am Do., 16. Feb. 2017 um 14:36 Uhr: > Hi, > I am new in Haskell. I installed GHC and KDevelop. But i don't know how to > setup Haskell in KDevelop. Can anybody help me ? > Thanks in advance > -Vinod > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dev at justus.science Fri Feb 17 11:22:32 2017 From: dev at justus.science (Justus Adam) Date: Fri, 17 Feb 2017 12:22:32 +0100 Subject: [Haskell-cafe] [ANN] marvin-0.1.0, a Haskell framework for writing chat bots Message-ID: Hello Haskell enthusiasts, For a couple of months now I’ve been working on a framework for writing chat bots in Haskell. The project is very heavily inspired by Hubot (https://hubot.github.com/ ) and for the most part mimics its API. However it provides all the nice Haskell features, such as type safety and running as compiled code, rather than interpreted. If you’re curious check it out, I’d love some feedback. (Verbose) Documentation: http://marvin.readthedocs.io Package: https://hackage.haskell.org/package/marvin Source code repository: https://github.com/JustusAdam/marvin Suggestions and issues: https://github.com/JustusAdam/marvin/issues Regards, Justus -------------- next part -------------- An HTML attachment was scrubbed... URL: From dct25-561bs at mythic-beasts.com Fri Feb 17 11:34:35 2017 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Fri, 17 Feb 2017 11:34:35 +0000 Subject: [Haskell-cafe] RFC 822 date parser Message-ID: Hi all, Does anyone know of a more up-to-date parser for RFC822-formatted dates than the one I can find in the `time-http` package? That package hasn't been touched in a while and its dependencies seem rather dated. Many thanks, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukewm at riseup.net Fri Feb 17 11:36:21 2017 From: lukewm at riseup.net (Luke Murphy) Date: Fri, 17 Feb 2017 11:36:21 +0000 Subject: [Haskell-cafe] [ANN] marvin-0.1.0, a Haskell framework for writing chat bots In-Reply-To: References: Message-ID: <268335b8-2614-a6de-d01b-81abd60f3c8a@riseup.net> > (Verbose) Documentation: http://marvin.readthedocs.io Thank you for taking the time to do that. Running a `stack install marvin` ended in a bunch of bounds errors. Do you feel like getting it onto Stackage to keep it in sync with the the rest of the snapshot? https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package Best, Luke On 17.02.2017 11:22, Justus Adam wrote: > Hello Haskell enthusiasts, > > For a couple of months now I’ve been working on a framework for writing > chat bots in Haskell. > The project is very heavily inspired by Hubot > (https://hubot.github.com/) and for the most part mimics its API. > However it provides all the nice Haskell features, such as type safety > and running as compiled code, rather than interpreted. > > If you’re curious check it out, I’d love some feedback. > > (Verbose) Documentation: http://marvin.readthedocs.io > > Package: https://hackage.haskell.org/package/marvin > > Source code repository: https://github.com/JustusAdam/marvin > > Suggestions and issues: https://github.com/JustusAdam/marvin/issues > > > Regards, > Justus > > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: OpenPGP digital signature URL: From dev at justus.science Fri Feb 17 12:35:30 2017 From: dev at justus.science (Justus Adam) Date: Fri, 17 Feb 2017 13:35:30 +0100 Subject: [Haskell-cafe] [ANN] marvin-0.1.0, a Haskell framework for writing chat bots In-Reply-To: <268335b8-2614-a6de-d01b-81abd60f3c8a@riseup.net> References: <268335b8-2614-a6de-d01b-81abd60f3c8a@riseup.net> Message-ID: Oh .. thats probably due to the `pvp-bounds` I enabled. I should maybe add the version bounds manually … Haven’t had the time yet though :/ I’ve submitted a pull request to stackage to get it added. For now It should work if you install it with the packages from lts-7.15, that’s the one I build it against. Regards, Justus > On 17 Feb 2017, at 12:36 PM, Luke Murphy wrote: > >> (Verbose) Documentation: http://marvin.readthedocs.io > > Thank you for taking the time to do that. > > Running a `stack install marvin` ended in a bunch of bounds errors. Do > you feel like getting it onto Stackage to keep it in sync with the the > rest of the snapshot? > > https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package > > Best, > > Luke > > On 17.02.2017 11:22, Justus Adam wrote: >> Hello Haskell enthusiasts, >> >> For a couple of months now I’ve been working on a framework for writing >> chat bots in Haskell. >> The project is very heavily inspired by Hubot >> (https://hubot.github.com/) and for the most part mimics its API. >> However it provides all the nice Haskell features, such as type safety >> and running as compiled code, rather than interpreted. >> >> If you’re curious check it out, I’d love some feedback. >> >> (Verbose) Documentation: http://marvin.readthedocs.io >> >> Package: https://hackage.haskell.org/package/marvin >> >> Source code repository: https://github.com/JustusAdam/marvin >> >> Suggestions and issues: https://github.com/JustusAdam/marvin/issues >> >> >> Regards, >> Justus >> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. >> > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From ivan.miljenovic at gmail.com Fri Feb 17 12:59:58 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Fri, 17 Feb 2017 23:59:58 +1100 Subject: [Haskell-cafe] RFC 822 date parser In-Reply-To: References: Message-ID: On 17 February 2017 at 22:34, David Turner wrote: > Hi all, > > Does anyone know of a more up-to-date parser for RFC822-formatted dates than > the one I can find in the `time-http` package? That package hasn't been > touched in a while and its dependencies seem rather dated. Data.Time.Format in the time package has a specified RFC822 format string that looks like it can be used with it's parser. Happstack seems to have an RFC822Headers module that might have something. timerep on Hackage also has an RFC822 module. > > Many thanks, > > David > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From dct25-561bs at mythic-beasts.com Fri Feb 17 13:12:03 2017 From: dct25-561bs at mythic-beasts.com (David Turner) Date: Fri, 17 Feb 2017 13:12:03 +0000 Subject: [Haskell-cafe] RFC 822 date parser In-Reply-To: References: Message-ID: On 17 Feb 2017 13:00, "Ivan Lazar Miljenovic" wrote: On 17 February 2017 at 22:34, David Turner wrote: > Hi all, > > Does anyone know of a more up-to-date parser for RFC822-formatted dates than > the one I can find in the `time-http` package? That package hasn't been > touched in a while and its dependencies seem rather dated. Data.Time.Format in the time package has a specified RFC822 format string that looks like it can be used with it's parser. So it does. Right down at the very bottom, I never noticed it before. It's not fully compliant (the day-of-the-week is optional) but otherwise great. Happstack seems to have an RFC822Headers module that might have something. timerep on Hackage also has an RFC822 module. That's the badger! No idea how I missed it, that looks like the one to use. Thanks very much, David -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrei.paskevich at lri.fr Fri Feb 17 20:52:35 2017 From: andrei.paskevich at lri.fr (Andrei Paskevich) Date: Fri, 17 Feb 2017 21:52:35 +0100 Subject: [Haskell-cafe] VSTTE 2017 - First Call for Papers Message-ID: <20170217205235.cobnybnqtcip7fu3@tikki.lri.fr> 9th Working Conference on Verified Software: Theories, Tools, and Experiments (VSTTE) https://vstte17.lri.fr July 22-23, 2017, Heidelberg, Germany Co-located with the 29th International Conference on Computer-Aided Verification, CAV 2017 Important Dates * Abstract submission: Mon, Apr 24, 2017 * Full paper submission: Mon, May 1, 2017 * Notification: Mon, Jun 5, 2017 * VSTTE: Sat-Sun, Jul 22-23, 2017 * Camera-ready: Mon, Aug 21, 2017 Overview The goal of the VSTTE conference series is to advance the state of the art in the science and technology of software verification, through the interaction of theory development, tool evolution, and experimental validation. We welcome submissions describing significant advances in the production of verified software, i.e., software that has been proved to meet its functional specifications. Submissions of theoretical, practical, and experimental contributions are equally encouraged, including those that focus on specific problems or problem domains. We are especially interested in submissions describing large-scale verification efforts that involve collaboration, theory unification, tool integration, and formalized domain knowledge. We also welcome papers describing novel experiments and case studies evaluating verification techniques and technologies. Topics of interest for VSTTE include education, requirements modeling, specification languages, specification/verification/certification case studies, formal calculi, software design methods, automatic code generation, refinement methodologies, compositional analysis, verification tools (e.g., static analysis, dynamic analysis, model checking, theorem proving, satisfiability), tool integration, benchmarks, challenge problems, and integrated verification environments. Paper Submissions We accept both long (limited to 16 pages) and short (limited to 10 pages) paper submissions. Short submissions also cover Verification Pearls describing an elegant proof or proof technique. Submitted research papers and system descriptions must be original and not submitted for publication elsewhere. Each submission will be evaluated by at least three members of the Program Committee. We expect that one author of every accepted paper will present their work at the conference. Paper submissions must be written in English using the LNCS LaTeX format (http://www.springer.com/gp/computer-science/lncs/conference-proceedings-guidelines) and must include a cogent and self-contained description of the ideas, methods, results, and comparison to existing work. Papers will be submitted via EasyChair at the VSTTE 2017 conference page (https://www.easychair.org/conferences/?conf=vstte2017). The post-conference proceedings of VSTTE 2017 will be published in the LNCS series. Authors of accepted papers will be requested to sign the copyright transfer form. A selection of best papers will be invited for publication in the Journal of Automated Reasoning. Program Committee * June Andronick (University of New South Wales, Australia) * Christel Baier (TU Dresden, Germany) * Sandrine Blazy (Université de Rennes 1, France) * Arthur Charguéraud (Inria, France) * Ernie Cohen (Amazon Web Services, USA) * Rayna Dimitrova (MPI-SWS, Germany) * Carlo A. Furia (Chalmers University of Technology, Sweden) * Arie Gurfinkel (University of Waterloo, Canada) * Hossein Hojjat (Rochester Institute of Technology, USA) * Marieke Huisman (University of Twente, Netherlands) * Bart Jacobs (KU Leuven, Belgium) * Rajeev Joshi (NASA Jet Propulsion Laboratory, USA) * Zachary Kincaid (Princeton University, USA) * Akash Lal (Microsoft Research, India) * Shuvendu Lahiri (Microsoft Research, USA) * Francesco Logozzo (Facebook, USA) * Peter Müller (ETH Zürich, Switzerland) * Jorge A. Navas (SRI International, USA) * Scott Owens (University of Kent, UK) * Andrei Paskevich (Université Paris-Sud, France), co-chair * Gerhard Schellhorn (Universität Augsburg, Germany) * Peter Schrammel (University of Sussex, UK) * Natarajan Shankar (SRI International, USA) * Mihaela Sighireanu (Université Paris-Diderot, France) * Julien Signoles (CEA LIST, France) * Michael Tautschnig (Queen Mary University of London, UK) * Tachio Terauchi (JAIST, Japan) * Oksana Tkachuk (NASA Ames Research Center, USA) * Mattias Ulbrich (Karlsruhe Institute of Technology, Germany) * Thomas Wies (New York University, USA), co-chair From allbery.b at gmail.com Fri Feb 17 21:34:29 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 17 Feb 2017 16:34:29 -0500 Subject: [Haskell-cafe] RFC 822 date parser In-Reply-To: References: Message-ID: On Fri, Feb 17, 2017 at 8:12 AM, David Turner wrote: > So it does. Right down at the very bottom, I never noticed it before. It's > not fully compliant (the day-of-the-week is optional) but otherwise great. In the real world, missing day of week is a *very* common violation of specs that want RFC822-format dates. Supporting that is a practical necessity. -- 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 clintonmead at gmail.com Fri Feb 17 21:57:39 2017 From: clintonmead at gmail.com (Clinton Mead) Date: Sat, 18 Feb 2017 08:57:39 +1100 Subject: [Haskell-cafe] Getting a rewrite rule to fire Message-ID: Basically, I want to rewrite `g (f x)` with `h x` where it's valid to do so (i.e. appropriate instances of `h` exist). The code I've put below is a silly example just to illustrate the issue. I guess the tricky thing is that whether the rewrite rule can fire depends on the result of `g (f x)`, not just x itself. Does anyone know how to adjust this so the rewrite rule fires? {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeApplications #-} module Main where data D a {-# INLINE [1] f #-} f :: a -> D a f = undefined type family T a type instance T Char = Int {-# INLINE [1] g' #-} g' :: (G a) => D (T a) -> a g' = undefined class G a where g :: D (T a) -> a g = g' instance G Char class H a where h :: T a -> a main = ((g (f (2 :: Int))) :: Char) `seq` return () {-# RULES "myrule" forall (x :: H a => T a). g' (f x) = h @a x #-} -------------- next part -------------- An HTML attachment was scrubbed... URL: From code at funwithsoftware.org Sat Feb 18 00:42:33 2017 From: code at funwithsoftware.org (Patrick Pelletier) Date: Fri, 17 Feb 2017 16:42:33 -0800 Subject: [Haskell-cafe] [ANN] pi-lcd-0.1.0.0 Message-ID: <759bf1a9-9c92-9bc9-bac4-d68d4ab7c2b0@funwithsoftware.org> https://hackage.haskell.org/package/pi-lcd https://github.com/ppelleti/pi-lcd I recently bought an Adafruit LCD+Keypad Kit for Raspberry Pi. The LCD+Keypad Kit has a 16x2 character LCD, an RGB LED backlight (depending on the model), and five buttons. It works on all models of Raspberry Pi, and plugs into the GPIO header. https://www.adafruit.com/categories/808 Adafruit only supplies a Python library for communicating with the LCD+Keypad Kit. I wanted to program it in Haskell, so I wrote this Haskell library for communicating with it. The library automatically handles Unicode, using the LCD controller's built-in characters where possible, and using the "custom characters" feature, along with a 5x8 font bundled with this package, to emulate Unicode characters which are not built-in. The user of the library can also define their own custom characters. Everything you need to use one of these LCDs is exposed in the System.Hardware.PiLcd module. The submodules are only exposed because they might be useful to reuse for other types of hardware, such as if you are using an MCP23017 port expander or an HD44780 display controller in some other context. But if you're using the Adafruit LCD+Keypad Kit, all you need is System.Hardware.PiLcd. Before using this package, you'll need to make sure that I²C is enabled on your Raspberry Pi, under "Advanced Options" in raspi-config. Using PiLcd is as easy as: {-# LANGUAGE OverloadedStrings #-} import System.Hardware.PiLcd main = do lcd <- openPiLcd defaultLcdAddress defaultLcdOptions updateDisplay lcd ["Hello,", "World!"] setBacklightColor lcd Cyan closePiLcd lcd There are additional examples in the "examples" directory. This library is specifically designed to work with GHC 7.6.3 and up, and to not use Template Haskell, so it will work with the system-supplied version of GHC on Raspbian "Jessie." Just do "sudo apt-get install ghc cabal-install" and you're good to go. (You should also increase the swap space by editing /etc/dphys-swapfile.) There are other ways to install more recent versions of GHC if you want; see the "Raspberry Pi" page on the Haskell Wiki for details. This is a fairly early release, and there might be breaking changes in the future. Please contact me, by filing a GitHub issue, or by email, if you have any feedback on the library. I'm considering adding support for other LCDs, such as the Display-O-Tron 3000 and/or Display-O-Tron HAT. Let me know if you'd like to see support for those displays. I'd also be curious to hear how the library is being used! From hesselink at gmail.com Sat Feb 18 19:13:47 2017 From: hesselink at gmail.com (Erik Hesselink) Date: Sat, 18 Feb 2017 20:13:47 +0100 Subject: [Haskell-cafe] possible bug in latest hackage Elf (Elf-0.27) In-Reply-To: References: <20140515073052.GA23472@sniper> Message-ID: Hi Baojun, I've added you to the maintainers of 'elf' on hackage. Regards, Erik On 16 February 2017 at 08:56, Gershom B wrote: > CCing admin at hackage which is the group of folks who can take care of such > a request :-) > > -g > > > On February 15, 2017 at 6:00:59 PM, Baojun Wang (wangbj at gmail.com) wrote: > > Hi cafe, > > > > It's been for quite a while and there's no version upgrade of this > package, > > may I ask to take maintainer ship of this package? > > > > Regards > > baojun > > > > On Fri, May 16, 2014 at 2:04 AM Markus Läll wrote: > > > > > I would argue *for* forking. Hackage is big and consists of many > packages > > > which have only a few users, or maybe just one -- the author. I don't > see > > > all these packages if I don't go on the page and look. But when I do, I > > > will be looking for *them*. If some popular package stops working then > I > > > would be happy to find a fork, because now I can just tell cabal about > it. > > > And if the original gets fixed, I can go back. I don't think people who > > > fork are looking for aquiring yet another package to maintain forever, > or > > > to take it over. > > > > > > > > > > > > On Thu, May 15, 2014 at 11:18 AM, Sven Panne wrote: > > > > > > 2014-05-15 9:30 GMT+02:00 Roman Cheplyaka : > > > > If there's no response, then you have two choices: > > > > > > Actually three: Fix things locally until the "official" package is > fixed. > > > > > > > * request package maintainership, which will take several weeks > > > > > > I really hope that this will take months, not weeks, see the other > > > discussion > > > > > > > * fork the package (i.e. upload your patched version to hackage > under a > > > > different name) > > > > > > This proposal worries me quite a bit, because if everybody follows > > > that advice, it will turn Hackage into a chaotic collection of > > > packages with various degrees of being fixed/maintained/etc. Imagine a > > > package 'foo', which needs a fix, and several pepole think it's a good > > > idea to fork and fix the issue at hand. Now we have 'foo', 'foo-XY', > > > 'foo-my-cool-acronym', ... Of course people normally have no incentive > > > to really take over maintainership for 'foo', they just want a working > > > 'foo' right now for their own project. Later the real maintainer > > > re-appears after vacation/sabbatical/whatever, fixes 'foo', and > > > continues to work on it, adding new features. Now somebody new comes > > > to Hackage to see if there is already a package for some use case, and > > > finds 'foo', 'foo-XY', 'foo-my-cool-acronym', ... Then it takes some > > > non-trivial detective work to find out which packages are actually > > > dead (again) and which is the real one. => Chaos IMHO. > > > > > > In a nutshell: If you are really in a hurry, fix things locally. > > > Hackage is not the place to fork like hell. > > > > > > _______________________________________________ > > > 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 > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Sat Feb 18 22:18:32 2017 From: david.feuer at gmail.com (David Feuer) Date: Sat, 18 Feb 2017 17:18:32 -0500 Subject: [Haskell-cafe] Getting a rewrite rule to fire In-Reply-To: References: Message-ID: I'm pretty sure this *won't* work. First off, there are known issues with class methods showing up anywhere in RULES. But more fundamentally, the whole instance resolution mechanism drops away after type checking. The simplifier, which is responsible for applying RULES, has no idea whether a type is an instance of a class. On Fri, Feb 17, 2017 at 4:57 PM, Clinton Mead wrote: > Basically, I want to rewrite `g (f x)` with `h x` where it's valid to do so > (i.e. appropriate instances of `h` exist). The code I've put below is a > silly example just to illustrate the issue. > > I guess the tricky thing is that whether the rewrite rule can fire depends > on the result of `g (f x)`, not just x itself. > > Does anyone know how to adjust this so the rewrite rule fires? > > {-# LANGUAGE TypeFamilies #-} > {-# LANGUAGE TypeApplications #-} > > module Main where > > data D a > > {-# INLINE [1] f #-} > f :: a -> D a > f = undefined > > type family T a > type instance T Char = Int > > {-# INLINE [1] g' #-} > g' :: (G a) => D (T a) -> a > g' = undefined > > class G a where > g :: D (T a) -> a > g = g' > > instance G Char > > class H a where > h :: T a -> a > > main = ((g (f (2 :: Int))) :: Char) `seq` return () > > {-# RULES > "myrule" forall (x :: H a => T a). g' (f x) = h @a x > #-} > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From brucker at spamfence.net Sat Feb 18 22:57:07 2017 From: brucker at spamfence.net (Achim D. Brucker) Date: Sat, 18 Feb 2017 22:57:07 +0000 Subject: [Haskell-cafe] ThEdu'17: Call for Extended Abstracts & Demonstrations Message-ID: <20170218225707.mrdcxysafeksj7s2@fujikawa.home.brucker.ch> (Apologies for duplicates) Call for Extended Abstracts & Demonstrations ThEdu'17 Theorem proving components for Educational software http://www.uc.pt/en/congressos/thedu/thedu17 at CADE 26 International Conference on Automated Deduction 6-11 August 2017 Gothenburg, Sweden http://www.cade-26.info/ ThEdu'17 Scope Computer Theorem Proving is becoming a paradigm as well as a technological base for a new generation of educational software in science, technology, engineering and mathematics. The workshop brings together experts in automated deduction with experts in education in order to further clarify the shape of the new software generation and to discuss existing systems. Topics of interest include: * methods of automated deduction applied to checking students' input; * methods of automated deduction applied to prove post-conditions for particular problem solutions; * combinations of deduction and computation enabling systems to propose next steps; * automated provers specific for dynamic geometry systems; * proof and proving in mathematics education. Important Dates Extended Abstracts: 18 June 2017 Author Notification: 2 July 2017 Final Version: 16 July 2017 Workshop Day: 6 August 2017 Submission Interested researchers are invited to submit extended abstracts and system descriptions. Both kinds of submissions should be approximately 5 pages in length and present original unpublished work not submitted elsewhere. Submission is in PDF format via easychair, https://easychair.org/conferences/?conf=thedu17 formatted according to http://www.easychair.org/publications/easychair.zip The extended abstracts and system descriptions will be made available online. At least one author is expected to presents his/her submission at ThEdu'17. Joint publication in companion with other CADE26 events is under consideration (as a volume in the EPiC Series in Computing). Program Committee Francisco Botana, University of Vigo at Pontevedra, Spain Achim D. Brucker, University of Sheffield, United Kingdom Filip Maric, University of Belgrade, Serbia Walther Neuper, Graz University of Technology, Austria (co-chair) Pavel Pech , University of South Bohemia, Czech Republic Pedro Quaresma, University of Coimbra, Portugal (co-chair) Vanda Santos, CISUC, Portugal Wolfgang Schreiner, Johannes Kepler University, Austria Burkhart Wolff, University Paris-Sud, France -- Dr. Achim D. Brucker | Software Assurance & Security | University of Sheffield https://www.brucker.ch | https://logicalhacking.com/blog @adbrucker | @logicalhacking From dev at justus.science Sun Feb 19 10:51:52 2017 From: dev at justus.science (Justus Adam) Date: Sun, 19 Feb 2017 11:51:52 +0100 Subject: [Haskell-cafe] [ANN] marvin-0.1.0, a Haskell framework for writing chat bots In-Reply-To: References: <268335b8-2614-a6de-d01b-81abd60f3c8a@riseup.net> Message-ID: All right, I added some sensible version bounds and got the package on stackage. As of nightly nightly-2017-02-19 you can get marvin directly fron stackage. Have fun :) Justus > On 17 Feb 2017, at 1:35 PM, Justus Adam wrote: > > Oh .. thats probably due to the `pvp-bounds` I enabled. I should maybe add the version bounds manually … Haven’t had the time yet though :/ > > I’ve submitted a pull request to stackage to get it added. > > For now It should work if you install it with the packages from lts-7.15, that’s the one I build it against. > > Regards, > > Justus > >> On 17 Feb 2017, at 12:36 PM, Luke Murphy wrote: >> >>> (Verbose) Documentation: http://marvin.readthedocs.io >> >> Thank you for taking the time to do that. >> >> Running a `stack install marvin` ended in a bunch of bounds errors. Do >> you feel like getting it onto Stackage to keep it in sync with the the >> rest of the snapshot? >> >> https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package >> >> Best, >> >> Luke >> >> On 17.02.2017 11:22, Justus Adam wrote: >>> Hello Haskell enthusiasts, >>> >>> For a couple of months now I’ve been working on a framework for writing >>> chat bots in Haskell. >>> The project is very heavily inspired by Hubot >>> (https://hubot.github.com/) and for the most part mimics its API. >>> However it provides all the nice Haskell features, such as type safety >>> and running as compiled code, rather than interpreted. >>> >>> If you’re curious check it out, I’d love some feedback. >>> >>> (Verbose) Documentation: http://marvin.readthedocs.io >>> >>> Package: https://hackage.haskell.org/package/marvin >>> >>> Source code repository: https://github.com/JustusAdam/marvin >>> >>> Suggestions and issues: https://github.com/JustusAdam/marvin/issues >>> >>> >>> Regards, >>> Justus >>> >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> To (un)subscribe, modify options or view archives go to: >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> Only members subscribed via the mailman list are allowed to post. >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From gboulougaris at gmail.com Sun Feb 19 16:03:22 2017 From: gboulougaris at gmail.com (George Boulougaris) Date: Sun, 19 Feb 2017 18:03:22 +0200 Subject: [Haskell-cafe] QuickCheck and State monad In-Reply-To: References: Message-ID: Thanks for the replies, I ended up generating random sequence of events and then checking some properties/invariants on the final state. I realized that in other languages I usually expressed these properties by writing assertions inside the code (e.g. by using the assert() function in C/C++ or throwing a RuntimeException in Java). On Sun, Feb 5, 2017 at 5:41 AM, Robin Palotai wrote: > A very powerful idea is described in Testing Monadic Code With > QuickCheck[1] (or a pdf version at [2]). I think the ideas apply to > non-monadic (or non IO-like monadic) code as well. > > The basic idea is to generate a sequence of events as test input, like > > events = [EventA, EventA, EventC, EventB] > > and execute the corresponding actions (starting from an initial state). > Now you can make assertions on the final state S and events that happened. > > Some ideas for your case: > - If EventB happened, S must be foo > - If EventC never happened, S must be bar (note that negative event tests > are very powerful) > - S must have baz=0 only if the count of EventAs is same as count of > EventBs after the first EventC > - ... > > You can also compare final states resulting from different event sequences: > - if E1 is a sequence with result S1, sticking EventD anywhere in E1 must > also result in S1 > - ... > > The paper goes into details about generating a valid event sequence, if > there are restrictions about in which state can a given event happen. > > Section 3 & 4 are about testing that (the effect of) two given action > sequences are equal, independent of previous/subsequent actions. This is > useful if you don't only handle events, but can do some custom actions on > your state. Like you can test that "foo >> barBaz" is always the same as > "foo >> bar >> foo >> unicorn". > > Section 10-12 bring an other example. Section 13 shows a way to more > easily generate a valid action sequence, but only in case you have a > parallel abstract (pure) implementation, which is not often the case > (except algos), and maybe this is really specific to IO/ST. > > [1]: www.cse.chalmers.se/~rjmh/Papers/QuickCheckST.ps > [2]: https://www.researchgate.net/publication/2831386_Testing_ > Monadic_Code_with_QuickCheck > > Robin > > 2017-02-04 22:04 GMT+01:00 Mihai Maruseac : > >> I'm assuming that each state in your example has something to >> differentiate it from the others. That can be expanded to some >> properties to test. >> >> Another thing is that one event can move you from one state to only a >> set of states. This can also be encoded as a property. >> >> Finally, try to see if there are some properties/invariants that hold >> when handling an event in a state. Doesn't have to be for all events >> and all states, but for those where you can find some it should be >> possible to write some tests. >> >> On Sat, Feb 4, 2017 at 12:20 PM, George Boulougaris >> wrote: >> > Hello, >> > >> > I have written a Haskell module that contains functions that operate on >> some >> > state. Let's say that the code looks like this (the actual functions may >> > return an actual result instead of `()`, but this is irrelevant to the >> > question): >> > >> > data StateContext = StateContext { >> > -- some records >> > } >> > >> > handleEventA :: EventA -> State StateContext () >> > handleEventB :: EventB -> State StateContext () >> > handleEventC :: EventC -> State StateContext () >> > >> > As you can imagine the behavior of each function depends on the current >> > state. For example `handleEventA >> handleEventB` will not produce the >> same >> > result as `handleEventB >> handleEventA`. So I have several HUnit tests >> that >> > verify the behavior of each function at several states. >> > >> > But now I would like to write more tests, that exercise all functions >> at all >> > possible states (the number of states is finite). Writing them with >> HUnit >> > would be quite labor-itensive, so I thought that using QuickCheck might >> be >> > helpful in that case (I have only used it before for trivial functions). >> > >> > But I cannot see which properties should I test, or what kind of data >> should >> > the test generate. I suspect that the test should generate random >> sequence >> > of events (e.g. `handleEventB >> handleEventC >> handleEventA` etc), >> but I >> > cannot see what properties should be satisfied. >> > >> > Thanks >> > >> > >> > _______________________________________________ >> > Haskell-Cafe mailing list >> > To (un)subscribe, modify options or view archives go to: >> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> > Only members subscribed via the mailman list are allowed to post. >> >> >> >> -- >> Mihai Maruseac (MM) >> "If you can't solve a problem, then there's an easier problem you can >> solve: find it." -- George Polya >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carette at mcmaster.ca Sun Feb 19 19:30:33 2017 From: carette at mcmaster.ca (Jacques Carette) Date: Sun, 19 Feb 2017 14:30:33 -0500 Subject: [Haskell-cafe] AMMCS-2017 call for submissions Message-ID: Applied Mathematics, Modeling and Computational Science (AMMCS-2017) Waterloo, Ontario, Canada August 20-25, 2017 Minisymposium: Symbolic Methods in Code Generation and Programming Languages (ID: SS-SMCGPL; http://www.ammcs2017.wlu.ca/special-sessions/smcgpl/) Symbolic Methods in Code Generation and Programming Languages Symbolic methods are increasingly finding a wide variety of applications in and around programming languages. Starting from their immensely successful use in generation of numerical codes, their applicability is widening to both code analysis (often through abstract interpretation) and even in certain phases of compilers themselves, as exemplified in recent probabilistic programming languages. This session will bring together experts in symbolic computation along with programming languages experts to exchange ideas on the state of the art in this domain. Abstracts are being accepted for special sessions, contributed sessions, and poster presentations. All participants should submit their abstracts online via the AMMCS-2017 Management System at http://www.ammcs2017.wlu.ca/submit-abstracts/ Due: March 15, 2017 SS-SMCGPL Organizers: Jacques Carette (McMaster University), Eugene Zima (Wilfrid Laurier University) About AMMCS =========== AMMCS-2017 is an interdisciplinary international conference in a series of AMMCS meetings held in Waterloo, Ontario, Canada. The AMMCS Conference Series aims at promoting interdisciplinary research and collaboration involving mathematical and computational sciences within a larger international community, and highlighting recent advances in Applied Mathematics, Modeling and Computational Science (AMMCS). In 2017 the conference will be held in August (August 20-25, 2017). From its inception this conference series has been organized in cooperation with AIMS and SIAM. The conference provides a unique opportunity for in-depth technical discussions and exchange of ideas in all areas involving mathematical and computational sciences, modeling and simulation, as well as their applications in natural and social sciences, engineering and technology, industry and finance. It offers to researchers, industrialists, engineers and students to present their latest research, to interact with the experts in the field, and to foster interdisciplinary collaborations required to meet the challenges of modern science, technology, and society. From ruihfazevedo at gmail.com Mon Feb 20 04:51:16 2017 From: ruihfazevedo at gmail.com (Rui Azevedo) Date: Mon, 20 Feb 2017 03:51:16 -0100 Subject: [Haskell-cafe] Selective deriving Message-ID: <1cc020c6-3c79-458a-c9f6-88e07f1256e8@gmail.com> Hi! I don't know if there is some extension that already does this, or any other method of doing it. My search on deriving ghc mechanisms and extensions gave me no satisfactory results. the point is to have some "help" on derivation or some sort of derivation. actual derivation schema seems to require that all members (constructor arguments) instantiate the deriving class. This is the way of doing it for classes like Eq, works for Show and Ord but eventually it is a very strong requirement even for Eq sometimes. Of course I can do a manual derivation to state something else, and that sometimes can be frustrating because the derivations are way trivial and susceptible of automation. There is no fancy things added, its all standard haskell, user could laboriously type this. As an alternate derivation mechanism i seek selective deriving, like this: class Named o where name::o->String data A = A String deriving (Show) instance Named A where name="Object" till now just normal derivation data B = B A Int deriving (Show) extending (Named) the mechanism on extending requires that one and only one of the type constructor's direct arguments instantiates the class. this avoids the C++ diamond inheritance problem, user can recur on manual derivation. this will generate the code: instance Named B where name (B a _)=name a alternative can be: extending (Named A,...) this latter form is rater interesting as it cuts down the implementation boilerplate and still avoid the diamond problem even if multiple members instantiate the same class Are already any extension doing this? Can i achieve the same result by other forms? What is the best way to implement this thing? plug-ins seem not to be able to change syntax (right?) I've also looked at -F -pgmF options to use a preprocessor... can a preprocessor insert code to reference the original line numbers, just because messing with line numbers will make this unusable. regards rui From allbery.b at gmail.com Mon Feb 20 05:04:13 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 20 Feb 2017 00:04:13 -0500 Subject: [Haskell-cafe] Selective deriving In-Reply-To: <1cc020c6-3c79-458a-c9f6-88e07f1256e8@gmail.com> References: <1cc020c6-3c79-458a-c9f6-88e07f1256e8@gmail.com> Message-ID: On Sun, Feb 19, 2017 at 11:51 PM, Rui Azevedo wrote: > > I don't know if there is some extension that already does this, or any > other method of doing it. > My search on deriving ghc mechanisms and extensions gave me no > satisfactory results. > > the point is to have some "help" on derivation or some sort of derivation. > actual derivation schema seems to require that all members (constructor > arguments) instantiate the deriving class. This is the way of doing it for > classes like Eq, works for Show and Ord but eventually it is a very strong > requirement even for Eq sometimes. Of course I can do a manual derivation > to state something else, and that sometimes can be frustrating because the > derivations are way trivial and susceptible of automation. > > There is no fancy things added, its all standard haskell, user could > laboriously type this. > You might be interested in https://ghc.haskell.org/trac/ghc/wiki/Commentary/Compiler/DerivingStrategies; a first cut is slated for ghc 8.2.1, for which a first release candidate is planned for later this month. -- 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 johannes.waldmann at htwk-leipzig.de Mon Feb 20 12:27:57 2017 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Mon, 20 Feb 2017 13:27:57 +0100 Subject: [Haskell-cafe] ghc on xeon phi? Message-ID: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> Dear Cafe - would a program compiled by ghc, or ghc itself, run as-is on Intel Xeon Phi (KNL)? I found this reference http://stackoverflow.com/questions/22253311/running-haskell-on-xeon-phi but it seems to be about the pre-KNL version. Thanks - J. From rustompmody at gmail.com Mon Feb 20 13:52:21 2017 From: rustompmody at gmail.com (Rustom Mody) Date: Mon, 20 Feb 2017 19:22:21 +0530 Subject: [Haskell-cafe] In case there are some other Haskellers around Eindhoven, NL In-Reply-To: <9d94c36a-c345-cdf5-e608-8d7046c8e87b@vex.net> References: <9d94c36a-c345-cdf5-e608-8d7046c8e87b@vex.net> Message-ID: On Sat, Feb 11, 2017 at 12:57 AM, Albert Y. C. Lai wrote: > On 2017-02-09 04:40 PM, Damian Nadales wrote: > >> On a very unmemorable day, lost somewhere in a province of the >> Netherlands, a new Haskell meetup has been born >> http://meetu.ps/c/32F0Z/tJxcH/f >> > > Eindhoven, in my heart, is ground zero of well-reasoned programming > because Dijkstra. Just in case the Eindhoven Haskell meetup group is in fact inspired by E W Dijkstra... Here is pugofer The summary of its history and motivations here Particularly a feel for it could be had by reading its standard prelude Summary of summary: Inspired by EWD's writing function application not as f(x) or as f x but as f.x here is pugofer's version of map map : (a -> b) -> [a] -> [b] map.f.[] = [] map.f.(x::xs) = f.x :: map.f.xs PS This is 25 year old code... It still works but is not really type-comparable to ghc ;-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From lysxia at gmail.com Mon Feb 20 21:51:53 2017 From: lysxia at gmail.com (Li-yao Xia) Date: Mon, 20 Feb 2017 16:51:53 -0500 Subject: [Haskell-cafe] What is this applicative functor? In-Reply-To: References: <1485894155.1237.7.camel@joachim-breitner.de> <1485924900.8920.4.camel@joachim-breitner.de> <1485963233.14724.3.camel@joachim-breitner.de> <1485970746.14724.5.camel@joachim-breitner.de> Message-ID: <58f0bc2a-e622-3342-0efe-a48eb77ddabf@gmail.com> Hello everyone, For those interested in exploring the twisted functor approach, the relevant product seems to be called "two-sided semidirect product" in some circles. This paper refers to some applications of the product in the introduction (to study semigroups and monoids, with further applications in formal language theory). https://arxiv.org/abs/0709.2962 This paper introduced it. At the bottom of page 39: (u, v)*(u', t') = (vt'+tv', tt'). http://www.sciencedirect.com/science/article/pii/0022404989901370 I haven't looked further. Another idea: this product behaves like the product of combinatorial species truncated at size 1 (and less). Looking at generating functions, compare the first two coefficients to the formula of the product above: (t + vx)*(t' + v'x) = tt' + (vt' + tv') x + vv' x^2 For example, the shrinkings associated with a pair are obtained by shrinking either component, but what about shrinking both? By analogy with combinatorial species, we could say instead that shrinking one component gives a "shrinking of order 1", and shrinking both gives a "shrinking of order 2". More generally the "shrinking order" of both components can be added together; this indeed corresponds to the size of a combinatorial object. IIRC the feat-testing package implements this structure. What do you think? Li-yao On 02/01/2017 01:50 PM, Gershom B wrote: > Indeed a very interesting type! > > In the spirit of the “twisting pointers” paper’s construction of applicative structure from semi-direct products [1], I would speculate that this is a form of applicative created from the _direct product_ of two underlying applicatives that share some sort of mutually distributive relationship… (in this case, identity and list), with one of the actions being trivial. > > Somethign that might be enlightening, again following twisted pointers, is to reformulate the Applicative Functor instance as a Monoidal Functor instance... > > [1] http://ozark.hendrix.edu/~yorgey/pub/twisted.pdf > > Cheers, > Gershom > > On February 1, 2017 at 1:16:08 PM, Simon Jakobi via Haskell-Cafe (haskell-cafe at haskell.org) wrote: >> Hi Joachim, >> >> that's a very interesting type, thanks for sharing it! >> >> Please note that in the rendering of the package description at >> http://hackage.haskell.org/package/successors, the <*> is slightly >> mangled. >> >> Cheers, >> Simon >> >> 2017-02-01 18:39 GMT+01:00 Joachim Breitner : >>> Hi, >>> >>> Am Mittwoch, den 01.02.2017, 10:33 -0500 schrieb Joachim Breitner: >>>> Hi, >>>> >>>> David wrote: >>>>> How about this? >>>>> >>>>> hd (OneStep x xs) = x >>>>> >>>>> instance Monad OneStep where >>>>> OneStep x xs >>= f = OneStep y (map (hd . f) xs ++ ys) >>>>> where >>>>> OneStep y ys = f x >>>>> >>>>> Not sure if it’s good for anything, but it seems valid and consistent >>>>> based on a preliminary investigation. >>>> >>>> Yes, this looks reasonable. Did you happen to already work through the >>>> monad laws? >>> Just did, all looks fine: >>> https://github.com/nomeata/haskell-successors/blob/c1fd614cb0fc3e3b5dbf0338f835a91ea78e0b63/src/Control/Applicative/Successors.hs#L82 >>> >>> Uploaded to http://hackage.haskell.org/package/successors in case >>> someone wants to play with it. >>> >>> Greetings, >>> Joachim >>> -- >>> Joachim “nomeata” Breitner >>> mail at joachim-breitner.de • https://www.joachim-breitner.de/ >>> XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F >>> Debian Developer: nomeata at debian.org >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> To (un)subscribe, modify options or view archives go to: >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> Only members subscribed via the mailman list are allowed to post. >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From ok at cs.otago.ac.nz Mon Feb 20 22:05:16 2017 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Tue, 21 Feb 2017 11:05:16 +1300 Subject: [Haskell-cafe] A question about GHC test coverage In-Reply-To: <434A0C8C-C184-42D3-BA1F-A6FD091539AA@aatal-apotheke.de> References: <434A0C8C-C184-42D3-BA1F-A6FD091539AA@aatal-apotheke.de> Message-ID: <1d381ca3-b6de-e8b1-5634-c80a6391b138@cs.otago.ac.nz> On 15/02/17 10:35 AM, Olaf Klinke wrote: > You should not have to write tests for functions you did not define. Correct me if I'm wrong, but any property of max can be derived from the properties of <=. Unfortunately, this isn't quite true. Suppose we have two values x y such that x <= y && y <= x && x == y *BUT* x and y are distinguishable some other way. For example, suppose we are modelling rational numbers by pairs (n,d) *without* insisting that gcd(n,d) == 0. Then we have (n1,d1) == (n2,d2) = n1*d2 == n2*d1 compare (n1,d1) (n2,d2) = compare (n1*d2) (n2*d1) BUT (1,2) and (2,4), while ==, are none-the-less distinguishable. Now ask about max x y. If we have max a b = if a > b then a else b then max x y delivers y. But if we have max a b = if a < b then b else a then max x y delivers x, and these two results can be distinguished. I know and freely admit that if I want a version of max that satisfies stronger conditions than Ord can guarantee, it is up to me to write it. So you could say that the bug was that I *should* have written my own max, and didn't. But that's basically my point. (For an example of two values that can't be distinguished by compare or ==, consider -0.0 and +0.0. If I give those to max, what do I get back? No, that wasn't the test case I needed.) From mle+hs at mega-nerd.com Tue Feb 21 08:35:47 2017 From: mle+hs at mega-nerd.com (Erik de Castro Lopo) Date: Tue, 21 Feb 2017 19:35:47 +1100 Subject: [Haskell-cafe] ghc on xeon phi? In-Reply-To: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> References: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> Message-ID: <20170221193547.4a57b97bac2029ee98b14e97@mega-nerd.com> Johannes Waldmann wrote: > would a program compiled by ghc, or ghc itself, > run as-is on Intel Xeon Phi (KNL)? > > I found this reference > http://stackoverflow.com/questions/22253311/running-haskell-on-xeon-phi > but it seems to be about the pre-KNL version. Xeon Phi is effectively a different architecture, in the same way that the ARM architecture is different from the x86_64 architecture. Currently GHC does not support the Xeon Phi architecture directly. It may however (as the SO response suggests) be possible to generate C code from GHC and compile that C code with with a C compiler that can generate Xeon Phi binaries. However, I am sure that route would be a signicant yak shaving exercise. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ From mle+hs at mega-nerd.com Tue Feb 21 08:39:16 2017 From: mle+hs at mega-nerd.com (Erik de Castro Lopo) Date: Tue, 21 Feb 2017 19:39:16 +1100 Subject: [Haskell-cafe] ghc on xeon phi? In-Reply-To: <20170221193547.4a57b97bac2029ee98b14e97@mega-nerd.com> References: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> <20170221193547.4a57b97bac2029ee98b14e97@mega-nerd.com> Message-ID: <20170221193916.85c915d6a0d54e57f2607e73@mega-nerd.com> Erik de Castro Lopo wrote: > Xeon Phi is effectively a different architecture, in the same way > that the ARM architecture is different from the x86_64 architecture. More info on the Xeon Phi here: https://en.wikipedia.org/wiki/Xeon_Phi suggests that maybe it isn't a different architecture. Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ From allbery.b at gmail.com Tue Feb 21 08:56:32 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 21 Feb 2017 03:56:32 -0500 Subject: [Haskell-cafe] ghc on xeon phi? In-Reply-To: <20170221193547.4a57b97bac2029ee98b14e97@mega-nerd.com> References: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> <20170221193547.4a57b97bac2029ee98b14e97@mega-nerd.com> Message-ID: On Tue, Feb 21, 2017 at 3:35 AM, Erik de Castro Lopo wrote: > It may however (as the SO response suggests) be possible to generate > C code from GHC and compile that C code with with a C compiler that > can generate Xeon Phi binaries. > ghc hasn't generated C code for a while, aside from unregisterised. It's not truly a different architecture, but a reorganization of the standard architecture. Unfortunately, ghc doesn't currently make good use of the key Xeon Phi components even in the standard architecture; packages that want to make use of them generally use -fllvm because LLVM is better at using them, even given that LLVM isn't very good at understanding what ghc feeds it. This suggests that -fflvm might be useful in taking advantage of Xeon Phi architecture with ghc. -- 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 johannes.waldmann at htwk-leipzig.de Tue Feb 21 13:13:24 2017 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Tue, 21 Feb 2017 14:13:24 +0100 Subject: [Haskell-cafe] -Werror -Woverlapping-patterns -fglasgow-exts ? Message-ID: Dear Cafe, I want to chase overlapping patterns in a larger code base. So I use -Werror -Woverlapping-patterns . But the code also needs -fglasgow-exts and this makes compilation stop right at the beginning, with "warning: -fglasgow-exts is deprecated: ..." which will be turned into an error because of -Werror -Wno-warnings-deprecations does not help, apparently that warning is not a deprecation. Is there a way to get -Werror for specific warnings? - J. From johannes.waldmann at htwk-leipzig.de Tue Feb 21 13:15:36 2017 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Tue, 21 Feb 2017 14:15:36 +0100 Subject: [Haskell-cafe] -Werror -Woverlapping-patterns -fglasgow-exts ? In-Reply-To: References: Message-ID: it seems that adding "-w" helps (turn off all warnings). - J From david.feuer at gmail.com Tue Feb 21 17:21:08 2017 From: david.feuer at gmail.com (David Feuer) Date: Tue, 21 Feb 2017 12:21:08 -0500 Subject: [Haskell-cafe] -Werror -Woverlapping-patterns -fglasgow-exts ? In-Reply-To: References: Message-ID: A lot of us would like to get -Werror for only some errors. I don't think it exists yet. But why are you still using -fglasgow-exts? If you use LANGUAGE pragmas instead, everything should work. David On Tue, Feb 21, 2017 at 8:15 AM, Johannes Waldmann wrote: > it seems that adding "-w" helps (turn off all warnings). - J > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From johannes.waldmann at htwk-leipzig.de Tue Feb 21 17:28:03 2017 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Tue, 21 Feb 2017 18:28:03 +0100 Subject: [Haskell-cafe] -Werror -Woverlapping-patterns -fglasgow-exts ? In-Reply-To: References: Message-ID: <29722244-cd55-3a77-cfd7-96e0e0c46f9f@htwk-leipzig.de> > But why are you still using -fglasgow-exts? legacy code base > If you use LANGUAGE pragmas instead ... I'd love to - if this refactoring can be automated (I have 2k modules in this project :-) - J. From adam at bergmark.nl Tue Feb 21 17:36:31 2017 From: adam at bergmark.nl (Adam Bergmark) Date: Tue, 21 Feb 2017 17:36:31 +0000 Subject: [Haskell-cafe] -Werror -Woverlapping-patterns -fglasgow-exts ? In-Reply-To: <29722244-cd55-3a77-cfd7-96e0e0c46f9f@htwk-leipzig.de> References: <29722244-cd55-3a77-cfd7-96e0e0c46f9f@htwk-leipzig.de> Message-ID: You can use Cabal's default-extensions field to enable extensions in all modules. On Tue, 21 Feb 2017 at 18:29 Johannes Waldmann < johannes.waldmann at htwk-leipzig.de> wrote: > > But why are you still using -fglasgow-exts? > > legacy code base > > > If you use LANGUAGE pragmas instead ... > > I'd love to - if this refactoring can be automated > (I have 2k modules in this project :-) > > - J. > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From erkokl at gmail.com Tue Feb 21 18:00:30 2017 From: erkokl at gmail.com (Levent Erkok) Date: Tue, 21 Feb 2017 10:00:30 -0800 Subject: [Haskell-cafe] ghc on xeon phi? In-Reply-To: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> References: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> Message-ID: Johannes: KNL is "x86-binary-compatible:" https://www.computer.org/cms/Computer.org/ComputingNow/issues/2016/06/mmi2016020034.pdf KNL supports "up-to" AVX-512 instruction set, making it capable of executing binaries that are compiled for, say, regular Xeon machines. The only notable exception are the TSX instructions (the instructions for transactional memory), which I don't believe is generated via the GHC compile pipeline anyhow. So, in theory, you can take an arbitrary binary compiled for a modern x86 machine (say any of the Core line), and run it unmodified on the KNL. Of course, the issue is going to be the software stack: Binaries don't exist in isolation, you also need dynamic-loaded libraries. So, you might have issues with, say, GMP or other libs if they are not yet ported to KNL. (Static linking might be a huge headache.) In practice, however, this would be rather wasteful: The whole point of the Xeon-phi is the availability of large-vector sized floating-point support and many-many cores. If you're running a binary that makes no use of those instructions and is single-threaded, then you will not gain anything. In fact, the single-threaded performance might suffer compared to a regular Xeon machine. Of course, this all depends on what you want to do. Projects like DPH, however, can take great advantage of the Xeon-phi architecture; by parallelizing number-crunching algorithms and distributing over many cores. (https://wiki.haskell.org/GHC/Data_Parallel_Haskell). However, I'm not familiar with the current status of DPH and related projects to opine weather they aim to target AVX-512 and many cores afforded by the Xeon-phi. I'd love to hear if anyone had more recent info on that. -Levent. On Mon, Feb 20, 2017 at 4:27 AM, Johannes Waldmann < johannes.waldmann at htwk-leipzig.de> wrote: > Dear Cafe - > > would a program compiled by ghc, or ghc itself, > run as-is on Intel Xeon Phi (KNL)? > > I found this reference > http://stackoverflow.com/questions/22253311/running-haskell-on-xeon-phi > but it seems to be about the pre-KNL version. > > Thanks - J. > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From johannes.waldmann at htwk-leipzig.de Tue Feb 21 18:29:24 2017 From: johannes.waldmann at htwk-leipzig.de (Johannes Waldmann) Date: Tue, 21 Feb 2017 19:29:24 +0100 Subject: [Haskell-cafe] ghc on xeon phi? In-Reply-To: References: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> Message-ID: <7e87ec92-b15d-b5c7-4330-9dfa10020712@htwk-leipzig.de> Hi Levent, > The whole point of the Xeon-phi is the availability of > large-vector sized floating-point support and many-many cores. Sure, that's what I'm contemplating - use the many options of writing parallel and concurrent Haskell programs. So, GHC's RTS should "just work"? I was hoping someone already had actually seen this on their machine. - J. From olf at aatal-apotheke.de Tue Feb 21 20:25:20 2017 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Tue, 21 Feb 2017 21:25:20 +0100 Subject: [Haskell-cafe] A question about GHC test coverage In-Reply-To: <1d381ca3-b6de-e8b1-5634-c80a6391b138@cs.otago.ac.nz> References: <434A0C8C-C184-42D3-BA1F-A6FD091539AA@aatal-apotheke.de> <1d381ca3-b6de-e8b1-5634-c80a6391b138@cs.otago.ac.nz> Message-ID: > Am 20.02.2017 um 23:05 schrieb Richard A. O'Keefe : > > > > On 15/02/17 10:35 AM, Olaf Klinke wrote: >> You should not have to write tests for functions you did not define. > > Correct me if I'm wrong, but any property of max can be derived from the properties of <=. > > Unfortunately, this isn't quite true. > > Suppose we have two values x y such that x <= y && y <= x && x == y > *BUT* x and y are distinguishable some other way. For example, > suppose we are modelling rational numbers by pairs (n,d) *without* > insisting that gcd(n,d) == 0. Then we have > (n1,d1) == (n2,d2) = n1*d2 == n2*d1 > compare (n1,d1) (n2,d2) = compare (n1*d2) (n2*d1) > BUT (1,2) and (2,4), while ==, are none-the-less distinguishable. > > Now ask about max x y. If we have > > max a b = if a > b then a else b > > then max x y delivers y. But if we have > > max a b = if a < b then b else a > > then max x y delivers x, and these two results can be distinguished. > If you define an Ord instance that is only a preorder rather than a total order, and then downstream rely on functions f that violate the property x == y implies f x == f y, I'd call that poor design. The above formula would be something for a Quickcheck module. That said, I myself found it handy in the past to define such preordered types. > I know and freely admit that if I want a version of max that satisfies > stronger conditions than Ord can guarantee, it is up to me to write it. Or rather, be aware of the standard implementation of max in Data.Ord. Anyways, you are right: Since the type system can not guarantee that every Ord instance is actually a total order, test coverage statistics won't help us here. Regards, Olaf From ok at cs.otago.ac.nz Wed Feb 22 01:01:14 2017 From: ok at cs.otago.ac.nz (Richard A. O'Keefe) Date: Wed, 22 Feb 2017 14:01:14 +1300 Subject: [Haskell-cafe] A question about GHC test coverage In-Reply-To: References: <434A0C8C-C184-42D3-BA1F-A6FD091539AA@aatal-apotheke.de> <1d381ca3-b6de-e8b1-5634-c80a6391b138@cs.otago.ac.nz> Message-ID: <2f7fef61-d416-9b8c-94d0-cd1b86815d21@cs.otago.ac.nz> On 22/02/17 9:25 AM, Olaf Klinke wrote: >> > If you define an Ord instance that is only a preorder rather than a total order, and then downstream rely on functions f that violate the property > > x == y implies f x == f y, > > I'd call that poor design. And I would call it a straw man. I am talking about a TOTAL ORDER. Antisymmetric, transitive, and total. As for x == y implying or not f x == f y, I really don't have any alternative there. == and compare are handed to me by the domain, and the observable difference between definitions of max turns out (now that I've found it) to be precisely one of the things I have to model. I know that "the type system cannot guarantee that every Ord instance is actually a total order", which is why I have tests for Ord. The issue is a common issue when you have abstract data types: there can be values x y such that x == y but x is not identical to y. Here is is the classic example in Haskell. Prelude> let pz = 0.0 :: Double Prelude> let nz = -pz Prelude> pz == nz True Prelude> show pz == show nz False Prelude> max pz nz -0.0 Prelude> max nz pz 0.0 The result of max is well defined up to == but not well defined up to identity. By the way, LIA-2 section 5.2.2 "Floating point maximum and minimum" is very clear that maxF(+0.0, -0.0) is +0.0, so Haskell is incompatible with LIA-2 here. And we are not talking about infinities or NaNs here; we're talking about strictly the finite floats. This *isn't* my actual problem, but it's very close in spirit. Now the substitution principle is pretty important, but quite clearly the equality function in Haskell is not the equality that the principle is about. For one thing, when talking *about* Haskell, it is natural to say that if f = g then ($ x) f = ($ x) g, but the equality on the left is not expressible in Haskell. For another, since we have System.Timeout, we can have two expressions u, v such that u == v (eventually) evaluates to True, but f u experiences a timeout and f v does not, so they end up returning unequal results. From skosyrev at ptsecurity.com Wed Feb 22 15:34:39 2017 From: skosyrev at ptsecurity.com (Kosyrev Serge) Date: Wed, 22 Feb 2017 18:34:39 +0300 Subject: [Haskell-cafe] Size-indexed monoids Message-ID: <87y3wyxmr4.fsf@ptsecurity.com> Good day! What is the proper type class for stronger-typed (size-indexed) monoids: - that is, monoids carrying their "size" in the type - preferably as GHC.TypeLits.Nat - preferably on Hackage ? I'm quite prepared to the idea that a monoid is an entirely wrong abstraction, from a category-theoretic standpoint, so I would gladly learn of a better one : -) Use case: > {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeOperators, UnicodeSyntax, StandaloneDeriving #-} > > module Understanding.Types where > > import GHC.TypeLits > > data T (depth ∷ Nat) p where > TZ ∷ T 0 p > TS ∷ (Show p, CmpNat (m + 1) n ~ EQ) ⇒ > { payload ∷ p > , next ∷ T m a } → T n a > deriving instance Show p ⇒ Show (T d p) > > instance Monoid (T d p) where > mempty = TZ > mappend TZ TZ = TZ > mappend TZ t@(TS _ _) = t > mappend t@(TS _ _) TZ = t > mappend tl@(TS pl nl) tr = TS pl $ mappend nl tr As it is, even the mempty case rejects such a blatant violation of polymorphism, since `T 0 p` cannot unify with `T n p`. So, ideally (I think), I would like something like this: > class TypedMonoid a where > tmempty ∷ a 0 > tmappend ∷ a n → a m → a (n + m) -- с уважениeм / respectfully, Косырев Сергей -- “Most deadly errors arise from obsolete assumptions.” -- Frank Herbert, Children of Dune From dominic at steinitz.org Wed Feb 22 15:37:42 2017 From: dominic at steinitz.org (Dominic Steinitz) Date: Wed, 22 Feb 2017 07:37:42 -0800 Subject: [Haskell-cafe] ghc on xeon phi? Message-ID: > Hi Levent, > >> The whole point of the Xeon-phi is the availability of >> large-vector sized floating-point support and many-many cores. > > Sure, that's what I'm contemplating - use the many options > of writing parallel and concurrent Haskell programs. > > So, GHC's RTS should "just work"? > > I was hoping someone already had actually seen this > on their machine. > > - J. I recall we thought about using a Xeon phi for our application but abandoned the attempt for reasons I cannot recall. I’ll see if I can find out. But maybe you would better using something like accelerate-llvm? I think you wrote your application was numerical. BTW I am currently adding a small improvement to ghc floating point code generation but I am beginning to think it’s going to be difficult to get ghc to generate really good numerical / floating point code and I am experimenting with accelerate-llvm. Dominic From hafnersimon at gmail.com Wed Feb 22 16:48:33 2017 From: hafnersimon at gmail.com (Simon Hafner) Date: Wed, 22 Feb 2017 17:48:33 +0100 Subject: [Haskell-cafe] Takeover of http-client-lens Message-ID: Hello I wanted to take over http-client-lens. The corresponding email address is out of service: > 550 5.1.1 The email account that you tried to reach does not exist. Please try double-checking the recipient's email address for typos or unnecessary spaces. https://github.com/reinh/http-client-lens/issues/2 Posting here in another attempt to reach the original author. Cheers, Simon From esz at posteo.de Wed Feb 22 16:49:51 2017 From: esz at posteo.de (Ertugrul =?utf-8?Q?S=C3=B6ylemez?=) Date: Wed, 22 Feb 2017 17:49:51 +0100 Subject: [Haskell-cafe] Size-indexed monoids In-Reply-To: <87y3wyxmr4.fsf@ptsecurity.com> References: <87y3wyxmr4.fsf@ptsecurity.com> Message-ID: <87tw7mb26o.fsf@posteo.de> > What is the proper type class for stronger-typed (size-indexed) monoids: > - that is, monoids carrying their "size" in the type > - preferably as GHC.TypeLits.Nat > - preferably on Hackage I don't think monoid is the correct term simply because it's indexed. I've called them measured monoids, and the following approach seems to work well: {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeInType #-} import GHC.Types (Type) class TMonoid a where type family Empty a :: a type family Append a (x :: a) (y :: a) :: a data Nat = Z | S Nat instance TMonoid Nat where type Empty Nat = Z type Append Nat Z y = y type Append Nat (S x) y = S (Append Nat x y) class MeasuredMonoid (a :: n -> Type) where mmEmpty :: a (Empty n) mmAppend :: a n1 -> a n2 -> a (Append n n1 n2) data Vec :: Type -> Nat -> Type where Nil :: Vec a Z Cons :: a -> Vec a n -> Vec a (S n) instance MeasuredMonoid (Vec a) where mmEmpty = Nil mmAppend Nil ys = ys mmAppend (Cons x xs) ys = Cons x (mmAppend xs ys) I couldn't tell you whether there is a library for that though. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 487 bytes Desc: not available URL: From esz at posteo.de Wed Feb 22 16:53:49 2017 From: esz at posteo.de (Ertugrul =?utf-8?Q?S=C3=B6ylemez?=) Date: Wed, 22 Feb 2017 17:53:49 +0100 Subject: [Haskell-cafe] Size-indexed monoids In-Reply-To: <87tw7mb26o.fsf@posteo.de> References: <87y3wyxmr4.fsf@ptsecurity.com> <87tw7mb26o.fsf@posteo.de> Message-ID: <87r32qb202.fsf@posteo.de> > {-# LANGUAGE FlexibleContexts #-} Scratch that one. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 487 bytes Desc: not available URL: From adam at bergmark.nl Wed Feb 22 20:20:51 2017 From: adam at bergmark.nl (Adam Bergmark) Date: Wed, 22 Feb 2017 20:20:51 +0000 Subject: [Haskell-cafe] Takeover of http-client-lens In-Reply-To: References: Message-ID: It looks like @reinh is active on twitter so you could try there /Adam On Wed, 22 Feb 2017 at 17:50, Simon Hafner wrote: > Hello > > I wanted to take over http-client-lens. > > The corresponding email address is out of service: > > 550 5.1.1 The email account that you tried to reach does not exist. > Please try double-checking the recipient's email address for typos or > unnecessary spaces. > > https://github.com/reinh/http-client-lens/issues/2 > > Posting here in another attempt to reach the original author. > > Cheers, > Simon > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From skosyrev at ptsecurity.com Wed Feb 22 20:39:40 2017 From: skosyrev at ptsecurity.com (Sergey Kosyrev) Date: Wed, 22 Feb 2017 20:39:40 +0000 Subject: [Haskell-cafe] Size-indexed monoids In-Reply-To: <87tw7mb26o.fsf@posteo.de> References: <87y3wyxmr4.fsf@ptsecurity.com>,<87tw7mb26o.fsf@posteo.de> Message-ID: Ertugrul, all, I apologize in advance for replying using a lowly MUA, but such are my circumstances.. Ertugrul, first of all, thank you for sharing your approach! I have tried to replicate your success using GHC.TypeLits.Nat, and I have failed. The suspicion is that it is due to the fact that, while seductive to use (esp. due to TypeOperators), TypeLits.Nat carries no inductive proof of structure, which, on the other hand you have provided with the bespoke TMonoid-associated type families. Does anybody know if this can be overcome with the current state of art of GHC type-level machinery, or that we are, indeed, condemned to use the (somewhat) ugly-ish explicitly-inductive numerals? I remember people seeking to employ GHC plugins to make it more conducive to type-level arithmetics, but I don't really feel confident to derive judgements about their relevance and implications on the case.. Here is the record of my failure: > {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeFamilies, TypeInType, TypeOperators, UnicodeSyntax, StandaloneDeriving #-} > > module Understanding.Types where > > import GHC.TypeLits > import GHC.Types (Type) > > data T p (size ∷ Nat) where > TZ ∷ T p 0 > TS ∷ (Show p, CmpNat (m + 1) n ~ EQ) ⇒ > { payload ∷ p > , next ∷ T a m } → T a n > deriving instance Show p ⇒ Show (T p s) > > class MeasuredMonoid a where > mmempty ∷ a 0 > mmappend ∷ a n → a m → a (n + m) > > instance MeasuredMonoid (T p) where > mmempty = TZ > mmappend TZ TZ = TZ > mmappend TZ t@(TS _ _) = t > mmappend t@(TS _ _) TZ = t > mmappend tl@(TS pl nl) tr = TS pl $ mmappend nl tr -- * Failure due to lack of inductive structure of GHC.TypeLits.Nat -- -- error: -- • Could not deduce: CmpNat ((m1 + m) + 1) (n + m) ~ 'EQ -- arising from a use of ‘TS’ -- from the context: (Show p1, CmpNat (m1 + 1) n ~ 'EQ) -- bound by a pattern with constructor: -- TS :: forall k (a :: k) (n :: Nat) p (m :: Nat). -- (Show p, CmpNat (m + 1) n ~ 'EQ) => -- p -> T a m -> T a n, -- in an equation for ‘mmappend’ -- at /home/deepfire/src/haskell-understanding/Types.hs:24:16-23 -- • In the expression: TS pl -- In the expression: TS pl $ mmappend nl tr -- In an equation for ‘mmappend’: -- mmappend tl@(TS pl nl) tr = TS pl $ mmappend nl tr -- • Relevant bindings include -- tr :: T p m -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:27) -- nl :: T p m1 -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:22) -- tl :: T p n -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:12) -- mmappend :: T p n -> T p m -> T p (n + m) -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:21:3) -- take care, Kosyrev Serge From adam at well-typed.com Wed Feb 22 21:35:28 2017 From: adam at well-typed.com (Adam Gundry) Date: Wed, 22 Feb 2017 21:35:28 +0000 Subject: [Haskell-cafe] Size-indexed monoids In-Reply-To: References: <87y3wyxmr4.fsf@ptsecurity.com> <87tw7mb26o.fsf@posteo.de> Message-ID: <88b3792e-bb07-f305-db7f-05ab59f3dbbe@well-typed.com> On 22/02/17 20:39, Sergey Kosyrev wrote: > The suspicion is that it is due to the fact that, while seductive to use (esp. due to TypeOperators), > TypeLits.Nat carries no inductive proof of structure, which, on the other hand you have provided > with the bespoke TMonoid-associated type families. > > Does anybody know if this can be overcome with the current state of art of GHC type-level machinery, > or that we are, indeed, condemned to use the (somewhat) ugly-ish explicitly-inductive numerals? I don't believe this is possible without cheating (see below) or using a plugin. That said, some of the ugliness of inductive numerals can be avoided by defining a type family to translate TypeLits.Nat into inductive form. > I remember people seeking to employ GHC plugins to make it more conducive to type-level > arithmetics, but I don't really feel confident to derive judgements about their relevance and > implications on the case.. You might take a look at the rather lovely ghc-typelits-natnormalise plugin. I haven't tried, but assuming you adjust the code to use a type equality constraint rather than CmpNat, I think it should automatically solve the problematic constraint. If you'd prefer blatant cheating, another approach is to use unsafeCoerce, like this: {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeFamilies, TypeInType, TypeOperators, UnicodeSyntax, StandaloneDeriving, TypeApplications, RankNTypes, ScopedTypeVariables, AllowAmbiguousTypes, ConstraintKinds #-} module SizeIndexedMonoids where import GHC.TypeLits import GHC.Types (Type) import Unsafe.Coerce -- | Assert without proof that the constraint c holds. It had better -- be a true type equality constraint, otherwise you are asking for -- trouble. unsafeLemma :: forall c r . (c => r) -> r unsafeLemma = unQ . (unsafeCoerce :: Q c r -> Q (r ~ r) r) . MkQ newtype Q c r = MkQ { unQ :: c => r } type Associativity x y z = (x + (y + z)) ~ ((x + y) + z) data T (p :: Type) (size ∷ Nat) where TZ ∷ T p 0 TS ∷ (Show p, (1 + m) ~ n) ⇒ { payload ∷ p , next ∷ T a m } → T a n deriving instance Show p ⇒ Show (T p s) mmappend :: forall p m n . T p m -> T p n -> T p (m + n) mmappend TZ tr = tr mmappend (TS pl (nl :: T a m1)) tr = unsafeLemma @(Associativity 1 m1 n) (TS pl (mmappend nl tr)) Sorry, Adam > Here is the record of my failure: > >> {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeFamilies, TypeInType, TypeOperators, UnicodeSyntax, StandaloneDeriving #-} >> >> module Understanding.Types where >> >> import GHC.TypeLits >> import GHC.Types (Type) >> >> data T p (size ∷ Nat) where >> TZ ∷ T p 0 >> TS ∷ (Show p, CmpNat (m + 1) n ~ EQ) ⇒ >> { payload ∷ p >> , next ∷ T a m } → T a n >> deriving instance Show p ⇒ Show (T p s) >> >> class MeasuredMonoid a where >> mmempty ∷ a 0 >> mmappend ∷ a n → a m → a (n + m) >> >> instance MeasuredMonoid (T p) where >> mmempty = TZ >> mmappend TZ TZ = TZ >> mmappend TZ t@(TS _ _) = t >> mmappend t@(TS _ _) TZ = t >> mmappend tl@(TS pl nl) tr = TS pl $ mmappend nl tr > > -- * Failure due to lack of inductive structure of GHC.TypeLits.Nat > -- > -- error: > -- • Could not deduce: CmpNat ((m1 + m) + 1) (n + m) ~ 'EQ > -- arising from a use of ‘TS’ > -- from the context: (Show p1, CmpNat (m1 + 1) n ~ 'EQ) > -- bound by a pattern with constructor: > -- TS :: forall k (a :: k) (n :: Nat) p (m :: Nat). > -- (Show p, CmpNat (m + 1) n ~ 'EQ) => > -- p -> T a m -> T a n, > -- in an equation for ‘mmappend’ > -- at /home/deepfire/src/haskell-understanding/Types.hs:24:16-23 > -- • In the expression: TS pl > -- In the expression: TS pl $ mmappend nl tr > -- In an equation for ‘mmappend’: > -- mmappend tl@(TS pl nl) tr = TS pl $ mmappend nl tr > -- • Relevant bindings include > -- tr :: T p m > -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:27) > -- nl :: T p m1 > -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:22) > -- tl :: T p n > -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:12) > -- mmappend :: T p n -> T p m -> T p (n + m) > -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:21:3) > > -- > take care, > Kosyrev Serge -- Adam Gundry, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ From brucker at spamfence.net Wed Feb 22 21:46:54 2017 From: brucker at spamfence.net (Achim D. Brucker) Date: Wed, 22 Feb 2017 21:46:54 +0000 Subject: [Haskell-cafe] CFP: International Workshop on OCL and Textual Modeling (OCL 2017) Message-ID: <20170222214654.ppaag5n36j6l3s5d@fujikawa.home.brucker.ch> (Apologies for duplicates) CALL FOR PAPERS 17th International Workshop on OCL and Textual Modeling Co-located with STAF 2017 SOFTWARE TECHNOLOGIES: APPLICATIONS AND FOUNDATIONS July 20, 2017, Marburg, Germany http://oclworkshop.github.io Modeling started out with UML and its precursors as a graphical notation. Such visual representations enable direct intuitive capturing of reality, but they have weaknesses: for example, detailed visual representations bear the risk of becoming overcrowded faster than textual models and some of the visual features lack the level of precision required to create complete and unambiguous specifications. These weaknesses of graphical notations encouraged the development of text-based modeling languages that either integrate with or replace graphical notations for modeling. Typical examples of such languages are OCL, textual MOF, Epsilon, and Alloy. Textual modeling languages have their roots in formal language paradigms like logic, programming and databases. The goal of this workshop is to create a forum where researchers and practitioners interested in building models using OCL or other kinds of textual languages can directly interact, report advances, share results, identify tools for language development, and discuss appropriate standards. In particular, the workshop will encourage discussions for achieving synergy from different modeling language concepts and modeling language use. The close interaction will enable researchers and practitioners to identify common interests and options for potential cooperation. ## Topics of interest Topics of interest include (but are not limited to): - Mappings between textual modeling languages and other languages/formalisms - Algorithms, evaluation strategies and optimizations in the context of textual modeling languages for: - validation, verification, and testing, - model transformation and code generation, - meta-modeling and DSLs, and - query and constraint specifications - Alternative graphical/textual notations for textual modeling languages - Evolution, transformation and simplification of textual modeling expressions - Libraries, templates and patterns for textual modeling languages - Tools that support textual modeling languages (e.g., verification of OCL formulae, runtime monitoring of invariants) - Complexity results for textual modeling languages - Quality models and benchmarks for comparing and evaluating textual modeling tools and algorithms - Successful applications of textual modeling languages - Case studies on industrial applications of textual modeling languages - Experience reports: - usage of textual modeling languages and tools in complex domains, - usability of textual modeling languages and tools for end-users - Empirical studies about the benefits and drawbacks of textual modeling languages - Innovative textual modeling tools - Comparison, evaluation and integration of modeling languages - Correlation between modeling languages and modeling tasks This year, we particularly encourage submissions describing applications and case studies of textual modeling as well as test suites and benchmark collections for evaluating textual modeling tools. ## Venue This workshop will be organized as a part of STAF 2017 Conferenze in Marburg, Germany. It was previously organized as part of the MODELS conference. Similar to its predecessors , the workshop addresses both people from academia and industry . The aim is to provide a forum for addressing integration of OCL and other textual modeling languages , as well as tools for textual modeling , and for disseminating good practice and discussing the new requirements for textual modeling . ## Workshop Format The workshop will include short (about 15 min) presentations, parallel sessions of working groups, and sum-up discussions. ## Submissions Two types of papers will be considered: * Short contributions (between 6 and 8 pages) describing new ideas, innovative tools or position papers. * Full papers (between 12 and 16 pages). in LNCS format. Submissions should be uploaded to [EasyChair](https://easychair.org/conferences/?conf=ocl17). The program committee will review the submissions (minimum 2 reviews per paper, usually 3 reviews) and select papers according to their relevance and interest for discussions that will take place at the workshop. Accepted papers will be published online in a post-conference edition of [CEUR](http://www.ceur-ws.org). ## Important Dates - Submission of papers: April 28, 2017 - Notification: May 25, 2017 - Workshop date: July 20, 2017 -- Dr. Achim D. Brucker | Software Assurance & Security | University of Sheffield https://www.brucker.ch | https://logicalhacking.com/blog @adbrucker | @logicalhacking From skosyrev at ptsecurity.com Wed Feb 22 23:00:19 2017 From: skosyrev at ptsecurity.com (Sergey Kosyrev) Date: Wed, 22 Feb 2017 23:00:19 +0000 Subject: [Haskell-cafe] Size-indexed monoids In-Reply-To: <88b3792e-bb07-f305-db7f-05ab59f3dbbe@well-typed.com> References: <87y3wyxmr4.fsf@ptsecurity.com> <87tw7mb26o.fsf@posteo.de> , <88b3792e-bb07-f305-db7f-05ab59f3dbbe@well-typed.com> Message-ID: <0da4faaba6c644f08372ac85fb3ff26a@ptsecurity.com> Adam, Somewhat earlier, Adam Gundry wrote: > You might take a look at the rather lovely ghc-typelits-natnormalise > plugin. I haven't tried, but assuming you adjust the code to use a type > equality constraint rather than CmpNat, I think it should automatically > solve the problematic constraint. The use of ghc-typelits-natnormalise turned out to be a huge success! (modulo the typical z-versus-s issue, that caused some guessing : -) I only made the package available to Cabal, added the one-liner pragma, made the trivial modification you suggested, and the following just worked: > {-# OPTIONS_GHC -fplugin GHC.TypeLits.Normalise #-} > {-# LANGUAGE DataKinds, GADTs, KindSignatures, StandaloneDeriving, TypeOperators, UnicodeSyntax #-} > > module Understanding.Types where > > import GHC.TypeLits > > data T p (size ∷ Nat) where > TZ ∷ T p 0 > TS ∷ (Show p, (m + 1) ~ n) ⇒ > { payload ∷ p > , next ∷ T a m } → T a n > deriving instance Show p ⇒ Show (T p s) > > class MeasuredMonoid a where > mmempty ∷ a 0 > mmappend ∷ a n → a m → a (n + m) > > instance MeasuredMonoid (T p) where > mmempty = TZ > mmappend TZ TZ = TZ > mmappend TZ t@(TS _ _) = t > mmappend t@(TS _ _) TZ = t > mmappend tl@(TS pl nl) tr = TS pl $ mmappend nl tr > > (<>) ∷ MeasuredMonoid a ⇒ a n → a m → a (m + n) > (<>) = mmappend -- * Success, due to use of OPTIONS_GHC -fplugin GHC.TypeLits.Normalise -- > :t TZ <> TZ -- TZ <> TZ :: T p 0 -- > TS 1 TZ <> TS 0 TZ -- TS {payload = 1, next = TS {payload = 0, next = TZ}} -- > :t TS 1 TZ <> TS 0 TZ -- TS 1 TZ <> TS 0 TZ :: T a 2 Thank you, everybody! -- take care, Kosyrev Serge From lysxia at gmail.com Wed Feb 22 23:58:21 2017 From: lysxia at gmail.com (Li-yao Xia) Date: Wed, 22 Feb 2017 18:58:21 -0500 Subject: [Haskell-cafe] Size-indexed monoids In-Reply-To: <88b3792e-bb07-f305-db7f-05ab59f3dbbe@well-typed.com> References: <87y3wyxmr4.fsf@ptsecurity.com> <87tw7mb26o.fsf@posteo.de> <88b3792e-bb07-f305-db7f-05ab59f3dbbe@well-typed.com> Message-ID: Hello, This approach using unsafeCoerce is implemented by the recently added Data.Constraints.Nat module of the constraints package, which exports reusable proofs to help GHC reason about type-level literals. It's definitely something very experimental, and the current version on Hackage is unfortunately bugged, but seems worth mentioning. http://hackage.haskell.org/package/constraints-0.9/docs/Data-Constraint-Nat.html Li-yao On 02/22/2017 04:35 PM, Adam Gundry wrote: > On 22/02/17 20:39, Sergey Kosyrev wrote: >> The suspicion is that it is due to the fact that, while seductive to use (esp. due to TypeOperators), >> TypeLits.Nat carries no inductive proof of structure, which, on the other hand you have provided >> with the bespoke TMonoid-associated type families. >> >> Does anybody know if this can be overcome with the current state of art of GHC type-level machinery, >> or that we are, indeed, condemned to use the (somewhat) ugly-ish explicitly-inductive numerals? > I don't believe this is possible without cheating (see below) or using a > plugin. That said, some of the ugliness of inductive numerals can be > avoided by defining a type family to translate TypeLits.Nat into > inductive form. > >> I remember people seeking to employ GHC plugins to make it more conducive to type-level >> arithmetics, but I don't really feel confident to derive judgements about their relevance and >> implications on the case.. > You might take a look at the rather lovely ghc-typelits-natnormalise > plugin. I haven't tried, but assuming you adjust the code to use a type > equality constraint rather than CmpNat, I think it should automatically > solve the problematic constraint. > > If you'd prefer blatant cheating, another approach is to use > unsafeCoerce, like this: > > > {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeFamilies, TypeInType, > TypeOperators, UnicodeSyntax, StandaloneDeriving, > TypeApplications, RankNTypes, ScopedTypeVariables, > AllowAmbiguousTypes, ConstraintKinds #-} > > module SizeIndexedMonoids where > > import GHC.TypeLits > import GHC.Types (Type) > import Unsafe.Coerce > > -- | Assert without proof that the constraint c holds. It had better > -- be a true type equality constraint, otherwise you are asking for > -- trouble. > unsafeLemma :: forall c r . (c => r) -> r > unsafeLemma = unQ . (unsafeCoerce :: Q c r -> Q (r ~ r) r) . MkQ > > newtype Q c r = MkQ { unQ :: c => r } > > type Associativity x y z = (x + (y + z)) ~ ((x + y) + z) > > data T (p :: Type) (size ∷ Nat) where > TZ ∷ T p 0 > TS ∷ (Show p, (1 + m) ~ n) ⇒ > { payload ∷ p > , next ∷ T a m } → T a n > deriving instance Show p ⇒ Show (T p s) > > mmappend :: forall p m n . T p m -> T p n -> T p (m + n) > mmappend TZ tr = tr > mmappend (TS pl (nl :: T a m1)) tr = > unsafeLemma @(Associativity 1 m1 n) (TS pl (mmappend nl tr)) > > > Sorry, > > Adam > > >> Here is the record of my failure: >> >>> {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeFamilies, TypeInType, TypeOperators, UnicodeSyntax, StandaloneDeriving #-} >>> >>> module Understanding.Types where >>> >>> import GHC.TypeLits >>> import GHC.Types (Type) >>> >>> data T p (size ∷ Nat) where >>> TZ ∷ T p 0 >>> TS ∷ (Show p, CmpNat (m + 1) n ~ EQ) ⇒ >>> { payload ∷ p >>> , next ∷ T a m } → T a n >>> deriving instance Show p ⇒ Show (T p s) >>> >>> class MeasuredMonoid a where >>> mmempty ∷ a 0 >>> mmappend ∷ a n → a m → a (n + m) >>> >>> instance MeasuredMonoid (T p) where >>> mmempty = TZ >>> mmappend TZ TZ = TZ >>> mmappend TZ t@(TS _ _) = t >>> mmappend t@(TS _ _) TZ = t >>> mmappend tl@(TS pl nl) tr = TS pl $ mmappend nl tr >> -- * Failure due to lack of inductive structure of GHC.TypeLits.Nat >> -- >> -- error: >> -- • Could not deduce: CmpNat ((m1 + m) + 1) (n + m) ~ 'EQ >> -- arising from a use of ‘TS’ >> -- from the context: (Show p1, CmpNat (m1 + 1) n ~ 'EQ) >> -- bound by a pattern with constructor: >> -- TS :: forall k (a :: k) (n :: Nat) p (m :: Nat). >> -- (Show p, CmpNat (m + 1) n ~ 'EQ) => >> -- p -> T a m -> T a n, >> -- in an equation for ‘mmappend’ >> -- at /home/deepfire/src/haskell-understanding/Types.hs:24:16-23 >> -- • In the expression: TS pl >> -- In the expression: TS pl $ mmappend nl tr >> -- In an equation for ‘mmappend’: >> -- mmappend tl@(TS pl nl) tr = TS pl $ mmappend nl tr >> -- • Relevant bindings include >> -- tr :: T p m >> -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:27) >> -- nl :: T p m1 >> -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:22) >> -- tl :: T p n >> -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:24:12) >> -- mmappend :: T p n -> T p m -> T p (n + m) >> -- (bound at /home/deepfire/src/haskell-understanding/Types.hs:21:3) >> >> -- >> take care, >> Kosyrev Serge From maciej.bielecki at prati.pl Thu Feb 23 00:07:51 2017 From: maciej.bielecki at prati.pl (Maciej Bielecki) Date: Thu, 23 Feb 2017 01:07:51 +0100 Subject: [Haskell-cafe] -Werror -Woverlapping-patterns -fglasgow-exts ? In-Reply-To: References: Message-ID: <00141FD1-68F8-42CF-B11D-0392EC57EFD4@prati.pl> On Tue, Feb 21, 2017 at 12:21:08PM -0500, David Feuer wrote: > A lot of us would like to get -Werror for only some errors. I don't > think it exists yet. It's implemented in GHC HEAD: https://ghc.haskell.org/trac/ghc/ticket/11219 I'm not sure whether it supports flag deprecation warnings though. Maciej From konn.jinro at gmail.com Thu Feb 23 03:46:37 2017 From: konn.jinro at gmail.com (Hiromi ISHII) Date: Thu, 23 Feb 2017 12:46:37 +0900 Subject: [Haskell-cafe] Size-indexed monoids In-Reply-To: <87y3wyxmr4.fsf@ptsecurity.com> References: <87y3wyxmr4.fsf@ptsecurity.com> Message-ID: <526A4BC4-156E-492D-A5AF-F5F2351F3090@gmail.com> Oops, I sent this directly to Kosyrev... I resent this to cafe for the sake of knowledge sharing. (Sorry Kosyrev for recieving the same message twice...) --- Hi, I once write `sized` package, which wraps ListLike functors instead of Monoids: http://hackage.haskell.org/package/sized This can be indexed both with peano numeral and GHC.TypeLits.Nat. To get the latter working, I use several GHC Plugins. > On 2017/02/23 0:34, Kosyrev Serge wrote: > > Good day! > > What is the proper type class for stronger-typed (size-indexed) monoids: > - that is, monoids carrying their "size" in the type > - preferably as GHC.TypeLits.Nat > - preferably on Hackage > ? > > I'm quite prepared to the idea that a monoid is an entirely wrong abstraction, > from a category-theoretic standpoint, so I would gladly learn of a better one : -) > > Use case: > >> {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeOperators, UnicodeSyntax, StandaloneDeriving #-} >> >> module Understanding.Types where >> >> import GHC.TypeLits >> >> data T (depth ∷ Nat) p where >> TZ ∷ T 0 p >> TS ∷ (Show p, CmpNat (m + 1) n ~ EQ) ⇒ >> { payload ∷ p >> , next ∷ T m a } → T n a >> deriving instance Show p ⇒ Show (T d p) >> >> instance Monoid (T d p) where >> mempty = TZ >> mappend TZ TZ = TZ >> mappend TZ t@(TS _ _) = t >> mappend t@(TS _ _) TZ = t >> mappend tl@(TS pl nl) tr = TS pl $ mappend nl tr > > As it is, even the mempty case rejects such a blatant violation of > polymorphism, since `T 0 p` cannot unify with `T n p`. > > So, ideally (I think), I would like something like this: > >> class TypedMonoid a where >> tmempty ∷ a 0 >> tmappend ∷ a n → a m → a (n + m) > > -- > с уважениeм / respectfully, > Косырев Сергей > -- > “Most deadly errors arise from obsolete assumptions.” > -- Frank Herbert, Children of Dune > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. ----- 石井 大海 --------------------------- konn.jinro at gmail.com 筑波大学数理物質科学研究科 数学専攻 博士後期課程一年 ---------------------------------------------- > 2017/02/23 0:34、Kosyrev Serge のメール: > > Good day! > > What is the proper type class for stronger-typed (size-indexed) monoids: > - that is, monoids carrying their "size" in the type > - preferably as GHC.TypeLits.Nat > - preferably on Hackage > ? > > I'm quite prepared to the idea that a monoid is an entirely wrong abstraction, > from a category-theoretic standpoint, so I would gladly learn of a better one : -) > > Use case: > >> {-# LANGUAGE DataKinds, GADTs, KindSignatures, TypeOperators, UnicodeSyntax, StandaloneDeriving #-} >> >> module Understanding.Types where >> >> import GHC.TypeLits >> >> data T (depth ∷ Nat) p where >> TZ ∷ T 0 p >> TS ∷ (Show p, CmpNat (m + 1) n ~ EQ) ⇒ >> { payload ∷ p >> , next ∷ T m a } → T n a >> deriving instance Show p ⇒ Show (T d p) >> >> instance Monoid (T d p) where >> mempty = TZ >> mappend TZ TZ = TZ >> mappend TZ t@(TS _ _) = t >> mappend t@(TS _ _) TZ = t >> mappend tl@(TS pl nl) tr = TS pl $ mappend nl tr > > As it is, even the mempty case rejects such a blatant violation of > polymorphism, since `T 0 p` cannot unify with `T n p`. > > So, ideally (I think), I would like something like this: > >> class TypedMonoid a where >> tmempty ∷ a 0 >> tmappend ∷ a n → a m → a (n + m) > > -- > с уважениeм / respectfully, > Косырев Сергей > -- > “Most deadly errors arise from obsolete assumptions.” > -- Frank Herbert, Children of Dune > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. ----- 石井 大海 --------------------------- konn.jinro at gmail.com 筑波大学数理物質科学研究科 数学専攻 博士後期課程一年 ---------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 496 bytes Desc: Message signed with OpenPGP using GPGMail URL: From david.feuer at gmail.com Thu Feb 23 05:14:18 2017 From: david.feuer at gmail.com (David Feuer) Date: Thu, 23 Feb 2017 00:14:18 -0500 Subject: [Haskell-cafe] -Werror -Woverlapping-patterns -fglasgow-exts ? In-Reply-To: <00141FD1-68F8-42CF-B11D-0392EC57EFD4@prati.pl> References: <00141FD1-68F8-42CF-B11D-0392EC57EFD4@prati.pl> Message-ID: A tool to automatically select and add (almost) only the necessary extensions to code that compiles successfully with -fglasgow-exts would be quite nice to have, especially if it could run on a whole package. The easiest thing would probably be to compile the module and then add extensions included in -fglasgow-exts based on error messages, repeating until the module compiles successfully. The included extension I'm familiar with that seems hardest to handle is ScopedTypeVariables, as that can (in some cases) change the meaning of code that compiles either way. So the easiest thing would be to just include it unconditionally. On Feb 22, 2017 7:08 PM, "Maciej Bielecki" wrote: > On Tue, Feb 21, 2017 at 12:21:08PM -0500, David Feuer wrote: > > A lot of us would like to get -Werror for only some errors. I don't > > think it exists yet. > > It's implemented in GHC HEAD: https://ghc.haskell.org/trac/ > ghc/ticket/11219 > > I'm not sure whether it supports flag deprecation warnings though. > > Maciej > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From S.J.Thompson at kent.ac.uk Thu Feb 23 10:38:40 2017 From: S.J.Thompson at kent.ac.uk (Simon Thompson) Date: Thu, 23 Feb 2017 10:38:40 +0000 Subject: [Haskell-cafe] Trends in Functional Programming in Education ITFPIE) 2017, call for papers Message-ID: <808795D3-0D84-4690-8498-109316D10215@kent.ac.uk> TFPIE 2017 Trends in Functional Programming in Education, 2017 The sixth workshop on Trends in Functional Programming in Education, 2017, which is to be held on the Canterbury campus of the University of Kent on Thursday, 22 June, following the 2017 TFP meeting on 19–21 June. TFPIE workshops have previously been held in St Andrews, Scotland (2012), Provo Utah, USA (2013), Soesterberg, The Netherlands (2014), and Sophia-Antipolis, France (2015), College Park, USA (2016). The goal of TFPIE is to gather researchers, teachers and professionals that use, or are interested in the use of, functional programming in education. TFPIE aims to be a venue where novel ideas, classroom-tested ideas and work-in-progress on the use of functional programming in education are discussed. The one-day workshop will foster a spirit of open discussion by having a review process for publication after the workshop. The program chair of TFPIE 2017 will screen submissions to ensure that all presentations are within scope and are of interest to participants. After the workshop, presenters will be invited to submit revised versions of their articles for publication in the journal Electronic Proceedings in Theoretical Computer Science (EPTCS). Call for papers TFPIE 2017 welcomes submissions describing techniques used in the classroom, tools used in and/or developed for the classroom and any creative use of functional programming (FP) to aid education in or outside Computer Science. Topics of interest include, but are not limited to: - FP and beginning CS students - FP and Computational Thinking - FP and Artificial Intelligence - FP in Robotics - FP and Music - Advanced FP for undergraduates - FP in graduate education - Engaging students in research using FP - FP in Programming Languages - FP in the high school curriculum - FP as a stepping stone to other CS topics - FP and Philosophy - The pedagogy of teaching FP - FP and e-learning: MOOCs, automated assessment etc. - Best Lectures – more details below In addition to papers, we are requesting best lecture presentations. What’s your best lecture topic in an FP related course? Do you have a fun way to present FP concepts to novices or perhaps an especially interesting presentation of a difficult topic? In either case, please consider sharing it. Best lecture topics will be selected for presentation based on a short abstract describing the lecture and its interest to TFPIE attendees. Submission Potential presenters are invited to submit an extended abstract (4-6 pages) or a draft paper (up to 16 pages) in EPTCS style. The authors of accepted presentations will have their preprints and their slides made available on the workshop's website. Papers and abstracts can be submitted via easychair at the following link: https://easychair.org/conferences/?conf=tfpie2017 After the workshop, presenters will be invited to submit (a revised version of) their article for review. The PC will select the best articles for publication in the journal Electronic Proceedings in Theoretical Computer Science (EPTCS). Articles rejected for presentation and extended abstracts will not be formally reviewed by the PC. Programme committee Dr Laura Castro, University of A Coruña Prof Ralf Lämmel, University of Koblenz-Landau Dr Elena Machkasova, University of Minnesota, Morris Prof Michel Mauny, Inria, Paris Dr Jeremy Singer, University of Glasgow Prof Simon Thompson, University of Kent (chair) Important dates Submissions of draft papers: 10 May, 2017 Notification: 17 May, 2017 Registration: 11 June, 2017 Workshop: 22 June 2017 Submission for formal review: 18 August, 2017 Notification of acceptance: 6 October, 2017 Camera ready paper: 3 November, 2017 Simon Thompson | Professor of Logic and Computation School of Computing | University of Kent | Canterbury, CT2 7NF, UK s.j.thompson at kent.ac.uk | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt From dpt at bostoncoop.net Thu Feb 23 15:59:31 2017 From: dpt at bostoncoop.net (Dylan Thurston) Date: Thu, 23 Feb 2017 10:59:31 -0500 Subject: [Haskell-cafe] Extensions to Haskell 98 in the GHC Prelude? Message-ID: <20170223155931.vhx4bbxtlavkndbe@tulip.bostoncoop.net> Pardon me if this is a stupid/frequently asked question... The GHC Prelude has some extensions to the Prelude in Haskell 98 or Haskell 2010. For instance, it has the Applicative type class, whose bindings overlap with some old code of mine. Where are these non-standard extensions documented? The Applicative class is documented at https://downloads.haskell.org/~ghc/latest/docs/html/libraries/base-4.9.0.0/Prelude.html but it's not picked out as something non-standard. I didn't find it documented where I would have expected in the GHC docs at https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/bugs.html#haskell-standards-vs-glasgow-haskell-language-non-compliance nor did I see a way to get a standards-compliant prelude? In this particular case I'll probably rework my code, as Applicative seems like a reasonable core addition. (I am a little annoyed that it uses so many short infix operators; I was using (*>).) I'm just surprised not to see it documented anywhere. Thanks, Dylan Thurston From ivan.miljenovic at gmail.com Thu Feb 23 23:31:02 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Fri, 24 Feb 2017 10:31:02 +1100 Subject: [Haskell-cafe] Extensions to Haskell 98 in the GHC Prelude? In-Reply-To: <20170223155931.vhx4bbxtlavkndbe@tulip.bostoncoop.net> References: <20170223155931.vhx4bbxtlavkndbe@tulip.bostoncoop.net> Message-ID: On 24 February 2017 at 02:59, Dylan Thurston wrote: > Pardon me if this is a stupid/frequently asked question... > > The GHC Prelude has some extensions to the Prelude in Haskell 98 or > Haskell 2010. For instance, it has the Applicative type class, whose > bindings overlap with some old code of mine. Where are these > non-standard extensions documented? The Applicative class is > documented at > > https://downloads.haskell.org/~ghc/latest/docs/html/libraries/base-4.9.0.0/Prelude.html > > but it's not picked out as something non-standard. Do you mean that it's now in the Prelude as opposed to being in a different module? If so, that came through from the Applicative => Monad Proposal (aka AMP): https://wiki.haskell.org/Functor-Applicative-Monad_Proposal There's also the GHC migration guide that might be helpful: https://ghc.haskell.org/trac/ghc/wiki/Migration > > I didn't find it documented where I would have expected in the GHC docs at > > https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/bugs.html#haskell-standards-vs-glasgow-haskell-language-non-compliance Yes, that's a little odd. > nor did I see a way to get a standards-compliant prelude? There's the haskell2010 (and also a haskell98) package: http://hackage.haskell.org/package/haskell2010 I'm not sure how well it works now though; AMP appears to have broken it: https://ghc.haskell.org/trac/ghc/ticket/9590 -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From allbery.b at gmail.com Thu Feb 23 23:38:05 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 23 Feb 2017 18:38:05 -0500 Subject: [Haskell-cafe] Extensions to Haskell 98 in the GHC Prelude? In-Reply-To: References: <20170223155931.vhx4bbxtlavkndbe@tulip.bostoncoop.net> Message-ID: On Thu, Feb 23, 2017 at 6:31 PM, Ivan Lazar Miljenovic < ivan.miljenovic at gmail.com> wrote: > I'm not sure how well it works now though; AMP appears to have broken > it: https://ghc.haskell.org/trac/ghc/ticket/9590 > Didn't the removal of Show and Eq "superclasses" of Num break it? -- 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 erkokl at gmail.com Thu Feb 23 23:49:22 2017 From: erkokl at gmail.com (Levent Erkok) Date: Thu, 23 Feb 2017 15:49:22 -0800 Subject: [Haskell-cafe] ghc on xeon phi? In-Reply-To: <7e87ec92-b15d-b5c7-4330-9dfa10020712@htwk-leipzig.de> References: <0c7c7697-0bbe-5c78-1128-654467e845ff@htwk-leipzig.de> <7e87ec92-b15d-b5c7-4330-9dfa10020712@htwk-leipzig.de> Message-ID: Johannes: I'm happy to report that I was able to do this experiment, and it indeed worked just fine. I compiled a toy program (along the lines of "hello world") using GHC-8.0.1; took the generated binary to a KNL machine, and ran it without any issues. I then repeated the same with a much bigger interactive Haskell program, and while I didn't test all aspects of it, I was able to start it on the KNL machine as well. (This latter program has quite a bit of dependencies on various Haskell libraries.) So, at least from those two experiments, I think there's a lot of hope that you can just copy over a GHC generated binary and expect it to run unmodified. The machine I compiled it on have the following characteristics: $ ghc --version The Glorious Glasgow Haskell Compilation System, version 8.0.1 $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 16 On-line CPU(s) list: 0-15 Thread(s) per core: 1 Core(s) per socket: 8 Socket(s): 2 NUMA node(s): 2 Vendor ID: GenuineIntel CPU family: 6 Model: 45 Stepping: 7 CPU MHz: 1200.000 BogoMIPS: 5199.87 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 20480K NUMA node0 CPU(s): 0-7 NUMA node1 CPU(s): 8-15 And the machine I ran it on (which doesn't have ghc installed): $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 68 On-line CPU(s) list: 0-67 Thread(s) per core: 1 Core(s) per socket: 68 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 87 Model name: Intel(R) Xeon Phi(TM) CPU 7250 @ 1.40GHz Stepping: 1 CPU MHz: 1400.000 BogoMIPS: 2793.32 Virtualization: VT-x L1d cache: 32K L1i cache: 32K L2 cache: 1024K NUMA node0 CPU(s): 0-67 So, it does appear that Intel's "binary-compatible" claim is indeed holding up. I'd be happy to do some "small" experiments if you're particularly worried about some particular feature; let me know. Cheers, -Levent. On Tue, Feb 21, 2017 at 10:29 AM, Johannes Waldmann < johannes.waldmann at htwk-leipzig.de> wrote: > Hi Levent, > > > The whole point of the Xeon-phi is the availability of > > large-vector sized floating-point support and many-many cores. > > Sure, that's what I'm contemplating - use the many options > of writing parallel and concurrent Haskell programs. > > So, GHC's RTS should "just work"? > > I was hoping someone already had actually seen this > on their machine. > > - J. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From harendra.kumar at gmail.com Fri Feb 24 02:05:08 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 07:35:08 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? Message-ID: Kids have this amazing ability to break any toy in minutes. I gave my seven year old daughter ghci to play with and in a little while she said it is broken: >> let 1 = 2 >> 1 1 >> Earlier, I had explained to her about symbols and assigning values to symbols, and I said numbers are not symbols. But when she came up with this I could not explain what's going on. How can "1 = 2" be a valid equation? Am I missing something fundamental here, or it is just broken? -harendra -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Fri Feb 24 02:07:42 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 23 Feb 2017 21:07:42 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar wrote: > Kids have this amazing ability to break any toy in minutes. I gave my > seven year old daughter ghci to play with and in a little while she said it > is broken: > > >> let 1 = 2 > > >> 1 > > 1 > > >> > > Earlier, I had explained to her about symbols and assigning values to > symbols, and I said numbers are not symbols. But when she came up with this > I could not explain what's going on. How can "1 = 2" be a valid equation? > Am I missing something fundamental here, or it is just broken? > It's a pattern match. The match fails, but as it produced no bindings it cannot be observed and its success or failure is irrelevant. -- 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 ivan.miljenovic at gmail.com Fri Feb 24 02:09:20 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Fri, 24 Feb 2017 13:09:20 +1100 Subject: [Haskell-cafe] Extensions to Haskell 98 in the GHC Prelude? In-Reply-To: References: <20170223155931.vhx4bbxtlavkndbe@tulip.bostoncoop.net> Message-ID: On 24 February 2017 at 10:38, Brandon Allbery wrote: > > On Thu, Feb 23, 2017 at 6:31 PM, Ivan Lazar Miljenovic > wrote: >> >> I'm not sure how well it works now though; AMP appears to have broken >> it: https://ghc.haskell.org/trac/ghc/ticket/9590 > > > Didn't the removal of Show and Eq "superclasses" of Num break it? Right, I forgot about that one. So AMP just smashed it for good measure :p -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From harendra.kumar at gmail.com Fri Feb 24 02:56:50 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 08:26:50 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: My first guess was a pattern match, but it sounded a bit odd because there is no explicit constructor in case of numbers. If there were an explicit constructor it would have been easier to imagine this as a pattern match. This seems to be a weird side effect of the special handling of numbers. -harendra On 24 February 2017 at 07:37, Brandon Allbery wrote: > On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar > wrote: > >> Kids have this amazing ability to break any toy in minutes. I gave my >> seven year old daughter ghci to play with and in a little while she said it >> is broken: >> >> >> let 1 = 2 >> >> >> 1 >> >> 1 >> >> >> >> >> Earlier, I had explained to her about symbols and assigning values to >> symbols, and I said numbers are not symbols. But when she came up with this >> I could not explain what's going on. How can "1 = 2" be a valid equation? >> Am I missing something fundamental here, or it is just broken? >> > It's a pattern match. The match fails, but as it produced no bindings it > cannot be observed and its success or failure is irrelevant. > > -- > 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 Fri Feb 24 03:00:36 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 23 Feb 2017 22:00:36 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: It is, yes. (Literal numbers in patterns occasionally have unexpected type ramifications as a result; and occasionally others, since the compiler rewrites the pattern match into a guard. It's one of those things that Just Works 99% of the time and then makes you tear your hair out.) On Thu, Feb 23, 2017 at 9:56 PM, Harendra Kumar wrote: > My first guess was a pattern match, but it sounded a bit odd because there > is no explicit constructor in case of numbers. If there were an explicit > constructor it would have been easier to imagine this as a pattern match. > This seems to be a weird side effect of the special handling of numbers. > > -harendra > > On 24 February 2017 at 07:37, Brandon Allbery wrote: > >> On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar > > wrote: >> >>> Kids have this amazing ability to break any toy in minutes. I gave my >>> seven year old daughter ghci to play with and in a little while she said it >>> is broken: >>> >>> >> let 1 = 2 >>> >>> >> 1 >>> >>> 1 >>> >>> >> >>> >>> Earlier, I had explained to her about symbols and assigning values to >>> symbols, and I said numbers are not symbols. But when she came up with this >>> I could not explain what's going on. How can "1 = 2" be a valid equation? >>> Am I missing something fundamental here, or it is just broken? >>> >> It's a pattern match. The match fails, but as it produced no bindings it >> cannot be observed and its success or failure is irrelevant. >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net >> > > -- 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 harendra.kumar at gmail.com Fri Feb 24 03:11:45 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 08:41:45 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: Are pattern matches which produce no bindings useful in any case? Will it be possible or a good idea for the compiler to produce warnings in such cases? This seems to be just a no-op. -harendra On 24 February 2017 at 08:30, Brandon Allbery wrote: > It is, yes. (Literal numbers in patterns occasionally have unexpected type > ramifications as a result; and occasionally others, since the compiler > rewrites the pattern match into a guard. It's one of those things that Just > Works 99% of the time and then makes you tear your hair out.) > > On Thu, Feb 23, 2017 at 9:56 PM, Harendra Kumar > wrote: > >> My first guess was a pattern match, but it sounded a bit odd because >> there is no explicit constructor in case of numbers. If there were an >> explicit constructor it would have been easier to imagine this as a pattern >> match. This seems to be a weird side effect of the special handling of >> numbers. >> >> -harendra >> >> On 24 February 2017 at 07:37, Brandon Allbery >> wrote: >> >>> On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar < >>> harendra.kumar at gmail.com> wrote: >>> >>>> Kids have this amazing ability to break any toy in minutes. I gave my >>>> seven year old daughter ghci to play with and in a little while she said it >>>> is broken: >>>> >>>> >> let 1 = 2 >>>> >>>> >> 1 >>>> >>>> 1 >>>> >>>> >> >>>> >>>> Earlier, I had explained to her about symbols and assigning values to >>>> symbols, and I said numbers are not symbols. But when she came up with this >>>> I could not explain what's going on. How can "1 = 2" be a valid equation? >>>> Am I missing something fundamental here, or it is just broken? >>>> >>> It's a pattern match. The match fails, but as it produced no bindings it >>> cannot be observed and its success or failure is irrelevant. >>> >>> -- >>> brandon s allbery kf8nh sine nomine >>> associates >>> allbery.b at gmail.com >>> ballbery at sinenomine.net >>> unix, openafs, kerberos, infrastructure, xmonad >>> http://sinenomine.net >>> >> >> > > > -- > 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 ezyang at mit.edu Fri Feb 24 03:14:03 2017 From: ezyang at mit.edu (Edward Z. Yang) Date: Thu, 23 Feb 2017 19:14:03 -0800 Subject: [Haskell-cafe] Read my thesis draft on Backpack! Message-ID: <1487905752-sup-1524@sabre> Hello all, I have finished a draft of my thesis on Backpack, a new module system for Haskell (building on top of the work of Scott Kilpatrick et al). This thesis also doubles as the definitive manual on Backpack, which will be released with the upcoming GHC 8.2. I've posted a copy of the draft here: https://github.com/ezyang/thesis/releases and I would love it if you took a look at it, gave it a read perhaps, and told me about anything that was unclear or not well explained. You can file an issue on the GitHub, or shoot me an email or tweet. Looking forward to your comments. Thanks, Edward From allbery.b at gmail.com Fri Feb 24 03:15:19 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 23 Feb 2017 22:15:19 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: Literally the only use I've seen for this was a CCC puzzle. However, it is the trivial case of something that is more useful: pattern matching the result of an expression (say, a Data.Map.lookup when you know the key exists). pyanfar Z$ ghc -c -Wall Mu.hs Mu.hs:3:1: Warning: Defaulting the following constraint(s) to type ‘Integer’ (Eq a0) arising from the literal ‘1’ at Mu.hs:3:1 (Num a0) arising from the literal ‘1’ at Mu.hs:3:1 In the pattern: 1 In a pattern binding: 1 = 2 Mu.hs:3:1: Warning: This pattern-binding binds no variables: 1 = 2 On Thu, Feb 23, 2017 at 10:11 PM, Harendra Kumar wrote: > Are pattern matches which produce no bindings useful in any case? Will it > be possible or a good idea for the compiler to produce warnings in such > cases? This seems to be just a no-op. > > -harendra > > On 24 February 2017 at 08:30, Brandon Allbery wrote: > >> It is, yes. (Literal numbers in patterns occasionally have unexpected >> type ramifications as a result; and occasionally others, since the compiler >> rewrites the pattern match into a guard. It's one of those things that Just >> Works 99% of the time and then makes you tear your hair out.) >> >> On Thu, Feb 23, 2017 at 9:56 PM, Harendra Kumar > > wrote: >> >>> My first guess was a pattern match, but it sounded a bit odd because >>> there is no explicit constructor in case of numbers. If there were an >>> explicit constructor it would have been easier to imagine this as a pattern >>> match. This seems to be a weird side effect of the special handling of >>> numbers. >>> >>> -harendra >>> >>> On 24 February 2017 at 07:37, Brandon Allbery >>> wrote: >>> >>>> On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar < >>>> harendra.kumar at gmail.com> wrote: >>>> >>>>> Kids have this amazing ability to break any toy in minutes. I gave my >>>>> seven year old daughter ghci to play with and in a little while she said it >>>>> is broken: >>>>> >>>>> >> let 1 = 2 >>>>> >>>>> >> 1 >>>>> >>>>> 1 >>>>> >>>>> >> >>>>> >>>>> Earlier, I had explained to her about symbols and assigning values to >>>>> symbols, and I said numbers are not symbols. But when she came up with this >>>>> I could not explain what's going on. How can "1 = 2" be a valid equation? >>>>> Am I missing something fundamental here, or it is just broken? >>>>> >>>> It's a pattern match. The match fails, but as it produced no bindings >>>> it cannot be observed and its success or failure is irrelevant. >>>> >>>> -- >>>> brandon s allbery kf8nh sine nomine >>>> associates >>>> allbery.b at gmail.com >>>> ballbery at sinenomine.net >>>> unix, openafs, kerberos, infrastructure, xmonad >>>> http://sinenomine.net >>>> >>> >>> >> >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net >> > > -- 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 harendra.kumar at gmail.com Fri Feb 24 03:41:17 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 09:11:17 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: On 24 February 2017 at 08:45, Brandon Allbery wrote: > Literally the only use I've seen for this was a CCC puzzle. However, it is > the trivial case of something that is more useful: pattern matching the > result of an expression (say, a Data.Map.lookup when you know the key > exists). > Can you explain how that will be useful (without a binding)? Will the pattern match be ever actually tried when there is no binding? -harendra -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Fri Feb 24 03:51:21 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 23 Feb 2017 22:51:21 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: Without a binding it is useless at top level, but if you strictify the pattern it can be useful in `let` (possibly as a sanity check where you want the program to abort if it fails). I don't recall offhand if it desugars usefully in list comprehensions, but if so it would work as a filter. There may also be other specialized use cases; general syntax tends to get reused a lot in Haskell, so making this case a syntax error could make it difficult to support actually useful cases. :) (Also I'm sure someone overly clever could figure out some way to abuse it. :) On Thu, Feb 23, 2017 at 10:41 PM, Harendra Kumar wrote: > On 24 February 2017 at 08:45, Brandon Allbery wrote: > >> Literally the only use I've seen for this was a CCC puzzle. However, it >> is the trivial case of something that is more useful: pattern matching the >> result of an expression (say, a Data.Map.lookup when you know the key >> exists). >> > > Can you explain how that will be useful (without a binding)? Will the > pattern match be ever actually tried when there is no binding? > > -harendra > -- 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 taeer at necsi.edu Fri Feb 24 05:00:33 2017 From: taeer at necsi.edu (Taeer Bar-Yam) Date: Fri, 24 Feb 2017 05:00:33 +0000 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: <1487912302-astroid-0-rstzsyev48-4838@rebel> Since nobody has provided an example use case, I will. It's not particularly useful, but it's a minimal case that does something interesting. func :: (Int, a) -> Maybe a func (0, x) = Just x func _ = Nothing Excerpts from Brandon Allbery's message of February 23, 2017 10:51 pm: > Without a binding it is useless at top level, but if you strictify the > pattern it can be useful in `let` (possibly as a sanity check where you > want the program to abort if it fails). I don't recall offhand if it > desugars usefully in list comprehensions, but if so it would work as a > filter. There may also be other specialized use cases; general syntax tends > to get reused a lot in Haskell, so making this case a syntax error could > make it difficult to support actually useful cases. :) > > (Also I'm sure someone overly clever could figure out some way to abuse it. > :) > > On Thu, Feb 23, 2017 at 10:41 PM, Harendra Kumar > wrote: > >> On 24 February 2017 at 08:45, Brandon Allbery wrote: >> >>> Literally the only use I've seen for this was a CCC puzzle. However, it >>> is the trivial case of something that is more useful: pattern matching the >>> result of an expression (say, a Data.Map.lookup when you know the key >>> exists). >>> >> >> Can you explain how that will be useful (without a binding)? Will the >> pattern match be ever actually tried when there is no binding? >> >> -harendra >> > > > > -- > 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 > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. --Taeer From harendra.kumar at gmail.com Fri Feb 24 05:04:06 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 10:34:06 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: Yes, if you use a bang pattern in a let clause it can act as an assert in a strict context (e.g. in IO Monad). But, it can't even be caught as an exception (or can it?). For example, this fails: x = fromList [("x", 1)] :: Map String Int main = print $ let !Nothing = Data.Map.lookup "x" x in 10 x: x.hs:22:20-51: Irrefutable pattern failed for pattern Nothing -harendra On 24 February 2017 at 09:21, Brandon Allbery wrote: > > Without a binding it is useless at top level, but if you strictify the pattern it can be useful in `let` (possibly as a sanity check where you want the program to abort if it fails). I don't recall offhand if it desugars usefully in list comprehensions, but if so it would work as a filter. There may also be other specialized use cases; general syntax tends to get reused a lot in Haskell, so making this case a syntax error could make it difficult to support actually useful cases. :) > > (Also I'm sure someone overly clever could figure out some way to abuse it. :) > > On Thu, Feb 23, 2017 at 10:41 PM, Harendra Kumar wrote: >> >> On 24 February 2017 at 08:45, Brandon Allbery wrote: >>> >>> Literally the only use I've seen for this was a CCC puzzle. However, it is the trivial case of something that is more useful: pattern matching the result of an expression (say, a Data.Map.lookup when you know the key exists). >> >> >> Can you explain how that will be useful (without a binding)? Will the pattern match be ever actually tried when there is no binding? >> >> -harendra > > > > > -- > 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 harendra.kumar at gmail.com Fri Feb 24 05:08:43 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 10:38:43 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> Message-ID: CCing the list. I guess you intended to cc but forgot. On 24 February 2017 at 09:27, wrote: > In Erlang, the equivalent of a let fails. > 1> 1=2. > ** exception error: no match of right hand side value 2 > > In SML, the equivalent of a let fails. > - val 1 = 1; > - val 1 = 2; > > uncaught exception Bind [nonexhaustive binding failure] > raised at: stdIn:2.5-2.10 > > The problem is not that let 1 = 2 ... is *legal* but that > - the compiler is *silent* about it > - the runtime is *silent* about it. > Compiling the little program > > main = let 1 = 2 in print "hi" > > I expected that the compiler would be silent but that > there would be some sort of "matched failed" error at > run time. Silly me. > > > The thing is, it is not just bindings that bind no variables > that act as if they were not there. > > main = let [x] = [1,2] in print "hi" > > also compiles silently and runs without error. Change it to > > main = let [x] = [1,2] in print ("hi" ++ show x) > > and you get a runtime error > > : : Irrefutable pattern failed for pattern [x]. > > I wish the compiler would report an error something like > > ": possibly failing match deleted > because it binds no live variables" > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Fri Feb 24 05:10:38 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 24 Feb 2017 00:10:38 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: <1487912302-astroid-0-rstzsyev48-4838@rebel> References: <1487912302-astroid-0-rstzsyev48-4838@rebel> Message-ID: On Fri, Feb 24, 2017 at 12:00 AM, Taeer Bar-Yam wrote: > Since nobody has provided an example use case, I will. It's not > particularly useful, but it's a minimal case that does something > interesting. I spent about 10 minutes trying to construct one that made any sense. :/ -- 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 Fri Feb 24 05:13:01 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 24 Feb 2017 00:13:01 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> Message-ID: On Fri, Feb 24, 2017 at 12:08 AM, Harendra Kumar wrote: > I wish the compiler would report an error something like >> >> ": possibly failing match deleted >> because it binds no live variables" > > Note that I showed the warning -Wall gives you earlier. -Werror also works... and, while I don't think it's in 8.0.x yet, future versions will allow selective conversions of warnings to errors. -- 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 jclites at mac.com Fri Feb 24 05:18:21 2017 From: jclites at mac.com (Jeff Clites) Date: Thu, 23 Feb 2017 21:18:21 -0800 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: This works too: Nothing = Just "hello" so you get the same effect even without any literal number specialness. Even this: Just x = Nothing also "works" until you force evaluation of x, as an irrefutable (lazy) pattern match. So in a way, you could view the first case as a lazy pattern match in which there is nothing you could possibly force, so there's no way to manifest the pattern match failure. Just another way of looking at it. JEff > On Feb 23, 2017, at 7:00 PM, Brandon Allbery wrote: > > It is, yes. (Literal numbers in patterns occasionally have unexpected type ramifications as a result; and occasionally others, since the compiler rewrites the pattern match into a guard. It's one of those things that Just Works 99% of the time and then makes you tear your hair out.) > >> On Thu, Feb 23, 2017 at 9:56 PM, Harendra Kumar wrote: >> My first guess was a pattern match, but it sounded a bit odd because there is no explicit constructor in case of numbers. If there were an explicit constructor it would have been easier to imagine this as a pattern match. This seems to be a weird side effect of the special handling of numbers. >> >> -harendra >> >>> On 24 February 2017 at 07:37, Brandon Allbery wrote: >>>> On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar wrote: >>>> Kids have this amazing ability to break any toy in minutes. I gave my seven year old daughter ghci to play with and in a little while she said it is broken: >>>> >> let 1 = 2 >>>> >>>> >> 1 >>>> >>>> 1 >>>> >>>> >> >>>> >>>> Earlier, I had explained to her about symbols and assigning values to symbols, and I said numbers are not symbols. But when she came up with this I could not explain what's going on. How can "1 = 2" be a valid equation? Am I missing something fundamental here, or it is just broken? >>>> >>> >>> It's a pattern match. The match fails, but as it produced no bindings it cannot be observed and its success or failure is irrelevant. >>> >>> -- >>> brandon s allbery kf8nh sine nomine associates >>> allbery.b at gmail.com ballbery at sinenomine.net >>> unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net >> > > > > -- > 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 > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From harendra.kumar at gmail.com Fri Feb 24 05:27:29 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 10:57:29 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: <1487912302-astroid-0-rstzsyev48-4838@rebel> References: <1487912302-astroid-0-rstzsyev48-4838@rebel> Message-ID: Pattern match in a function definition is different. Here the pattern match is actually being used as part of the function definition. We were trying to figure out the usefulness of non-function pattern matches which do not result in a binding. The assert case pointed out by Brandon is one example. Though not so useful. -harendra On 24 February 2017 at 10:30, Taeer Bar-Yam wrote: > Since nobody has provided an example use case, I will. It's not > particularly useful, but it's a minimal case that does something > interesting. > > func :: (Int, a) -> Maybe a > func (0, x) = Just x > func _ = Nothing > > Excerpts from Brandon Allbery's message of February 23, 2017 10:51 pm: > >> Without a binding it is useless at top level, but if you strictify the >> pattern it can be useful in `let` (possibly as a sanity check where you >> want the program to abort if it fails). I don't recall offhand if it >> desugars usefully in list comprehensions, but if so it would work as a >> filter. There may also be other specialized use cases; general syntax >> tends >> to get reused a lot in Haskell, so making this case a syntax error could >> make it difficult to support actually useful cases. :) >> >> (Also I'm sure someone overly clever could figure out some way to abuse >> it. >> :) >> >> On Thu, Feb 23, 2017 at 10:41 PM, Harendra Kumar < >> harendra.kumar at gmail.com> >> wrote: >> >> On 24 February 2017 at 08:45, Brandon Allbery >>> wrote: >>> >>> Literally the only use I've seen for this was a CCC puzzle. However, it >>>> is the trivial case of something that is more useful: pattern matching >>>> the >>>> result of an expression (say, a Data.Map.lookup when you know the key >>>> exists). >>>> >>>> >>> Can you explain how that will be useful (without a binding)? Will the >>> pattern match be ever actually tried when there is no binding? >>> >>> -harendra >>> >>> >> >> >> -- >> 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 >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. >> > > --Taeer -------------- next part -------------- An HTML attachment was scrubbed... URL: From harendra.kumar at gmail.com Fri Feb 24 05:38:23 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 11:08:23 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: In these examples, we can identify the constructor (capitalized first letter) on the LHS and so we are trained to know that it is a pattern match. The original point related to number specialness was that "1 = 2" is not easily identifiable as a pattern match because there are no explicit constructors. The literal "1" here is neither an "explicit constructor" nor a binding symbol. -harendra On 24 February 2017 at 10:48, Jeff Clites wrote: > This works too: > > Nothing = Just "hello" > > so you get the same effect even without any literal number specialness. > > Even this: > > Just x = Nothing > > also "works" until you force evaluation of x, as an irrefutable (lazy) > pattern match. So in a way, you could view the first case as a lazy pattern > match in which there is nothing you could possibly force, so there's no way > to manifest the pattern match failure. > > Just another way of looking at it. > > JEff > > On Feb 23, 2017, at 7:00 PM, Brandon Allbery wrote: > > It is, yes. (Literal numbers in patterns occasionally have unexpected type > ramifications as a result; and occasionally others, since the compiler > rewrites the pattern match into a guard. It's one of those things that Just > Works 99% of the time and then makes you tear your hair out.) > > On Thu, Feb 23, 2017 at 9:56 PM, Harendra Kumar > wrote: > >> My first guess was a pattern match, but it sounded a bit odd because >> there is no explicit constructor in case of numbers. If there were an >> explicit constructor it would have been easier to imagine this as a pattern >> match. This seems to be a weird side effect of the special handling of >> numbers. >> >> -harendra >> >> On 24 February 2017 at 07:37, Brandon Allbery >> wrote: >> >>> On Thu, Feb 23, 2017 at 9:05 PM, Harendra Kumar < >>> harendra.kumar at gmail.com> wrote: >>> >>>> Kids have this amazing ability to break any toy in minutes. I gave my >>>> seven year old daughter ghci to play with and in a little while she said it >>>> is broken: >>>> >>>> >> let 1 = 2 >>>> >>>> >> 1 >>>> >>>> 1 >>>> >>>> >> >>>> >>>> Earlier, I had explained to her about symbols and assigning values to >>>> symbols, and I said numbers are not symbols. But when she came up with this >>>> I could not explain what's going on. How can "1 = 2" be a valid equation? >>>> Am I missing something fundamental here, or it is just broken? >>>> >>> It's a pattern match. The match fails, but as it produced no bindings it >>> cannot be observed and its success or failure is irrelevant. >>> >>> -- >>> brandon s allbery kf8nh sine nomine >>> associates >>> allbery.b at gmail.com >>> ballbery at sinenomine.net >>> unix, openafs, kerberos, infrastructure, xmonad >>> http://sinenomine.net >>> >> >> > > > -- > 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 > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Fri Feb 24 05:49:17 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Fri, 24 Feb 2017 00:49:17 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: On Fri, Feb 24, 2017 at 12:38 AM, Harendra Kumar wrote: > In these examples, we can identify the constructor (capitalized first > letter) on the LHS and so we are trained to know that it is a pattern > match. The original point related to number specialness was that "1 = 2" is > not easily identifiable as a pattern match because there are no explicit > constructors. The literal "1" here is neither an "explicit constructor" nor > a binding symbol. Yes, at this point you just have to know that the Report specifies a bunch of special handling for numeric literals. -- 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 ekmett at gmail.com Fri Feb 24 05:52:57 2017 From: ekmett at gmail.com (Edward Kmett) Date: Fri, 24 Feb 2017 00:52:57 -0500 Subject: [Haskell-cafe] Extensions to Haskell 98 in the GHC Prelude? In-Reply-To: <20170223155931.vhx4bbxtlavkndbe@tulip.bostoncoop.net> References: <20170223155931.vhx4bbxtlavkndbe@tulip.bostoncoop.net> Message-ID: GHC consciously varies from the existing language standard in a number of ways. Most of the variances are in things like parsing or typechecking corner cases. The classes Num, Bits, Read, Floating all have variations from the existing standard to fix stuff a very slow moving standard just never seems to get around to fixing or for practical performance concerns. Applicative as a superclass of Monad and generalizing the Prelude to Foldable/Traversable are the most egregious such examples. What you're looking for* should* be included in https://downloads.haskell.org/~ghc/master/users-guide/bugs.html Alas, a sub-section describing the AMP and Foldable/Traversable changes as a variation on the report appears to be missing. It isn't unique in this regard. Floating has some new members for avoiding precision loss when exponentiating and taking logs, as well. This is also missing. (We go out of our way to call out the extra Read members in there after all.) For consistency (<$) being in Functor maybe should be called out as well? It seems there are two calls to action and a decision to make here: 1.) We should definitely do a better job of keeping the infelicities section of the documentation up to date. Adding notes on the Applicative/Monad changes, Foldable/Traversable changes, the incorporation of Monoid. Adding the variation in the Floating class member list.. 2.) We're fixing the language standard. A Haskell Prime committee has been formed to this (and other) ends. My understanding from talking with Herbert is that the current process delegates responsibility for the library portion of the upcoming report to the core libraries committee, so we have some language to draft. Finally, we just need to decide if having the section in the documentation where it is is enough, or if it needs some kind of better linkage. -Edward On Thu, Feb 23, 2017 at 10:59 AM, Dylan Thurston wrote: > Pardon me if this is a stupid/frequently asked question... > > The GHC Prelude has some extensions to the Prelude in Haskell 98 or > Haskell 2010. For instance, it has the Applicative type class, whose > bindings overlap with some old code of mine. Where are these > non-standard extensions documented? The Applicative class is > documented at > > https://downloads.haskell.org/~ghc/latest/docs/html/ > libraries/base-4.9.0.0/Prelude.html > > but it's not picked out as something non-standard. > > I didn't find it documented where I would have expected in the GHC docs at > > https://downloads.haskell.org/~ghc/latest/docs/html/users_ > guide/bugs.html#haskell-standards-vs-glasgow-haskell- > language-non-compliance > > nor did I see a way to get a standards-compliant prelude? > > In this particular case I'll probably rework my code, as Applicative > seems like a reasonable core addition. (I am a little annoyed that it > uses so many short infix operators; I was using (*>).) I'm just > surprised not to see it documented anywhere. > > Thanks, > Dylan Thurston > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jclites at mac.com Fri Feb 24 05:55:20 2017 From: jclites at mac.com (Jeff Clites) Date: Thu, 23 Feb 2017 21:55:20 -0800 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: > On Feb 23, 2017, at 9:49 PM, Brandon Allbery wrote: > >> On Fri, Feb 24, 2017 at 12:38 AM, Harendra Kumar wrote: >> In these examples, we can identify the constructor (capitalized first letter) on the LHS and so we are trained to know that it is a pattern match. The original point related to number specialness was that "1 = 2" is not easily identifiable as a pattern match because there are no explicit constructors. The literal "1" here is neither an "explicit constructor" nor a binding symbol. > > Yes, at this point you just have to know that the Report specifies a bunch of special handling for numeric literals. Also: "day" = "night" Isn't every "=" a pattern match? JEff -------------- next part -------------- An HTML attachment was scrubbed... URL: From harendra.kumar at gmail.com Fri Feb 24 06:22:09 2017 From: harendra.kumar at gmail.com (Harendra Kumar) Date: Fri, 24 Feb 2017 11:52:09 +0530 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: On 24 February 2017 at 11:25, Jeff Clites wrote: > On Feb 23, 2017, at 9:49 PM, Brandon Allbery wrote: > > On Fri, Feb 24, 2017 at 12:38 AM, Harendra Kumar > wrote: > >> In these examples, we can identify the constructor (capitalized first >> letter) on the LHS and so we are trained to know that it is a pattern >> match. The original point related to number specialness was that "1 = 2" is >> not easily identifiable as a pattern match because there are no explicit >> constructors. The literal "1" here is neither an "explicit constructor" nor >> a binding symbol. > > > Yes, at this point you just have to know that the Report specifies a bunch > of special handling for numeric literals. > > > Also: "day" = "night" > > Isn't every "=" a pattern match? > Every "=" with a constructor on the LHS. String is also a special case similar to numeric literals. The above example should be equivalent to: 'd' : 'a' : 'y' : [] = "night" -harendra -------------- next part -------------- An HTML attachment was scrubbed... URL: From taeer at necsi.edu Fri Feb 24 07:08:25 2017 From: taeer at necsi.edu (Taeer Bar-Yam) Date: Fri, 24 Feb 2017 07:08:25 +0000 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> Message-ID: <1487919919-astroid-1-bx4gsfppam-4838@rebel> I think the usefulness of numeric / string literals as pattern matches is as part of larger matches (as someone mentioned), not by itself. But since (I assume) these things are defined recursively, it makes sense just to add it as a base-level pattern match. Furthermore, you would not want ``` main = let 1 = 2 in print "foo" ``` to error, since the pattern match is unused, and haskell is a lazy language. Really, though, we probably shouldn't be putting incomplete pattern matches in our code :P --Taeer From wbdehaas at gmail.com Fri Feb 24 10:33:36 2017 From: wbdehaas at gmail.com (Bas de Haas) Date: Fri, 24 Feb 2017 11:33:36 +0100 Subject: [Haskell-cafe] Working at Chordify? Working with Music. Coding in Haskell. Message-ID: Dear Haskellers, Chordify is hiring! Chordify is a young and fast growing music e-learning platform that helps musicians to play their favorite music. We automatically analyse the chords of a piece of music and display them in an intuitive player. Try it yourself at: https://chordify.net/ . The cool thing is: our backend has been written almost exclusively in Haskell. We hope to broaden our team with a researcher and a developer. We are looking for people who are pro-active, independent, and creative to improve Chordify. * We offer a digital signal processing researcher position in which you can prototype, evaluate, and deploy new algorithms that form the core of Chordify. * We also offer a (front-end) developer position in which you can improve the Chordify user experience, launch new ideas, write Haskell, and have thousands of users use your code every day. If you are interested in working at Chordify, you can find the details here: https://chordify.homerun.co/ All the best, Bas de Haas -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.vanhelden at gmail.com Fri Feb 24 11:11:06 2017 From: thomas.vanhelden at gmail.com (Thomas Vanhelden) Date: Fri, 24 Feb 2017 12:11:06 +0100 Subject: [Haskell-cafe] [Haskell-Cafe] Different memory profile in cabal project. Message-ID: <8DE08F54-1B68-44CD-8E57-2A513B9EC4F1@gmail.com> I have a (dummy) program that reads the contents of a file into a ByteString and then converts the ByteString to a Vector of Floats. To test the laziness of this program, I’ve taken a slice of the the Vector and printed it to the standard output. The program looks like this: import qualified Data.Vector.Unboxed as V import qualified Data.ByteString as BS import Data.Word import System.Environment import GHC.Int main = do [file] <- getArgs samples <- getSamplesFromFile file let slice = V.slice 0 50000 samples print slice getSamplesFromFile = fmap toVector . BS.readFile toVector :: BS.ByteString -> V.Vector Float toVector bs = vgenerate (fromIntegral (BS.length bs `div` 3)) $ \i -> myToFloat [BS.index bs (3*i), BS.index bs (3*i+1), BS.index bs (3*i+2)] where myToFloat :: [Word8] -> Float myToFloat = sum . map fromIntegral vgenerate n f = V.generate n (f . fromIntegral) So I compile this program and generate a memory profile via: ghc Main.hs -O2 -rtsopts -prof ./Main debug48.wav +RTS -hy hp2ps -e8in -c Main.hp ps2pdf Main.ps The file debug48.wav is a 12.9MB file. This is the result: If I now create a cabal project and add the exact same program as the main file by: mkdir testing cd testing cabal init add the program’s code to src/Main.hs add bytestring and vector to the build dependencies (in testing.cabal) add -O2 -rtsopts -prof to the ghc-options (in testing.cabal) cabal install testing debug48.wav +RTS -hy hp2ps -e8in -c testing.hp ps2pdf testing.ps This is the result: How can there be such a big difference in memory usage, just by the code being part of a cabal project? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2017-02-24 at 11.49.18.png Type: image/png Size: 101778 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2017-02-24 at 12.01.25.png Type: image/png Size: 90815 bytes Desc: not available URL: From olf at aatal-apotheke.de Fri Feb 24 12:17:52 2017 From: olf at aatal-apotheke.de (Olaf Klinke) Date: Fri, 24 Feb 2017 13:17:52 +0100 (CET) Subject: [Haskell-cafe] reading and writing Data.Ratio.Rational Message-ID: <150132315.26039.1487938673019@webmail.strato.de> Dear cafe, when processing text files containing numbers of the form "xxxx.yyyy" I used to parse them into Double using that type's Read instance. Obviously, even with arithmetic no more complicated than the field operations the result might have ugly rounding errors like 12.000000000002 due to the fact that numbers like 0.7 are not dyadic rationals. The math in my program is not complicated and the numbers are not large, so I don't care about Rationals having potentially huge memory footprints. So here's my question. A literal like 0.7 has type Fractional a => a, but the Read instance of Rational rejects the string "0.7". Must it be this way? Do I have to go via toRational.(read :: String -> Data.Scientific.Scientific)? Note that the documentation of Data.Scientific explicitly states that using (/) is unsafe, so I'd rather stay with the field Rational. For the output as decimal expansion, there is of course long division as described here [1], but I wonder whether either this exists in some library or there is even a more efficient solution. Any pointers are appreciated. Thanks, Olaf [1] http://stackoverflow.com/questions/30931369/how-to-convert-a-rational-into-a-pretty-string From alex at kazik.de Fri Feb 24 12:36:31 2017 From: alex at kazik.de (ALeX Kazik) Date: Fri, 24 Feb 2017 13:36:31 +0100 Subject: [Haskell-cafe] reading and writing Data.Ratio.Rational In-Reply-To: <150132315.26039.1487938673019@webmail.strato.de> References: <150132315.26039.1487938673019@webmail.strato.de> Message-ID: Hi, > So here's my question. A literal like 0.7 has type Fractional a => a, but the Read instance of Rational rejects the string "0.7". Must it be this way? Do I have to go via toRational.(read :: String -> Data.Scientific.Scientific)? You can only parse "7%10". ALeX. From chpatrick at gmail.com Fri Feb 24 14:35:41 2017 From: chpatrick at gmail.com (Patrick Chilton) Date: Fri, 24 Feb 2017 15:35:41 +0100 Subject: [Haskell-cafe] reading and writing Data.Ratio.Rational In-Reply-To: <150132315.26039.1487938673019@webmail.strato.de> References: <150132315.26039.1487938673019@webmail.strato.de> Message-ID: Prelude> import Numeric Prelude Numeric> fst $ head $ readFloat "0.1234" :: Rational 617 % 5000 On Fri, Feb 24, 2017 at 1:17 PM, Olaf Klinke wrote: > Dear cafe, > > when processing text files containing numbers of the form "xxxx.yyyy" I > used to parse them into Double using that type's Read instance. Obviously, > even with arithmetic no more complicated than the field operations the > result might have ugly rounding errors like 12.000000000002 due to the fact > that numbers like 0.7 are not dyadic rationals. The math in my program is > not complicated and the numbers are not large, so I don't care about > Rationals having potentially huge memory footprints. > > So here's my question. A literal like 0.7 has type Fractional a => a, but > the Read instance of Rational rejects the string "0.7". Must it be this > way? Do I have to go via toRational.(read :: String -> > Data.Scientific.Scientific)? > > Note that the documentation of Data.Scientific explicitly states that > using (/) is unsafe, so I'd rather stay with the field Rational. > > For the output as decimal expansion, there is of course long division as > described here [1], but I wonder whether either this exists in some library > or there is even a more efficient solution. > > Any pointers are appreciated. > Thanks, > Olaf > > [1] http://stackoverflow.com/questions/30931369/how-to- > convert-a-rational-into-a-pretty-string > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Fri Feb 24 23:23:34 2017 From: danburton.email at gmail.com (Dan Burton) Date: Fri, 24 Feb 2017 15:23:34 -0800 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: <1487919919-astroid-1-bx4gsfppam-4838@rebel> References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> <1487919919-astroid-1-bx4gsfppam-4838@rebel> Message-ID: Note that similar to the !Nothing example, a bang pattern surfaces the error you'd expect Prelude> :set -XBangPatterns Prelude> let !1 = 2 *** Exception: :2:5-10: Irrefutable pattern failed for pattern 1 So this exception is lurking about, but due to laziness and the equation's irrelevance, it doesn't show unless you force it with strictness. I think the real expectation mismatch here is that numbers are not bindable symbols, so `let 1 = expr in 1` does not rebind 1 to be `expr` like a beginner might think. -- Dan Burton On Thu, Feb 23, 2017 at 11:08 PM, Taeer Bar-Yam wrote: > I think the usefulness of numeric / string literals as pattern matches is > as > part of larger matches (as someone mentioned), not by itself. But since (I > assume) these things are defined recursively, it makes sense just to add > it as a > base-level pattern match. > > Furthermore, you would not want > ``` > main = let 1 = 2 in print "foo" > ``` > to error, since the pattern match is unused, and haskell is a lazy > language. > Really, though, we probably shouldn't be putting incomplete pattern > matches in > our code :P > > --Taeer > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.muranov at gmail.com Sat Feb 25 14:32:45 2017 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sat, 25 Feb 2017 06:32:45 -0800 (PST) Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: <02d39fa7-1e33-4b6c-a3c5-fba3df7c60e8@googlegroups.com> Just to link this to a previous discussion of this topic: https://groups.google.com/d/msg/haskell-cafe/2zpIvI0IBSc/MuHmTEUiswUJ Alexey. On Friday, February 24, 2017 at 3:06:16 AM UTC+1, Harendra Kumar wrote: > > Kids have this amazing ability to break any toy in minutes. I gave my > seven year old daughter ghci to play with and in a little while she said it > is broken: > > >> let 1 = 2 > > >> 1 > > 1 > > >> > > > Earlier, I had explained to her about symbols and assigning values to > symbols, and I said numbers are not symbols. But when she came up with this > I could not explain what's going on. How can "1 = 2" be a valid equation? > Am I missing something fundamental here, or it is just broken? > > > -harendra > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jhala at cs.ucsd.edu Sat Feb 25 15:20:26 2017 From: jhala at cs.ucsd.edu (Ranjit Jhala) Date: Sat, 25 Feb 2017 20:50:26 +0530 Subject: [Haskell-cafe] Postdoc at Inria/Irisa on translation validation from LiquidHaskell Message-ID: Hi all, Inria Project-team TEA is seeking a talented PhD with demonstrated experience in theory and implementation of refinement types in programming and automated verification and proof of programs. The aim of our post-doctoral project is to design a certified code generator from Liquid Haskell to verified, imperative and functional, compiler suites (CompCert, CakeML). We will start by initially focusing on first-order functions in the absence of dynamic memory management. In the spirit of Pnueli's translation validation principle, we will prove code generated from the code generator to obey program properties inferred from source programs, using refinement reflection. We will study extensions to hardware synthesis as well as dynamic memory management, higher-order functions, etc. For context, details, and application, please visit: https://www.inria.fr/ institut/recrutement-metiers/offres/post-doctorat/sejours- post-doctoraux/(view)/details.html?id=PGTFK026203F3VBQB6G68LONZ&LOV5 =4508&nPostingID=11123&nPostingTargetID=17708 -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.muranov at gmail.com Sat Feb 25 22:58:28 2017 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sat, 25 Feb 2017 14:58:28 -0800 (PST) Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: Message-ID: <9c9dd33c-a54d-4982-8527-d4feb59d92bd@googlegroups.com> It seems weird however that Haskell allows let 1 = 0 but does not allow let (f x, g y z) = (x*x, y*z) Alexey. On Friday, February 24, 2017 at 4:53:59 AM UTC+1, Brandon Allbery wrote: > > Without a binding it is useless at top level, but if you strictify the > pattern it can be useful in `let` (possibly as a sanity check where you > want the program to abort if it fails). I don't recall offhand if it > desugars usefully in list comprehensions, but if so it would work as a > filter. There may also be other specialized use cases; general syntax tends > to get reused a lot in Haskell, so making this case a syntax error could > make it difficult to support actually useful cases. :) > > (Also I'm sure someone overly clever could figure out some way to abuse > it. :) > > On Thu, Feb 23, 2017 at 10:41 PM, Harendra Kumar > wrote: > >> On 24 February 2017 at 08:45, Brandon Allbery > > wrote: >> >>> Literally the only use I've seen for this was a CCC puzzle. However, it >>> is the trivial case of something that is more useful: pattern matching the >>> result of an expression (say, a Data.Map.lookup when you know the key >>> exists). >>> >> >> Can you explain how that will be useful (without a binding)? Will the >> pattern match be ever actually tried when there is no binding? >> >> -harendra >> > > > > -- > brandon s allbery kf8nh sine nomine > associates > allb... at gmail.com > ball... at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david.feuer at gmail.com Sat Feb 25 23:23:37 2017 From: david.feuer at gmail.com (David Feuer) Date: Sat, 25 Feb 2017 18:23:37 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> Message-ID: I firmly believe that making pattern matches in let and where clauses lazy by default was a mistake in the Haskell Report. It's inconsistent with how pattern matching works elsewhere in the language, and also makes a strange distinction between outer and inner pattern matches. Unfortunately, it's way too late to fix that mistake. On Feb 24, 2017 12:09 AM, "Harendra Kumar" wrote: > CCing the list. I guess you intended to cc but forgot. > > On 24 February 2017 at 09:27, wrote: > >> In Erlang, the equivalent of a let fails. >> 1> 1=2. >> ** exception error: no match of right hand side value 2 >> >> In SML, the equivalent of a let fails. >> - val 1 = 1; >> - val 1 = 2; >> >> uncaught exception Bind [nonexhaustive binding failure] >> raised at: stdIn:2.5-2.10 >> >> The problem is not that let 1 = 2 ... is *legal* but that >> - the compiler is *silent* about it >> - the runtime is *silent* about it. >> Compiling the little program >> >> main = let 1 = 2 in print "hi" >> >> I expected that the compiler would be silent but that >> there would be some sort of "matched failed" error at >> run time. Silly me. >> >> >> The thing is, it is not just bindings that bind no variables >> that act as if they were not there. >> >> main = let [x] = [1,2] in print "hi" >> >> also compiles silently and runs without error. Change it to >> >> main = let [x] = [1,2] in print ("hi" ++ show x) >> >> and you get a runtime error >> >> : : Irrefutable pattern failed for pattern [x]. >> >> I wish the compiler would report an error something like >> >> ": possibly failing match deleted >> because it binds no live variables" >> >> >> >> > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexey.muranov at gmail.com Sun Feb 26 00:08:58 2017 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sat, 25 Feb 2017 16:08:58 -0800 (PST) Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> Message-ID: <8a18a645-401e-4cf3-9832-ce700a44b92e@googlegroups.com> Can be added to Nitpicks then :) : https://wiki.haskell.org/Nitpicks Alexey. On Sunday, February 26, 2017 at 12:25:17 AM UTC+1, David Feuer wrote: > > I firmly believe that making pattern matches in let and where clauses lazy > by default was a mistake in the Haskell Report. It's inconsistent with how > pattern matching works elsewhere in the language, and also makes a strange > distinction between outer and inner pattern matches. Unfortunately, it's > way too late to fix that mistake. > > On Feb 24, 2017 12:09 AM, "Harendra Kumar" > wrote: > >> CCing the list. I guess you intended to cc but forgot. >> >> On 24 February 2017 at 09:27, > wrote: >> >>> In Erlang, the equivalent of a let fails. >>> 1> 1=2. >>> ** exception error: no match of right hand side value 2 >>> >>> In SML, the equivalent of a let fails. >>> - val 1 = 1; >>> - val 1 = 2; >>> >>> uncaught exception Bind [nonexhaustive binding failure] >>> raised at: stdIn:2.5-2.10 >>> >>> The problem is not that let 1 = 2 ... is *legal* but that >>> - the compiler is *silent* about it >>> - the runtime is *silent* about it. >>> Compiling the little program >>> >>> main = let 1 = 2 in print "hi" >>> >>> I expected that the compiler would be silent but that >>> there would be some sort of "matched failed" error at >>> run time. Silly me. >>> >>> >>> The thing is, it is not just bindings that bind no variables >>> that act as if they were not there. >>> >>> main = let [x] = [1,2] in print "hi" >>> >>> also compiles silently and runs without error. Change it to >>> >>> main = let [x] = [1,2] in print ("hi" ++ show x) >>> >>> and you get a runtime error >>> >>> : : Irrefutable pattern failed for pattern [x]. >>> >>> I wish the compiler would report an error something like >>> >>> ": possibly failing match deleted >>> because it binds no live variables" >>> >>> >>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Sun Feb 26 03:28:20 2017 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Sun, 26 Feb 2017 14:28:20 +1100 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> Message-ID: On 26 February 2017 at 10:23, David Feuer wrote: > I firmly believe that making pattern matches in let and where clauses lazy > by default was a mistake in the Haskell Report. It's inconsistent with how > pattern matching works elsewhere in the language, and also makes a strange > distinction between outer and inner pattern matches. Unfortunately, it's way > too late to fix that mistake. I've used that though in combination of guards where I call the (lazily evaluated) result only in cases where it's irrefutable. > > On Feb 24, 2017 12:09 AM, "Harendra Kumar" wrote: >> >> CCing the list. I guess you intended to cc but forgot. >> >> On 24 February 2017 at 09:27, wrote: >>> >>> In Erlang, the equivalent of a let fails. >>> 1> 1=2. >>> ** exception error: no match of right hand side value 2 >>> >>> In SML, the equivalent of a let fails. >>> - val 1 = 1; >>> - val 1 = 2; >>> >>> uncaught exception Bind [nonexhaustive binding failure] >>> raised at: stdIn:2.5-2.10 >>> >>> The problem is not that let 1 = 2 ... is *legal* but that >>> - the compiler is *silent* about it >>> - the runtime is *silent* about it. >>> Compiling the little program >>> >>> main = let 1 = 2 in print "hi" >>> >>> I expected that the compiler would be silent but that >>> there would be some sort of "matched failed" error at >>> run time. Silly me. >>> >>> >>> The thing is, it is not just bindings that bind no variables >>> that act as if they were not there. >>> >>> main = let [x] = [1,2] in print "hi" >>> >>> also compiles silently and runs without error. Change it to >>> >>> main = let [x] = [1,2] in print ("hi" ++ show x) >>> >>> and you get a runtime error >>> >>> : : Irrefutable pattern failed for pattern [x]. >>> >>> I wish the compiler would report an error something like >>> >>> ": possibly failing match deleted >>> because it binds no live variables" >>> >>> >>> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From david.feuer at gmail.com Sun Feb 26 04:43:22 2017 From: david.feuer at gmail.com (David Feuer) Date: Sat, 25 Feb 2017 23:43:22 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> Message-ID: Yes, lazy patterns are useful. That's what we have the ~ syntax for! You can always write where ~(a, b) = .... or whatever. I think a bang is good for a strict non-pattern binding, like where !a = .... because that's the unusual case, but I think it's bad for a strict pattern binding, which is the *usual* case. On Sat, Feb 25, 2017 at 10:28 PM, Ivan Lazar Miljenovic wrote: > On 26 February 2017 at 10:23, David Feuer wrote: >> I firmly believe that making pattern matches in let and where clauses lazy >> by default was a mistake in the Haskell Report. It's inconsistent with how >> pattern matching works elsewhere in the language, and also makes a strange >> distinction between outer and inner pattern matches. Unfortunately, it's way >> too late to fix that mistake. > > I've used that though in combination of guards where I call the > (lazily evaluated) result only in cases where it's irrefutable. > >> >> On Feb 24, 2017 12:09 AM, "Harendra Kumar" wrote: >>> >>> CCing the list. I guess you intended to cc but forgot. >>> >>> On 24 February 2017 at 09:27, wrote: >>>> >>>> In Erlang, the equivalent of a let fails. >>>> 1> 1=2. >>>> ** exception error: no match of right hand side value 2 >>>> >>>> In SML, the equivalent of a let fails. >>>> - val 1 = 1; >>>> - val 1 = 2; >>>> >>>> uncaught exception Bind [nonexhaustive binding failure] >>>> raised at: stdIn:2.5-2.10 >>>> >>>> The problem is not that let 1 = 2 ... is *legal* but that >>>> - the compiler is *silent* about it >>>> - the runtime is *silent* about it. >>>> Compiling the little program >>>> >>>> main = let 1 = 2 in print "hi" >>>> >>>> I expected that the compiler would be silent but that >>>> there would be some sort of "matched failed" error at >>>> run time. Silly me. >>>> >>>> >>>> The thing is, it is not just bindings that bind no variables >>>> that act as if they were not there. >>>> >>>> main = let [x] = [1,2] in print "hi" >>>> >>>> also compiles silently and runs without error. Change it to >>>> >>>> main = let [x] = [1,2] in print ("hi" ++ show x) >>>> >>>> and you get a runtime error >>>> >>>> : : Irrefutable pattern failed for pattern [x]. >>>> >>>> I wish the compiler would report an error something like >>>> >>>> ": possibly failing match deleted >>>> because it binds no live variables" >>>> >>>> >>>> >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> To (un)subscribe, modify options or view archives go to: >>> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >>> Only members subscribed via the mailman list are allowed to post. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. > > > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com From chneukirchen at gmail.com Sun Feb 26 11:27:22 2017 From: chneukirchen at gmail.com (Christian Neukirchen) Date: Sun, 26 Feb 2017 12:27:22 +0100 Subject: [Haskell-cafe] Munich Haskell Meeting, 2017-02-28 @ 19:30 Message-ID: <874lzhgpk5.fsf@gmail.com> Dear all, Next week, our monthly Munich Haskell Meeting will take place again on Tuesday, Feburary 28 at Augustiner-Gaststätte Rumpler at 19h30. For details see here: http://muenchen.haskell.bayern/dates.html The location is carnival-free. If you plan to join, please add yourself to this dudle so we can reserve enough seats! It is OK to add yourself to the dudle anonymously or pseudonymously. https://dudle.inf.tu-dresden.de/haskell-munich-feb-2017/ Everybody is welcome! cu, -- Christian Neukirchen http://chneukirchen.org From ok at cs.otago.ac.nz Sun Feb 26 23:34:20 2017 From: ok at cs.otago.ac.nz (ok at cs.otago.ac.nz) Date: Mon, 27 Feb 2017 12:34:20 +1300 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: <1487919919-astroid-1-bx4gsfppam-4838@rebel> References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> <1487919919-astroid-1-bx4gsfppam-4838@rebel> Message-ID: <7b2c7203e80b48a615bf7f2251a72b2b.squirrel@chasm.otago.ac.nz> > > Furthermore, you would not want > ``` > main = let 1 = 2 in print "foo" > ``` > to error, since the pattern match is unused, and haskell is a lazy > language. That's not at all clear. In fact, I believe this thread exists because the OP's daughter expected that it WOULD raise an error. For what it's worth, Start = let 1 = 2 in "hello" is rejected by the Clean compiler, even though Clean is much like Haskell, and 1 is otherwise allowed as a pattern. If nothing else, it would be nice to have a "dead code" warning from the compiler about code that is certain not to be evaluated. "2" counts as dead code in this example. From allbery.b at gmail.com Sun Feb 26 23:36:05 2017 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 26 Feb 2017 18:36:05 -0500 Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: <7b2c7203e80b48a615bf7f2251a72b2b.squirrel@chasm.otago.ac.nz> References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> <1487919919-astroid-1-bx4gsfppam-4838@rebel> <7b2c7203e80b48a615bf7f2251a72b2b.squirrel@chasm.otago.ac.nz> Message-ID: On Sun, Feb 26, 2017 at 6:34 PM, wrote: > If nothing else, it would be nice to have a "dead code" warning > from the compiler about code that is certain not to be evaluated. > "2" counts as dead code in this example. > I did point out that -Wall includes a warning for this earlier... and "dead code" warnings in most compilers require optimization. -- 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 alexey.muranov at gmail.com Mon Feb 27 06:51:29 2017 From: alexey.muranov at gmail.com (Alexey Muranov) Date: Sun, 26 Feb 2017 22:51:29 -0800 (PST) Subject: [Haskell-cafe] What does "1 = 2" mean in Haskell? In-Reply-To: <7b2c7203e80b48a615bf7f2251a72b2b.squirrel@chasm.otago.ac.nz> References: <58e7a6d25d1f1fa46d7a6345bdab68e9.squirrel@chasm.otago.ac.nz> <1487919919-astroid-1-bx4gsfppam-4838@rebel> <7b2c7203e80b48a615bf7f2251a72b2b.squirrel@chasm.otago.ac.nz> Message-ID: <4b07c138-02f9-4a04-b76a-fecf511e9bb4@googlegroups.com> On Monday, February 27, 2017 at 12:35:26 AM UTC+1, o... at cs.otago.ac.nz wrote: > > > > > Furthermore, you would not want > > ``` > > main = let 1 = 2 in print "foo" > > ``` > > to error, since the pattern match is unused, and haskell is a lazy > > language. > > That's not at all clear. In fact, I believe this thread exists > because the OP's daughter expected that it WOULD raise an error. > I think i agree with this. IMO it should raise an error as well as (\1 -> "hello") 2 does. Alexey. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tobias.grosser at inf.ethz.ch Mon Feb 27 11:19:06 2017 From: tobias.grosser at inf.ethz.ch (Tobias Grosser) Date: Mon, 27 Feb 2017 12:19:06 +0100 Subject: [Haskell-cafe] ECOOP/PLDI 2017 in Barcelona / Call for Student Participation Message-ID: <1488194346.497100.894025008.35510DE9@webmail.messagingengine.com> ECOOP/PLDI 2017 in Barcelona / Call for Student Participation http://conf.researchr.org/home/pldi-ecoop-2017 Interested in hearing the latest about Scala, Perl, Clojure, Rust, Swift, JavaScript, and many many other languages and systems? Curious about new ideas such as gradual types, JIT compilers for dynamic languages, differential privacy or deep learning? Always wanted to talk about computer science face to face with senior researchers and practitioners? Let’s come to share, challenge and complement your views! Join us in Barcelona from Sunday 18 to Friday 23 June 2017 The ECOOP/PLDI conferences offers support to students and professionals interested in attending. To apply: application form # Bachelor, Master, and early Doctoral Students The ECOOP Summer School provides an easy introduction to the world of research in programming languages. No background is required other than an interest in languages technologies. Info: http://2017.ecoop.org/track/ecoop-2017-Summer-School # Doctoral Students The Doctoral Symposium is designed to provide a forum for PhD students at any stage in their research to present their topic and get detailed feedback and advice. The main objectives of this event are: to allow PhD students to practise writing clearly and to communicate and present their research effectively to receive constructive feedback from other researchers and peers to offer opportunities to form research collaborations to contribute to the conference goals through interaction with other researchers at the main conference Info: http://2017.ecoop.org/track/ecoop-2017-Doctoral-Symposium # All Students Register to be Student Volunteers, help with the organization of the conference, get a free registration and a ticket for one of the banquets. This year PLDI and ECOOP are co-located. Student Volunteers can attend events from both conferences and might be working for either. Preference can be stated in the application form. Info: http://2017.ecoop.org/track/ecoop-2017-Student-Volunteers#About From gershomb at gmail.com Mon Feb 27 21:21:21 2017 From: gershomb at gmail.com (Gershom B) Date: Mon, 27 Feb 2017 16:21:21 -0500 Subject: [Haskell-cafe] Call For Presentations: Compose 2017, New York, May 18-19 Message-ID: Compose is a conference for typed functional programmers, focused specifically on Haskell, OCaml, F#, SML, and related technologies. It will be held in New York on Thursday and Friday, May 18-19, 2017. Registration will be open shortly. http://www.composeconference.org/2017 To get a sense of Compose, you can check out the great talks from past conferences: https://www.youtube.com/channel/UC0pEknZxL7Q1j0Ok8qImWdQ Below is our call for presentations. We recognize the deadline is tight, so feel free to submit proposals and ideas on the less-polished side. http://www.composeconference.org/2016/cfp/ *** The audience for Compose is Haskell, OCaml, F#, or SML developers who are looking to increase their skills or learn new technologies and libraries. Presentations should be aimed at teaching or introducing new ideas or tools. We are also interested in presentations aiming at taking complex concepts, such as program derivation, and putting them into productive use. However proposals on anything that you suspect our audience may find interesting are welcome. The following are some of the types of talks we would welcome: Library/Tool Talks — Exploring the uses of a powerful toolkit or library, be it for parsing, testing, data access and analysis, or anything else. Production Systems — Experience reports on deploying functional techniques in real systems; insights revealed, mistakes made, lessons learned. Theory made Practical — Just because it’s locked away in papers doesn’t mean it’s hard! Accessible lectures on classic results and why they matter to us today. Such talks can include simply introducing the principles of a field of research so as to help the audience read up on it in the future; from abstract machines to program derivation to branch-and-bound algorithms, the sky’s the limit. We also welcome proposals for more formal tutorials. Tutorials should be aimed at a smaller audience of beginner-to-novice understanding, and ideally include hands-on exercises. The due date for submissions is March 23, 2017. We will send out notice of acceptance by March 30th. We prefer that submissions be via the EasyChair website (https://easychair.org/conferences/?conf=compose2017). Please suggest a title, and describe the topic you intend to speak on. Talks can be either 30 or 45 minutes, please indicate how much time you would prefer to take. Additional information may be included on both your expertise and the interesting elements of your topic, going on what might be included in a public abstract. Furthermore, if your abstract doesn't feel "final"—don't worry! We'll work with you to polish it up. If you want to discuss your proposal(s) before submitting, or to further nail down what you intend to speak on, please feel free to contact us at info at composeconference.org. We're happy to work with you, even if you are a new or inexperienced speaker, to help your talk be great. *** Diversity We would like to put an emphasis on soliciting a diverse set of speakers - anything you can do to distribute information about this CFP and encourage submissions from under-represented groups would be greatly appreciated. We welcome your contributions and encourage you to apply! Best, Gershom From gurudev.devanla at gmail.com Tue Feb 28 00:48:31 2017 From: gurudev.devanla at gmail.com (Guru Devanla) Date: Mon, 27 Feb 2017 16:48:31 -0800 Subject: [Haskell-cafe] Declaring Functors for Type constrained data types Message-ID: Hello All, I am working on a program that will define a bunch of tasks. Each task will have to implement certain methods as part of a type class. -- task 1 data UpdateAcctsTask = UpdateAccts -- task 2 data EmailConfig = EmaiConfig {someattrs::String} data SendEmailTask = SendEmailsTask EmailConfig -- task 3 data GeneralWriterTask a = GeneralWriterTask a Each of these tasks implement a class, Taskable. The return values are simplified for this example. class Taskable a where process :: a -> Bool can_run :: a -> Bool This works fine. I can expand on these tasks and execute them. Now, I wanted to be able to defined dependencies between these (Taskable's). I decided I could create a data type for this dependency and may be also get a FreeMonad around this structure for further processing using a graph of Tasks. But, before that I wanted to create an wrapper for these Taskables and create a functor for it as follows The first thing I did was, define a Task, which generalizes over all the above defined (and future Taskables) data Task a where Task :: (Taskable a) => a -> Task a instance Functor Task where fmap:: (Taskable a, Taskable b) -> (a -> b) -> Task a -> Task b --- THIS DOES NOT WORK fmap f (Task a) = Task $ f a But, I realized that I cannot define an fmap over a type constraint. My questions are: 1. Is there any way to do this. I see there is an answer of SO. I wanted to make sure if there were any improvements to this since that answer' was posted. http://stackoverflow.com/questions/17157579/functor-instance-for-a-gadt-with-type-constraint 2. Secondly, I would like to know why this is not possible. Is it a current limitation of GHC or if there is some fundamental category theory concepts that dis-allows such declarations that I need to grok! Appreciate any help on this. Thank you! -------------- next part -------------- An HTML attachment was scrubbed... URL: From will.yager at gmail.com Tue Feb 28 02:02:16 2017 From: will.yager at gmail.com (Will Yager) Date: Mon, 27 Feb 2017 20:02:16 -0600 Subject: [Haskell-cafe] Declaring Functors for Type constrained data types In-Reply-To: References: Message-ID: 1. You could use MonoFunctor (complicated and probably not a good idea here) or just put the Taskable constraint on functions instead of on the Task definition (good and easy). So it would be data Task a = Task a deriving Functor And then put "Taskable a" on functions that require it. 2. You can't do it because it doesn't really make sense. A big part of a functor is that it has to be totally agnostic of what it's parametrized over. Otherwise you could easily violate the functor laws. Good question though, I used to wonder the same thing. cheers, Will > On Feb 27, 2017, at 6:48 PM, Guru Devanla wrote: > > Hello All, > > I am working on a program that will define a bunch of tasks. Each task > will have to implement certain methods as part of a type class. > > -- task 1 > data UpdateAcctsTask = UpdateAccts > > -- task 2 > data EmailConfig = EmaiConfig {someattrs::String} > data SendEmailTask = SendEmailsTask EmailConfig > > -- task 3 > data GeneralWriterTask a = GeneralWriterTask a > > Each of these tasks implement a class, Taskable. The return > values are simplified for this example. > > class Taskable a where > process :: a -> Bool > can_run :: a -> Bool > > > This works fine. I can expand on these tasks and execute them. > > Now, I wanted to be able to defined dependencies between these (Taskable's). I decided > I could create a data type for this dependency and may be also get a FreeMonad > around this structure for further processing using a graph of Tasks. But, before that I wanted > to create an wrapper for these Taskables and create a functor for it as follows > > The first thing I did was, define a Task, which generalizes over all > the above defined (and future Taskables) > > data Task a where > Task :: (Taskable a) => a -> Task a > > > instance Functor Task where > fmap:: (Taskable a, Taskable b) -> (a -> b) -> Task a -> Task b --- THIS DOES NOT WORK > fmap f (Task a) = Task $ f a > > > But, I realized that I cannot define an fmap over a type constraint. > > My questions are: > > 1. Is there any way to do this. I see there is an answer of SO. I wanted > to make sure if there were any improvements to this since that answer' > was posted. > http://stackoverflow.com/questions/17157579/functor-instance-for-a-gadt-with-type-constraint > > 2. Secondly, I would like to know why this is not possible. Is it a current > limitation of GHC or if there is some fundamental category theory concepts > that dis-allows such declarations that I need to grok! > > Appreciate any help on this. Thank you! > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gurudev.devanla at gmail.com Tue Feb 28 03:01:14 2017 From: gurudev.devanla at gmail.com (Guru Devanla) Date: Mon, 27 Feb 2017 19:01:14 -0800 Subject: [Haskell-cafe] Declaring Functors for Type constrained data types In-Reply-To: References: Message-ID: Thanks, Will. I think adding the constraint to the functions is a good idea. Plus, it makes the intent clearer at the function level. On Mon, Feb 27, 2017 at 6:02 PM, Will Yager wrote: > 1. You could use MonoFunctor (complicated and probably not a good idea > here) or just put the Taskable constraint on functions instead of on the > Task definition (good and easy). > > So it would be > > data Task a = Task a deriving Functor > > And then put "Taskable a" on functions that require it. > > 2. You can't do it because it doesn't really make sense. A big part of a > functor is that it has to be totally agnostic of what it's parametrized > over. Otherwise you could easily violate the functor laws. > > Good question though, I used to wonder the same thing. > > cheers, > Will > > On Feb 27, 2017, at 6:48 PM, Guru Devanla > wrote: > > Hello All, > > I am working on a program that will define a bunch of tasks. Each task > will have to implement certain methods as part of a type class. > > -- task 1 > data UpdateAcctsTask = UpdateAccts > > -- task 2 > data EmailConfig = EmaiConfig {someattrs::String} > data SendEmailTask = SendEmailsTask EmailConfig > > -- task 3 > data GeneralWriterTask a = GeneralWriterTask a > > Each of these tasks implement a class, Taskable. The return > values are simplified for this example. > > class Taskable a where > process :: a -> Bool > can_run :: a -> Bool > > > This works fine. I can expand on these tasks and execute them. > > Now, I wanted to be able to defined dependencies between these > (Taskable's). I decided > I could create a data type for this dependency and may be also get a > FreeMonad > around this structure for further processing using a graph of Tasks. But, > before that I wanted > to create an wrapper for these Taskables and create a functor for it as > follows > > The first thing I did was, define a Task, which generalizes over all > the above defined (and future Taskables) > > data Task a where > Task :: (Taskable a) => a -> Task a > > > instance Functor Task where > fmap:: (Taskable a, Taskable b) -> (a -> b) -> Task a -> Task b --- > THIS DOES NOT WORK > fmap f (Task a) = Task $ f a > > > But, I realized that I cannot define an fmap over a type constraint. > > My questions are: > > 1. Is there any way to do this. I see there is an answer of SO. I wanted > to make sure if there were any improvements to this since that answer' > was posted. > http://stackoverflow.com/questions/17157579/functor- > instance-for-a-gadt-with-type-constraint > > 2. Secondly, I would like to know why this is not possible. Is it a current > limitation of GHC or if there is some fundamental category theory > concepts > that dis-allows such declarations that I need to grok! > > Appreciate any help on this. Thank you! > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From clintonmead at gmail.com Tue Feb 28 04:07:16 2017 From: clintonmead at gmail.com (Clinton Mead) Date: Tue, 28 Feb 2017 15:07:16 +1100 Subject: [Haskell-cafe] Declaring Functors for Type constrained data types In-Reply-To: References: Message-ID: I've done a bit of work on a library that allows you to `fmap` say over sets, (i.e. fmap :: Ord a, Ord b => (a -> b) -> Set a -> Set b) which is more powerful than Monofunctor as it doesn't require the types to be the same. And it will involve importing a new version of "Functor" and "fmap", however it should be largely backwards compatible. However, it still needs a little bit of work to be in a state ready to be uploaded to Hackage (and even then, it probably needs even more work) but I'll give you a buzz when its up, hopefully in the next week or so. On Tue, Feb 28, 2017 at 2:01 PM, Guru Devanla wrote: > Thanks, Will. I think adding the constraint to the functions is a good > idea. Plus, it makes the intent clearer at the function level. > > > > On Mon, Feb 27, 2017 at 6:02 PM, Will Yager wrote: > >> 1. You could use MonoFunctor (complicated and probably not a good idea >> here) or just put the Taskable constraint on functions instead of on the >> Task definition (good and easy). >> >> So it would be >> >> data Task a = Task a deriving Functor >> >> And then put "Taskable a" on functions that require it. >> >> 2. You can't do it because it doesn't really make sense. A big part of a >> functor is that it has to be totally agnostic of what it's parametrized >> over. Otherwise you could easily violate the functor laws. >> >> Good question though, I used to wonder the same thing. >> >> cheers, >> Will >> >> On Feb 27, 2017, at 6:48 PM, Guru Devanla >> wrote: >> >> Hello All, >> >> I am working on a program that will define a bunch of tasks. Each task >> will have to implement certain methods as part of a type class. >> >> -- task 1 >> data UpdateAcctsTask = UpdateAccts >> >> -- task 2 >> data EmailConfig = EmaiConfig {someattrs::String} >> data SendEmailTask = SendEmailsTask EmailConfig >> >> -- task 3 >> data GeneralWriterTask a = GeneralWriterTask a >> >> Each of these tasks implement a class, Taskable. The return >> values are simplified for this example. >> >> class Taskable a where >> process :: a -> Bool >> can_run :: a -> Bool >> >> >> This works fine. I can expand on these tasks and execute them. >> >> Now, I wanted to be able to defined dependencies between these >> (Taskable's). I decided >> I could create a data type for this dependency and may be also get a >> FreeMonad >> around this structure for further processing using a graph of Tasks. But, >> before that I wanted >> to create an wrapper for these Taskables and create a functor for it as >> follows >> >> The first thing I did was, define a Task, which generalizes over all >> the above defined (and future Taskables) >> >> data Task a where >> Task :: (Taskable a) => a -> Task a >> >> >> instance Functor Task where >> fmap:: (Taskable a, Taskable b) -> (a -> b) -> Task a -> Task b --- >> THIS DOES NOT WORK >> fmap f (Task a) = Task $ f a >> >> >> But, I realized that I cannot define an fmap over a type constraint. >> >> My questions are: >> >> 1. Is there any way to do this. I see there is an answer of SO. I wanted >> to make sure if there were any improvements to this since that answer' >> was posted. >> http://stackoverflow.com/questions/17157579/functor-instance >> -for-a-gadt-with-type-constraint >> >> 2. Secondly, I would like to know why this is not possible. Is it a >> current >> limitation of GHC or if there is some fundamental category theory >> concepts >> that dis-allows such declarations that I need to grok! >> >> Appreciate any help on this. Thank you! >> >> _______________________________________________ >> Haskell-Cafe mailing list >> To (un)subscribe, modify options or view archives go to: >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe >> Only members subscribed via the mailman list are allowed to post. >> >> > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jan.bracker at googlemail.com Tue Feb 28 16:46:49 2017 From: jan.bracker at googlemail.com (Jan Bracker) Date: Tue, 28 Feb 2017 16:46:49 +0000 Subject: [Haskell-cafe] Declaring Functors for Type constrained data types Message-ID: Hi, As mentioned before there are several ways of doing this. 1. Constrain the functions working with your types keeping the type itself unconstrained. 2. Write/Use a replacement for the Functor class that allows you to do this. This will usually involve associated type synonyms or functional dependencies. In my own work [1] I use associated type synonyms to do this. But there are other libraries that wrote similar replacements for the Functor class [2,3 and probably some more]. So if you want to use these you fill have to swap out the Functor (Applicative and Monad) hierarchy with another one that supports constraints. So this is definitly possible and no limitation of GHC. The standard library just does not allow it. Categorically a standard functor goes from the category Hask to Hask. A restricted or constrained functor can be seen as a functor that goes from a category C (Hask with the constraints) to Hask together with an injective functor that embeds C in a subcategory of Hask (which allows you to use it in Haskell). Best, Jan [1]: http://hackage.haskell.org/package/supermonad-0.1/docs/Control-Supermonad-Constrained-Functor.html [2]: https://hackage.haskell.org/package/rmonad-0.8.0.2/docs/Control-RMonad.html#t:RFunctor [3]: http://hackage.haskell.org/package/constrained-monads-0.1.0.0/docs/Control-Monad-Constrained.html#t:Functor 2017-02-28 12:00 GMT+00:00 : > I've done a bit of work on a library that allows you to `fmap` say over > sets, (i.e. fmap :: Ord a, Ord b => (a -> b) -> Set a -> Set b) which is > more powerful than Monofunctor as it doesn't require the types to be the > same. > > And it will involve importing a new version of "Functor" and "fmap", > however it should be largely backwards compatible. > > However, it still needs a little bit of work to be in a state ready to be > uploaded to Hackage (and even then, it probably needs even more work) but > I'll give you a buzz when its up, hopefully in the next week or so. > > On Tue, Feb 28, 2017 at 2:01 PM, Guru Devanla > wrote: > > > Thanks, Will. I think adding the constraint to the functions is a good > > idea. Plus, it makes the intent clearer at the function level. > > > > > > > > On Mon, Feb 27, 2017 at 6:02 PM, Will Yager > wrote: > > > >> 1. You could use MonoFunctor (complicated and probably not a good idea > >> here) or just put the Taskable constraint on functions instead of on the > >> Task definition (good and easy). > >> > >> So it would be > >> > >> data Task a = Task a deriving Functor > >> > >> And then put "Taskable a" on functions that require it. > >> > >> 2. You can't do it because it doesn't really make sense. A big part of a > >> functor is that it has to be totally agnostic of what it's parametrized > >> over. Otherwise you could easily violate the functor laws. > >> > >> Good question though, I used to wonder the same thing. > >> > >> cheers, > >> Will > >> > >> On Feb 27, 2017, at 6:48 PM, Guru Devanla > >> wrote: > >> > >> Hello All, > >> > >> I am working on a program that will define a bunch of tasks. Each task > >> will have to implement certain methods as part of a type class. > >> > >> -- task 1 > >> data UpdateAcctsTask = UpdateAccts > >> > >> -- task 2 > >> data EmailConfig = EmaiConfig {someattrs::String} > >> data SendEmailTask = SendEmailsTask EmailConfig > >> > >> -- task 3 > >> data GeneralWriterTask a = GeneralWriterTask a > >> > >> Each of these tasks implement a class, Taskable. The return > >> values are simplified for this example. > >> > >> class Taskable a where > >> process :: a -> Bool > >> can_run :: a -> Bool > >> > >> > >> This works fine. I can expand on these tasks and execute them. > >> > >> Now, I wanted to be able to defined dependencies between these > >> (Taskable's). I decided > >> I could create a data type for this dependency and may be also get a > >> FreeMonad > >> around this structure for further processing using a graph of Tasks. > But, > >> before that I wanted > >> to create an wrapper for these Taskables and create a functor for it as > >> follows > >> > >> The first thing I did was, define a Task, which generalizes over all > >> the above defined (and future Taskables) > >> > >> data Task a where > >> Task :: (Taskable a) => a -> Task a > >> > >> > >> instance Functor Task where > >> fmap:: (Taskable a, Taskable b) -> (a -> b) -> Task a -> Task b > --- > >> THIS DOES NOT WORK > >> fmap f (Task a) = Task $ f a > >> > >> > >> But, I realized that I cannot define an fmap over a type constraint. > >> > >> My questions are: > >> > >> 1. Is there any way to do this. I see there is an answer of SO. I wanted > >> to make sure if there were any improvements to this since that > answer' > >> was posted. > >> http://stackoverflow.com/questions/17157579/functor-instance > >> -for-a-gadt-with-type-constraint > >> > >> 2. Secondly, I would like to know why this is not possible. Is it a > >> current > >> limitation of GHC or if there is some fundamental category theory > >> concepts > >> that dis-allows such declarations that I need to grok! > >> > >> Appreciate any help on this. Thank you! > >> > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> To (un)subscribe, modify options or view archives go to: > >> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > >> Only members subscribed via the mailman list are allowed to post. > >> > >> > > > > _______________________________________________ > > Haskell-Cafe mailing list > > To (un)subscribe, modify options or view archives go to: > > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > Only members subscribed via the mailman list are allowed to post. > > > -------------- next part -------------- > An HTML attachment was scrubbed... > URL: attachments/20170228/0d255034/attachment-0001.html> > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > > > ------------------------------ > > End of Haskell-Cafe Digest, Vol 162, Issue 33 > ********************************************* > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chrisdone at gmail.com Tue Feb 28 17:18:27 2017 From: chrisdone at gmail.com (Christopher Done) Date: Tue, 28 Feb 2017 17:18:27 +0000 Subject: [Haskell-cafe] Looking for maintainers or comaintainers on my Haskell projects Message-ID: Hi all, The short version is: I’ve been battling RSI in my fingers for some years. I’m doing various things to mitigate that problem, but I have very limited finger bandwidth these days; enough to work at my usual pace at my job, but not much in the evenings and weekends, and so I can’t manage to do much on my hobby projects. I’m also not as motivated these days to work on my set of open source projects, and am turning my attention to different things. It’s not great, but that’s life. I don’t think that the users of my packages are getting the best maintainership deal. Rather than be “the absentee maintainer”, I’d prefer a straight-forward transition of maintainership or ownership to someone who can put the right energy and time in. In terms of packages, there are really two that have a significant maintenance burden and users aren’t being served very well: - HIndent has a significant amount of issues opened for it regularly, and many of them require discussion and debate. If someone would like to become a co-maintainer, let me know. It may (eventually) make sense to move it to a more general GitHub organization like commercialhaskell or haskell. - Intero , which seems to have been a success, has a pretty big maintenance burden on “this doesn’t work” kind of issues which require investigation. There’s some Emacs Lisp work to do on it, and some Haskell work on the intero binary, and a whole lot of platform-specific problems or tooling not working together. On the other hand people really like this project, and there’s a lot of tooling potential. If you want to take xeno and make it into a publishable package, please do so. The rest of my projects that are on Stackage are: labels , ace , ical , check-email , freenect , frisby , gd , ini , lucid , osdkeys , pdfinfo , present , pure-io , scrobble , shell-conduit , sourcemap , descriptive , wrap , path , weigh , haskell-docs , and structured-haskell-mode . If you’re interested in taking over or co-maintaining any of them, let me know. Some are interesting, others are boring, some are trivial. I have other packages on Hackage, but they’re mostly dead or experiments that don’t need maintenance anyway. I’ve started the process of adding or changing maintainers on my public services: - Haskell News is now a GitHub organization. Luke Murphy is a co-owner, and has full access to the DigitalOcean account that is running the service. So if you want to work on that project, I’m not in the way. - lpaste has been moved to its own DigitalOcean account too. If anyone is interested in taking over the project or co-running it, let me know. - tryhaskell doesn’t really require any maintenance, but it’s also on its own DigitalOcean account now too. - IRCBrowse is now on its own DigitalOcean account too. It requires maintenance once in a while. If anyone is interested in taking over the project or co-running it, let me know. Cheers! ​ -------------- next part -------------- An HTML attachment was scrubbed... URL: From chpatrick at gmail.com Tue Feb 28 17:55:22 2017 From: chpatrick at gmail.com (Patrick Chilton) Date: Tue, 28 Feb 2017 18:55:22 +0100 Subject: [Haskell-cafe] Declaring Functors for Type constrained data types In-Reply-To: References: Message-ID: You could also consider representing tasks like this instead of using a typeclass: data Task = Task { process :: m () , canRun :: m Bool } The Taskable + existential GADT example seems like it could be an example of the existential antipattern . If your GADT really does have a as a type parameter, it would be more idiomatic to check for the typeclass when you use it: doStuffWithTasks :: Taskable a => Task a -> ... But then what's the point of the Task datatype? On Tue, Feb 28, 2017 at 1:48 AM, Guru Devanla wrote: > Hello All, > > I am working on a program that will define a bunch of tasks. Each task > will have to implement certain methods as part of a type class. > > -- task 1 > data UpdateAcctsTask = UpdateAccts > > -- task 2 > data EmailConfig = EmaiConfig {someattrs::String} > data SendEmailTask = SendEmailsTask EmailConfig > > -- task 3 > data GeneralWriterTask a = GeneralWriterTask a > > Each of these tasks implement a class, Taskable. The return > values are simplified for this example. > > class Taskable a where > process :: a -> Bool > can_run :: a -> Bool > > > This works fine. I can expand on these tasks and execute them. > > Now, I wanted to be able to defined dependencies between these > (Taskable's). I decided > I could create a data type for this dependency and may be also get a > FreeMonad > around this structure for further processing using a graph of Tasks. But, > before that I wanted > to create an wrapper for these Taskables and create a functor for it as > follows > > The first thing I did was, define a Task, which generalizes over all > the above defined (and future Taskables) > > data Task a where > Task :: (Taskable a) => a -> Task a > > > instance Functor Task where > fmap:: (Taskable a, Taskable b) -> (a -> b) -> Task a -> Task b --- > THIS DOES NOT WORK > fmap f (Task a) = Task $ f a > > > But, I realized that I cannot define an fmap over a type constraint. > > My questions are: > > 1. Is there any way to do this. I see there is an answer of SO. I wanted > to make sure if there were any improvements to this since that answer' > was posted. > http://stackoverflow.com/questions/17157579/functor- > instance-for-a-gadt-with-type-constraint > > 2. Secondly, I would like to know why this is not possible. Is it a current > limitation of GHC or if there is some fundamental category theory > concepts > that dis-allows such declarations that I need to grok! > > Appreciate any help on this. Thank you! > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joehillen at gmail.com Tue Feb 28 18:17:33 2017 From: joehillen at gmail.com (Joe Hillenbrand) Date: Tue, 28 Feb 2017 10:17:33 -0800 Subject: [Haskell-cafe] Looking for maintainers or comaintainers on my Haskell projects In-Reply-To: References: Message-ID: I'm interested in co-maintaining path and ini On Tue, Feb 28, 2017 at 9:18 AM, Christopher Done wrote: > Hi all, > > The short version is: I’ve been battling RSI in my fingers for some years. > I’m doing various things to mitigate that problem, but I have very limited > finger bandwidth these days; enough to work at my usual pace at my job, but > not much in the evenings and weekends, and so I can’t manage to do much on > my hobby projects. I’m also not as motivated these days to work on my set of > open source projects, and am turning my attention to different things. It’s > not great, but that’s life. > > I don’t think that the users of my packages are getting the best > maintainership deal. Rather than be “the absentee maintainer”, I’d prefer a > straight-forward transition of maintainership or ownership to someone who > can put the right energy and time in. > > In terms of packages, there are really two that have a significant > maintenance burden and users aren’t being served very well: > > HIndent has a significant amount of issues opened for it regularly, and many > of them require discussion and debate. If someone would like to become a > co-maintainer, let me know. It may (eventually) make sense to move it to a > more general GitHub organization like commercialhaskell or haskell. > Intero, which seems to have been a success, has a pretty big maintenance > burden on “this doesn’t work” kind of issues which require investigation. > There’s some Emacs Lisp work to do on it, and some Haskell work on the > intero binary, and a whole lot of platform-specific problems or tooling not > working together. On the other hand people really like this project, and > there’s a lot of tooling potential. > > If you want to take xeno and make it into a publishable package, please do > so. > > The rest of my projects that are on Stackage are: labels, ace, ical, > check-email, freenect, frisby, gd, ini, lucid, osdkeys, pdfinfo, present, > pure-io, scrobble, shell-conduit, sourcemap, descriptive, wrap, path, weigh, > haskell-docs, and structured-haskell-mode. If you’re interested in taking > over or co-maintaining any of them, let me know. Some are interesting, > others are boring, some are trivial. > > I have other packages on Hackage, but they’re mostly dead or experiments > that don’t need maintenance anyway. > > I’ve started the process of adding or changing maintainers on my public > services: > > Haskell News is now a GitHub organization. Luke Murphy is a co-owner, and > has full access to the DigitalOcean account that is running the service. So > if you want to work on that project, I’m not in the way. > lpaste has been moved to its own DigitalOcean account too. If anyone is > interested in taking over the project or co-running it, let me know. > tryhaskell doesn’t really require any maintenance, but it’s also on its own > DigitalOcean account now too. > IRCBrowse is now on its own DigitalOcean account too. It requires > maintenance once in a while. If anyone is interested in taking over the > project or co-running it, let me know. > > Cheers! > > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. From m at jaspervdj.be Tue Feb 28 18:24:14 2017 From: m at jaspervdj.be (Jasper Van der Jeugt) Date: Tue, 28 Feb 2017 19:24:14 +0100 Subject: [Haskell-cafe] [Announce] ZuriHac 2017 Message-ID: <20170228182414.GA9750@colony6> Hello all, It is our pleasure to announce ZuriHac 2017, which will take place on 9th to 11th of June, 2017. The Haskell Hackathon is an international, grassroots collaborative coding festival whose goal is to expand the community and to build and improve Haskell libraries, tools, and infrastructure. This is the already the 6th Haskell Hackathon in Zurich! This year, we are privileged to enjoy keynotes from: - Edward Kmett - Julie Moronuki - Neil Mitchell - Stephen Diehl - Simon Thompson This is a great opportunity to meet your fellow Haskellers in real life, find new contributors for your project, improve existing libraries and tools or even start new ones! This event is open to any experience level, from beginners to gurus. We will have a dedicated beginners' track, and there will be mentors on site whom you can directly approach during the whole event with any Haskell-related question you have. We will be hosting the Hackathon in a new location [1] near the lake which provides space for up to 300 people! Experience from the previous years tells us these places might be gone quickly, so don't wait too long to register. You can find more information and register for the Hackathon here: http://zurihac.info We would also like to thank our sponsors Digital Asset [2], Google Open Source Programs Office [3] and HSR [4] for supporting this great event! Looking forward to see you there, the Zurich HaskellerZ meetup group [1]: https://zurihac.info/#venue [2]: https://digitalasset.com/careers.html [3]: https://developers.google.com/open-source/ [4]: https://www.hsr.ch/ From simon.jakobi at googlemail.com Tue Feb 28 18:30:15 2017 From: simon.jakobi at googlemail.com (Simon Jakobi) Date: Tue, 28 Feb 2017 19:30:15 +0100 Subject: [Haskell-cafe] Looking for maintainers or comaintainers on my Haskell projects In-Reply-To: References: Message-ID: Hi! I'd like to become co-maintainer of "path" which I already know a bit. I have also started watching a few of your other packages on GitHub. I'm also in favour of moving "hindent" into the "commercialhaskell" organization. Thanks for creating all these packages in the first place! Simon 2017-02-28 18:18 GMT+01:00 Christopher Done : > Hi all, > > The short version is: I’ve been battling RSI in my fingers for some years. > I’m doing various things to mitigate that problem, but I have very limited > finger bandwidth these days; enough to work at my usual pace at my job, but > not much in the evenings and weekends, and so I can’t manage to do much on > my hobby projects. I’m also not as motivated these days to work on my set > of open source projects, and am turning my attention to different things. > It’s not great, but that’s life. > > I don’t think that the users of my packages are getting the best > maintainership deal. Rather than be “the absentee maintainer”, I’d prefer a > straight-forward transition of maintainership or ownership to someone who > can put the right energy and time in. > > In terms of packages, there are really two that have a significant > maintenance burden and users aren’t being served very well: > > - HIndent has a significant > amount of issues opened for it regularly, and many of them require > discussion and debate. If someone would like to become a co-maintainer, let > me know. It may (eventually) make sense to move it to a more general GitHub > organization like commercialhaskell or haskell. > - Intero , which > seems to have been a success, has a pretty big maintenance burden on “this > doesn’t work” kind of issues which require investigation. There’s some > Emacs Lisp work to do on it, and some Haskell work on the intero binary, > and a whole lot of platform-specific problems or tooling not working > together. On the other hand people really like this project, and there’s a > lot of tooling potential. > > If you want to take xeno and make it > into a publishable package, please do so. > > The rest of my projects that are on Stackage are: labels > , ace > , ical > , check-email > , freenect > , frisby > , gd > , ini > , lucid > , osdkeys > , pdfinfo > , present > , pure-io > , scrobble > , shell-conduit > , sourcemap > , descriptive > , wrap > , path > , weigh > , haskell-docs > , and > structured-haskell-mode > . If you’re > interested in taking over or co-maintaining any of them, let me know. Some > are interesting, others are boring, some are trivial. > > I have other packages on Hackage, but they’re mostly dead or experiments > that don’t need maintenance anyway. > > I’ve started the process of adding or changing maintainers on my public > services: > > - Haskell News is now a GitHub > organization. Luke Murphy is a co-owner, and has full access to the > DigitalOcean account that is running the service. So if you want to work on > that project, I’m not in the way. > - lpaste has been moved to its own > DigitalOcean account too. If anyone is interested in taking over the > project or co-running it, let me know. > - tryhaskell doesn’t really > require any maintenance, but it’s also on its own DigitalOcean account now > too. > - IRCBrowse is now on its own > DigitalOcean account too. It requires maintenance once in a while. If > anyone is interested in taking over the project or co-running it, let me > know. > > Cheers! > ​ > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg.grenrus at iki.fi Tue Feb 28 18:54:47 2017 From: oleg.grenrus at iki.fi (Oleg Grenrus) Date: Tue, 28 Feb 2017 20:54:47 +0200 Subject: [Haskell-cafe] Looking for maintainers or comaintainers on my Haskell projects In-Reply-To: References: Message-ID: <22DC1E5E-0C8C-48A6-9EFE-969D0C90AE42@iki.fi> Thanks for making all there libraries! I use lucid extensively and could help maintaining it > On 28 Feb 2017, at 19.18, Christopher Done wrote: > > Hi all, > > The short version is: I’ve been battling RSI in my fingers for some years. I’m doing various things to mitigate that problem, but I have very limited finger bandwidth these days; enough to work at my usual pace at my job, but not much in the evenings and weekends, and so I can’t manage to do much on my hobby projects. I’m also not as motivated these days to work on my set of open source projects, and am turning my attention to different things. It’s not great, but that’s life. > > I don’t think that the users of my packages are getting the best maintainership deal. Rather than be “the absentee maintainer”, I’d prefer a straight-forward transition of maintainership or ownership to someone who can put the right energy and time in. > > In terms of packages, there are really two that have a significant maintenance burden and users aren’t being served very well: > > HIndent has a significant amount of issues opened for it regularly, and many of them require discussion and debate. If someone would like to become a co-maintainer, let me know. It may (eventually) make sense to move it to a more general GitHub organization like commercialhaskell or haskell. > Intero, which seems to have been a success, has a pretty big maintenance burden on “this doesn’t work” kind of issues which require investigation. There’s some Emacs Lisp work to do on it, and some Haskell work on the intero binary, and a whole lot of platform-specific problems or tooling not working together. On the other hand people really like this project, and there’s a lot of tooling potential. > If you want to take xeno and make it into a publishable package, please do so. > > The rest of my projects that are on Stackage are: labels, ace, ical, check-email, freenect, frisby, gd, ini, lucid, osdkeys, pdfinfo, present, pure-io, scrobble, shell-conduit, sourcemap, descriptive, wrap, path, weigh, haskell-docs, and structured-haskell-mode. If you’re interested in taking over or co-maintaining any of them, let me know. Some are interesting, others are boring, some are trivial. > > I have other packages on Hackage, but they’re mostly dead or experiments that don’t need maintenance anyway. > > I’ve started the process of adding or changing maintainers on my public services: > > Haskell News is now a GitHub organization. Luke Murphy is a co-owner, and has full access to the DigitalOcean account that is running the service. So if you want to work on that project, I’m not in the way. > lpaste has been moved to its own DigitalOcean account too. If anyone is interested in taking over the project or co-running it, let me know. > tryhaskell doesn’t really require any maintenance, but it’s also on its own DigitalOcean account now too. > IRCBrowse is now on its own DigitalOcean account too. It requires maintenance once in a while. If anyone is interested in taking over the project or co-running it, let me know. > Cheers! > > _______________________________________________ > Haskell-Cafe mailing list > To (un)subscribe, modify options or view archives go to: > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe > Only members subscribed via the mailman list are allowed to post. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nikivazou at gmail.com Tue Feb 28 18:56:03 2017 From: nikivazou at gmail.com (Niki Vazou) Date: Tue, 28 Feb 2017 13:56:03 -0500 Subject: [Haskell-cafe] Summer of Haskell 2017 Message-ID: Dear Haskellers, We are sorry to announce that this year Haskell.org was not accepted for the 2017 Google Summer of Code. But, as last year, we plan to organize our own Summer of Haskell! We ask for your help to plan a successful Summer of Haskell 2017. As last year, one student will be funded directly out of Haskell.org general funds. The key factor in how many further students we can fund is the generosity and support of donors. Funding a single student plus overhead costs 6000 USD. We are looking for donors willing to cover half, one or more students. If you (or your organization) are interested in becoming a Summer of Haskell donor please reach out to committee at haskell.org. We also encourage you to make a smaller donation, as if we receive enough of small donations in total, we will combine them to fund more students. Donation information is at: https://wiki.haskell.org/Donate_to_Haskell.org More information will be forthcoming as we work out the details. Feel free to contact us at (nvazou at cs.umd.edu and m at jaspervdj.be) if want to help or if you have any ideas, questions, or concerns. Best, Niki Vazou & Jasper Van der Jeugt for the Haskell.org Committee -------------- next part -------------- An HTML attachment was scrubbed... URL: