News aggregator

Allow extra commas in module declarations or lists?

glasgow-user - Sat, 06/11/2016 - 8:12pm
Some languages like Perl allow you to include additional commas in your lists, so that you can freely reorder them without worrying about adding or removing commas from the last or first item: my < at >array = ( 1, 2, 3, ); Perl even allows multiple redundant commas everywhere after the first element, which is less useful but has come up on occasion: my < at >array = (1,,,2,,,,,,,,,3,,,,,); I propose allowing an optional single extra comma at the end in module declarations, record declarations, record constructors, and list constructors: module Example ( module Example, SomeConstructor(..), ) where data SomeConstructor = SomeConstructor { foo :: Int, bar :: Int, } baz :: SomeConstructor -> SomeConstructor baz x = x { foo = 5, bar = 10, } qux :: [ Int ] qux = [ 1, 2, 3, ] What do you think? _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Categories: Offsite Discussion

CFP: DEADLINE APPROACHING - MSWiM 2016

General haskell list - Sat, 06/11/2016 - 2:56pm
=================================================== Call-For-Papers: 19th ACM/IEEE MSWiM 2016 Malta, Nov 13-17, 2016 http://www.mswimconf.com/2016 ==================================================== IMPORTANT: Submission deadline Extended: Paper registration through EDAS: June 12th, 2016 Paper Submission: June 12th, 2016 =================================================== ------ ACM/IEEE* MSWiM 2016 is the 19th Annual International Conference on Modeling, Analysis and Simulation of Wireless and Mobile Systems. MSWiM is an international forum dedicated to in-depth discussion of Wireless and Mobile systems, networks, algorithms and applications, with an emphasis on rigorous performance evaluation. MSWiM is a highly selective conference with a long track record of publishing innovative ideas and breakthroughs. MSWiM 2016 will be held Malta, Nov 13-17, 2016 Authors are encouraged to submit full papers presenting new research related to the theory or pra
Categories: Incoming News

Neil Mitchell: js-jquery 3.0.0 now out

Planet Haskell - Sat, 06/11/2016 - 9:08am

The js-jquery Haskell library bundles the minified jQuery Javascript code into a Haskell package, so it can be depended upon by Cabal packages and incorporated into generated HTML pages. It does so in a way that doesn't require each Haskell package to bundle its own extra data files, and in a way that meets the licensing requirements of distributions such as Debian.

I've just released version 3.0.0, following on from jQuery 3.0.0 a few days ago. This release breaks compatibility with IE6-8, so if that's important to you, insert an upper bound on the package.

Categories: Offsite Blogs

Call pattern specialization limit messages

haskell-cafe - Sat, 06/11/2016 - 4:32am
When I compile Data.Sequence with -dppr-debug, I get several messages about constructor specialization exceeding the call pattern limit. Things like SpecConstr Function ‘$j_ssfy{v} [lid]’ has four call patterns, but the limit is 3 Use -fspec-constr-count=n to set the bound Specialisations: [([sc_sAZr{v} [lid]], [sc_sAZr{v} [lid], lvl_sdmH{v} [lid]]), ([sc_sAZs{v} [lid]], [sc_sAZs{v} [lid], lvl_sw9X{v} [lid]]), ([sc_sAZt{v} [lid]], [sc_sAZt{v} [lid], lvl_swa0{v} [lid]]), ([sc_sAZu{v} [lid]], [sc_sAZu{v} [lid], lvl_swat{v} [lid]])] How can I figure out what function this sort of thing is actually talking about? I'd love to see what benchmarks say about whether tweaking -fspec-constr-count is a good idea, but I don't know what to benchmark. Thanks, David _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo
Categories: Offsite Discussion

All-fail case in asum

haskell-cafe - Fri, 06/10/2016 - 3:37pm
Hello I want to define some parser such way: myParser = tryA <|> tryB <|> fail "input must be either A or B" It works. But then I want to rewrite it with asum: myParser = asum [tryA, tryB, fail "must be A or B"] It works, but the wrong way. Instead of my error it writes "empty". Just "empty". It is so because in base library asum = foldr (<|>) empty What if it was defined asum [] = empty asum [x:xs] = x <|> asum xs It would help me with my parser. But what can this break? Why isn't this done yet?
Categories: Offsite Discussion

GHC 8 + ImpredictiveTypes + $

haskell-cafe - Fri, 06/10/2016 - 9:59am
Hi, I have had a number of trivial compilation failures in many of my projects that contain instances for MonadBaseControl (from monad-control) since upgrading to GHC 8. Now, I say 'trivial' since the actual fix is incredibly minor - a change of compose (.) to apply ($). What was less trivial was the (additional) hair loss arriving at the fix. I've put together a minimal example that demonstrates both the failing (pre-GHC8) and the fixed (GHC8) instances here: https://gist.github.com/brendanhay/e6f2501c15ac5160ca7dbb6ada6777f0 Since I found the error message somewhat directionless, I'd like some help actually understanding the root cause and why the 'fix' works: * I assume previously GHC did not fully check type aliases that were impredictive prior to GHC 8? * What does this imply for a type alias such as for the alias RunInBase used in monad-control that contains RankNTypes: http://hackage.haskell.org/package/monad-control-1.0.1.0/docs/Control-Monad-Trans-Control.html#t:RunInBase - Is such an alias not
Categories: Offsite Discussion

Philip Wadler: Papers We Love: John Reynolds, Definitional Interpreters for Higher-Order Programming Languages

Planet Haskell - Fri, 06/10/2016 - 5:14am

I've added online links to the relevant papers (not behind paywalls), copied here.
Papers we love: John Reynolds, Definitional Interpreters for Higher-Order Programming Languages7 June 2016, Skills Matter, London.
Certain papers change your life. McCarthy's 'Recursive Functions of Symbolic Expressions and their Computation by Machine (Part I)' (1960) changed mine, and so did Landin's 'The Next 700 Programming Languages' (1966). And I remember the moment, halfway through my graduate career, when Guy Steele handed me Reynolds's 'Definitional Interpreters for Higher-Order Programming Languages' (1972).
It is now common to explicate the structure of a programming language by presenting an interpreter for that language. If the language interpreted is the same as the language doing the interpreting, the interpreter is called meta-circular.
Interpreters may be written at differing levels of detail, to explicate different implementation strategies. For instance, the interpreter may be written in a continuation-passing style; or some of the higher-order functions may be represented explicitly using data-structures, via defunctionalisation.
More elaborate interpreters may be derived from simpler versions, thus providing a methodology for discovering an implementation strategy and showing it correct. Each of these techniques has become a mainstay of the study of programming languages, and all of them were introduced in this single paper by Reynolds.
Related material
Categories: Offsite Blogs

couldn't match expected type ByteString with actual type IO ByteString

haskell-cafe - Thu, 06/09/2016 - 1:07pm
Hello All, I'm getting the following error: /apps/workspace/hade/src/Step/ReadExcel.hs:39:23: Couldn't match expected type ‘L.ByteString’ with actual type ‘IO L.ByteString’ In the first argument of ‘IBuf’, namely ‘j’ In the second argument of ‘sendChan’, namely ‘(IBuf j)’ when I compile the following code: data Buf = IChan (SendPort Buf) | IBuf (L.ByteString) deriving (Show,Generic,Typeable) instance Binary Buf readExcel :: Process() readExcel = do sendChan chan (IBuf j) where IChan chan = expect j = do r <- toTableRowsFromFile 8 "final-project.xlsx" let b = A.encode r return b remotable ['readExcel] Any ideas as to what I'm doing wrong? Carl _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

FHPC'16 - reminder, and deadline extension

General haskell list - Thu, 06/09/2016 - 12:54pm
Dear colleagues, Following several requests for an extension, the submission deadline for FHPC'16 has been extended by 5 days to 15th June. ====================================================================== CALL FOR PAPERS FHPC 2016 The 5th ACM SIGPLAN Workshop on Functional High-Performance Computing Nara, Japan September 22, 2016 https://sites.google.com/site/fhpcworkshops/ Co-located with the International Conference on Functional Programming (ICFP 2016) Submission Deadline: Wednesday, 15 June, 2016 (anywhere on earth) ====================================================================== The FHPC workshop aims at bringing together researchers exploring uses of functional (or more generally, declarative or high-level) programming technology in application domains where high performance is essential. The aim of the meeting is to
Categories: Incoming News

FHPC'16 - deadline extension to 14th June

haskell-cafe - Thu, 06/09/2016 - 10:14am
Dear colleagues, Following several requests for an extension, the submission deadline for FHPC'16 has been extended by 5 days to 15th June. ====================================================================== CALL FOR PAPERS FHPC 2016 The 5th ACM SIGPLAN Workshop on Functional High-Performance Computing Nara, Japan September 22, 2016 https://sites.google.com/site/fhpcworkshops/ Co-located with the International Conference on Functional Programming (ICFP 2016) Submission Deadline: Wednesday, 15 June, 2016 (anywhere on earth) ====================================================================== The FHPC workshop aims at bringing together researchers exploring uses of functional (or more generally, declarative or high-level) programming technology in application domains where high performance is essential. The aim of the meeti
Categories: Offsite Discussion

Haskell in Leipzig 2016: Second Call for Papers

haskell-cafe - Thu, 06/09/2016 - 9:29am
                             Haskell in Leipzig                             September 14-15, 2016                             HTKW Leipzig, Germany                          http://hal2016.haskell.org/ Allow me to remind everyone of the opportunity to talk about your research, projects or ideas at this year’s Haskell in Leipzig. The deadline is three weeks from now. == News == Unsure about whether HaL is interesting to you? No need to worry: Alejandro Russo (from Chalmers) is our keynote speaker and will talk about his work on information-flow control (i.e. SecLib, LIO, MAC, HLIO) – a great topic that is of interest to researchers, practitioners and beginners alike.  == About HaL == The workshop series “Haskell in Leipzig”, now in its 11th year, brings together Haskell developers, Haskell researchers, Haskell enthusiasts and Haskell beginners to listen to talks, take par
Categories: Offsite Discussion

Call for talks: Haskell Implementors Workshop 2016, Sep 24 (FIXED), Nara

glasgow-user - Thu, 06/09/2016 - 8:17am
(...and now with the right date in the subject line!) Call for Contributions ACM SIGPLAN Haskell Implementors' Workshop http://haskell.org/haskellwiki/HaskellImplementorsWorkshop/2016 Nara, Japan, 24 September, 2016 Co-located with ICFP 2016 http://www.icfpconference.org/icfp2016/ Important dates --------------- Proposal Deadline: Monday, 8 August, 2016 Notification: Monday, 22 August, 2016 Workshop: Saturday, 24 September, 2016 The 8th Haskell Implementors' Workshop is to be held alongside ICFP 2016 this year in Nara. It is a forum for people involved in the design and development of Haskell implementations, tools, libraries, and supporting infrastructure, to share their work and discuss future directions and collaborations with others. Talks and/or demos are proposed by submitting an abstract, and selected by a small program committee. There will be no published proceedings; the workshop wil
Categories: Offsite Discussion

Call for talks: Haskell Implementors Workshop 2016, Aug 24, Nara

glasgow-user - Thu, 06/09/2016 - 8:14am
Call for Contributions ACM SIGPLAN Haskell Implementors' Workshop http://haskell.org/haskellwiki/HaskellImplementorsWorkshop/2016 Nara, Japan, 24 September, 2016 Co-located with ICFP 2016 http://www.icfpconference.org/icfp2016/ Important dates --------------- Proposal Deadline: Monday, 8 August, 2016 Notification: Monday, 22 August, 2016 Workshop: Saturday, 24 September, 2016 The 8th Haskell Implementors' Workshop is to be held alongside ICFP 2016 this year in Nara. It is a forum for people involved in the design and development of Haskell implementations, tools, libraries, and supporting infrastructure, to share their work and discuss future directions and collaborations with others. Talks and/or demos are proposed by submitting an abstract, and selected by a small program committee. There will be no published proceedings; the workshop will be informal and interactive, with a flexible timetabl
Categories: Offsite Discussion

Set-Theoretic Types for Polymorphic Variants

Lambda the Ultimate - Thu, 06/09/2016 - 7:38am

Set-Theoretic Types for Polymorphic Variants by Giuseppe Castagna, Tommaso Petrucciani, and Kim Nguyễn:

Polymorphic variants are a useful feature of the OCaml language whose current definition and implementation rely on kinding constraints to simulate a subtyping relation via unification. This yields an awkward formalization and results in a type system whose behaviour is in some cases unintuitive and/or unduly restrictive.

In this work, we present an alternative formalization of polymorphic variants, based on set-theoretic types and subtyping, that yields a cleaner and more streamlined system. Our formalization is more expressive than the current one (it types more programs while preserving type safety), it can internalize some meta-theoretic properties, and it removes some pathological cases of the current implementation resulting in a more intuitive and, thus, predictable type system. More generally, this work shows how to add full-fledged union types to functional languages of the ML family that usually rely on the Hindley-Milner type system. As an aside, our system also improves the theory of semantic subtyping, notably by proving completeness for the type reconstruction algorithm.

Looks like a nice result. They integrate union types and restricted intersection types for complete type inference, which prior work on CDuce could not do. The disadvantage is that it does not admit principal types, and so inference is non-deterministic (see section 5.3.2).

Categories: Offsite Discussion

ANN: Intero for Emacs

haskell-cafe - Wed, 06/08/2016 - 1:01pm
Here is a new Emacs package providing *very basic* Haskell programmer needs: - Type checking - Autocompletion - Go to definition - Type of selection - A basic REPL support It’s very simple, tries to *just work*, is based on Stack (required), the Emacs package auto-installs the correct version of its backend within your Stack working directory, supports the recently released GHC 8 all the way back to GHC 7.8.3. Having to configure anything to get basic functionality is considered a bug. The home page is here with details and demonstrations: http://commercialhaskell.github.io/intero/ The GitHub project where you can submit feature requests or bug reports: https://github.com/commercialhaskell/intero Thanks for reading! ​ _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

Jan Stolarek: Coq’Art, CPDT and SF: a review of books on Coq proof assistant

Planet Haskell - Wed, 06/08/2016 - 11:30am

I have been pretty quiet on the blog in the past couple of months. One of the reasons for this is that I have spent most of my time learning Coq. I had my first contact with Coq well over a year ago when I started reading CPDT. Back then I only wanted to learn the basics of Coq to see how it works and what it has to offer compared to other languages with dependent types. This time I wanted to apply Coq to some ideas I had at work, so I was determined to be much more thorough in my learning. Coq is far from being a mainstream language but nevertheless it has some really good learning resources. Today I would like to present a brief overview of what I believe are the three most important books on Coq: “Interactive Theorem Proving and Program Development. Coq’Art: The Calculus of Inductive Constructions” (which I will briefly refer to as Coq’Art) by Yves Bertot and Pierre Castéran, “Certified Programming with Dependent Types” (CPDT) by Adam Chlipala and “Software Foundations” (SF for short) by Benjamin Pierce and over a dozen over contributors. All three books significantly differ in their scope and focus. CPDT and Coq’Art are standard, printed books. CPDT is also available online for free. Software Foundations is only available as an online book. Interestingly, there is also a version of SF that seems to be in the process of being revised.

I believe Coq’Art was the first book published on Coq. There are two editions – 2004 hardcover version and a 2010 paperback version – but as far as I know there are no differences between them. Too bad the 2010 edition was not updated for the newest versions of Coq – some of the code examples don’t work in the newest compiler. Coq’Art takes a theoretical approach, ie. it teaches Coq largely by explaining how the rules of Calculus of Constructions work. There are also practical elements like case studies and exercises but they do not dominate the book. Personally I found Coq’Art to be a very hard read. Not because it dives too much in theory – it doesn’t – but because the presentation seems to be chaotic. For example, description of a single tactic can be spread throughout deveral places in the book. In principle, I don’t object to extending earlier presentation with new details once the reader gets a hold of some new concepts, but I feel that Coq’Art definitely goes too far. Coq’Art also presents material in a very unusual order. Almost every introduction to Coq or any other functional language begins with defining data types. Coq’Art introduces them in chapter 6. On the other hand sorts and universes – something I would consider an advanced concept for anyone who is not familiar with type-level programming – are presented in the second chapter. (Note that first chapter is a very brief overview of the language.) By contrast, CPDT goes into detailed discussion of universes in chapter 12 and SF does not seem to cover them at all. Overall, Coq’Art is of limited usefulness to me. To tell the truth this is not because of its focus on theory rather than practice, but because of language style, which I find rather inaccessible. Many times I had problems understanding passages I was reading, forcing me to re-read them again and again, trying to figure out what is the message that the authors are trying to convey. I did not have such problems with CPDT, SF, nor any other book I have read in the past few years. At the moment I have given up on the idea of reading the book from cover to cover. Nevertheless I find Coq’Art a good supplementary reading for SF. Most importantly because of the sections that explain in detail the inner workings of various tactics.

As mentioned at the beginning, I already wrote a first impressions post about CPDT. Back then I said the book “is a great demonstration of what can be done in Coq but not a good explanation of how it can be done”. Having read all of it I sustain my claim. CPDT does not provide a thorough and systematic coverage of basics, but instead focuses on advanced topics. As such, it is not the best place to start for beginners but it is a priceless resource for Coq practitioners. The main focus of the book is proof automation with Ltac, Coq’s language for writing automated proof procedures. Reader is exposed to Ltac early on in the book, but detailed treatment of Ltac is delayed until chapter 14. Quite surprisingly, given that it is hard to understand earlier chapters without knowing Ltac. Luckily, the chapters are fairly independent of each other and can be read in any order the reader wishes. Definitely it is worth to dive into chapter 14 and fragments of apter 13 as early as possible – it makes understanding the book a whole lot easier. So far I have already read chapter 14 three times. As I learn Coq more and more I discover new bits of knowledge with each read. In fact, I expect to be going back regularly to CPDT.

Coq’Art and CPDT approach teaching Coq in totally different ways. It might then be surprising that Software Foundations uses yet another approach. Unlike Coq’Art it is focused on practice and unlike CPDT it places a very strong emphasis on learning the basics. I feel that SF makes Coq learning curve as flat as possible. The main focus of SF is applying Coq to formalizing programming languages semantics, especially their type systems. This should not come as a big surprise given that Benjamin Pierce, the author of SF, authored also “Types and Programming Languages” (TAPL), the best book on the topic of type systems and programming language semantics I have seen. It should not also be surprising that a huge chunk of material overlaps between TAPL and SF. I find this to be amongst the best things about SF. All the proofs that I read in TAPL make a lot more sense to me when I can convert them to a piece of code. This gives me a much deeper insight into the meaning of lemmas and theorems. Also, when I get stuck on an exercise I can take a look at TAPL to see what is the general idea behind the proof I am implementing.

SF is packed with material and thus it is a very long read. Three months after beginning the book and spending with it about two days a week I am halfway through. The main strength of SF is a plethora of exercises. (Coq’Art has some exercises, but not too many. CPDT has none). They can take a lot of time – and I really mean a lot – but I think this is the only way to learn a programming language. Besides, the exercises are very rewarding. One downside of the exercises is that the book provides no solutions, which is bad for self-studying. Moreover, the authors ask people not to publish the solutions on the internet, since “having solutions easily available makes [SF] much less useful for courses, which typically have graded homework assignments”. That being said, there are plenty of github repositories that contain the solved exercises (I also pledge guilty!). Although it goes against the authors’ will I consider it a really good thing for self-study: many times I have been stuck on exercises and was able to make progress only by peeking at someone else’s solution. This doesn’t mean I copied the solutions. I just used them to overcome difficulties and in some cases ended up with proofs more elegant than the ones I have found. As a side note I’ll add that I do not share the belief that publishing solutions on the web makes SF less useful for courses. Students who want to cheat will get the solutions from other students anyway. At least that has been my experience as an academic teacher.

To sum up, each of the books presents a different approach. Coq’Art focuses on learning Coq by understanding its theoretical foundations. SF focuses on learning Coq through practice. CPDT focuses on advanced techniques for proof automation. Personally, I feel I’ve learned the most from SF, with CPDT closely on the second place. YMMV

Categories: Offsite Blogs

so strange but interesting

haskell-cafe - Wed, 06/08/2016 - 11:07am
Hi, I know it might be something strange, but still so interesting, you have to see it here <http://spalogoxe.njtec.com/aebez> Warmest, dek5< at >yandex.ru _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Categories: Offsite Discussion

[ANN] New docs for the Aivika simulation platform

haskell-cafe - Wed, 06/08/2016 - 9:37am
Hi Cafe, I wrote a new article "Aivika - A Constructor of General-Purpose Simulation Libraries" [1]. It uncovers key ideas of that how I implemented nested simulation and parallel distributed simulation in the Aivika platform [2]. Monads, immutable data structures, managed side effects, continuations, streams, recursive computations are all those things that are widely used in Aivika. The article can be useful for those who will have a willingness to use my simulation libraries for nested simulation, or distributed simulation, or some other field I cannot still imagine. Finally, I wrote a small tutorial for beginners [3]. It takes a simple discrete event simulation model and shows how we can add a Monte-Carlo experiment, save the results in the CSV files, plot histograms and charts, for the example, the deviation chart with a trend and confidence interval using rule 3-sigma. This tutorial can be used for quick diving into Aivika. All the programming code is written in Haskell. Best regards, David Sorokin
Categories: Offsite Discussion

ANN: SciFlow-0.5.0

haskell-cafe - Tue, 06/07/2016 - 10:48pm
Hi Cafe, I've been working on a package to manage data analysis pipelines, mainly for personal use. But I feel there may be others who are interested in this as well, so I just published an up-to-date version to hackage. Briefly, this package help you design and manage data analysis pipelines written in Haskell, with computation steps being just Haskell functions with type: a -> IO b. I use template Haskell to construct the dependency graph, and computation steps are assembled according to the graph and type checked at compile time. Each step can be configured to run either locally or on a remote machine. Concurrency is also supported. Independent steps will run simultaneously. Take a look at https://github.com/kaizhang/SciFlow for breif introduction and some examples. This package is still under heavy development, but it is quite stable otherwise as I've been using it on our cluster for some time. I hope you would find it useful and any feedback is welcome! _______________________________________________
Categories: Offsite Discussion

How to capture the output of GHCi :show command

haskell-cafe - Tue, 06/07/2016 - 7:02pm
I would like to be able to bind the output of GHCi's :show to a variable, but I don't see a nice way to do so. Is it possible to do this directly in GHCi? My specific use for this is appending to the current prompt.
Categories: Offsite Discussion