Haskell Weekly News: November 28, 2006

Submitted by dons on Mon, 11/27/2006 - 6:53pm.

Welcome to issue 51 of HWN, a weekly newsletter covering developments in the Haskell community.

Automated testing fever strikes the camp, with three new QuickCheck-related libraries and tools released.

Announcements

  • QuickCheck 2 development version. Bjorn Bringert announced that the development version of QuickCheck 2 is now available in a public darcs repository. Highlights of the new QuickCheck version include: shrinking of failing test cases; supports testing monadic code; handles exceptions gracefully; coarbitrary has moved to a separate class; type-level modifiers for changing test data generation (e.g. NonNegative); function table printing; and user-defined actions when properties fail. The source is available via darcs.

  • PQC: QuickCheck in the Age of Concurrency. Don Stewart announced PQC: Parallel QuickCheck. PQC provides a single module: Test.QuickCheck.Parallel. This is a QuickCheck driver that runs property lists as jobs in parallel, and will utilise as many cores as you wish, with the SMP parallel GHC 6.6 runtime. It is simple, scalable replacement for Test.QuickCheck.Batch.

  • cabal-test: automatic testing for Cabal projects. David Himmelstrup announced cabal-test, the automatic tester for Cabal projects. The cabal-test tool is capable of testing embedded QuickCheck properties in any and all cabalized projects. The tests are currently executed in parallel with PQC. QuickCheck properties can reside anywhere in the code and don't have to be exported. The darcs repo is available.

  • Streams 0.1.7. Bulat Ziganshin announced Streams version 0.1.7, a fast extensible I/O and serialization library. Changes include: GHc 6.6 support, support for files larger than 4G on Windows, haddock documentation.

  • Ranged Sets 0.0.3. Paul Johnson announced the 0.0.3 release of Ranged Sets. Ranged sets allow programming with sets of values described by a list of ranges. A value is a member of the set if it lies within one of the ranges. The ranges in a set are ordered and non-overlapping, so the standard set operations can be implemented by merge algorithms in O(n) time.

  • Type-class overloaded functions. Oleg Kiselyov presented functions polymorphic over classes of types. Each instance of such (2-polymorphic) function uses ordinary 1-polymorphic methods, to generically process values of many types, members of that 2-instance type class. The typeclass constraints are thus manipulated as first-class entities. We also show how to write typeclass instances with back-tracking: if one instance does not apply, the typechecker will chose the `next' instance -- in the precise meaning of `next'.

  • Cabal mode for emacs. Matthew Danish released a small (and developing) major mode for editing Cabal files in emacs.

  • YCR2JS Programmers Guide Draft. Dimitry Golubovsky announced the draft of low-level programming guide for Yhc Core to Javascript converter. Everyone interested in future use of this tool is encouraged to read and review the Guide. Its purpose is to give some ideas about interaction of Haskell programs converted into Javascript with a web browser on the lowest possible level, without application frameworks and support libraries (just because these haven't been developed).

  • NeHe Tutorials in Haskell. Jason Dagit announced the availability of the (somewhat) famous NeHe tutorials for OpenGL have been ported to HOpenGL. A darcs repository is provided.

Haskell'

This section covers the Haskell' standardisation process.

Discussion

  • The Future of MissingH. John Goerzen opened a discussion on the future development of MissingH, in order to improve usability and adoption by the community. It was felt that the current monolithic structure, and nondescript naming raises the barrier to use.

  • Controlling backtracking with the list monad. Isto posed an interesting question about whether the backtracking in a list monad could be controlled, producing a nice way to build branch and bounding algorithms

  • Lifting conditionals. Dougal Stanton asked about lifting if/then/else into the IO monad, revealing some interesting subtleties in the implementation

  • Cheap commits for improving the library documentation. Don Stewart created a new page, for non-core contributors to submit suggestions on improving library documentation. Rather than require the user to produce a darcs patch, than can instead add their change to the wiki page. Ideally, a wiki-editable version of the entire haddock docs would be desired

  • Optimising a hash function. Ivan Tomac asked about optimising low-level bit shifting code to run close to C speed.

  • Common subexpression elimination. Christian Maeder asked about common subexpression elimination in GHC.

  • Passing arrays between Haskell and C without overhead. Brian Hulley asked for advice on how best to bind to a C library, from Haskell, such that data can be passed with zero copying.

  • Creating Loadable Dynamic libraries Libraries in OSX. Alfonso Acosta described how to create dynamic loadable libraries (.so) with GHC 6.6 under Linux X86 using some C glue code and linking with -optl -shared. Advice was sought on porting this to OSX.

Conference roundup

Fun in the Afternoon
  • Links: web programming without tiers. Phil Wadler.

  • Mechanized Metatheory Model-Checking. James Cheney. Syntactic techniques based on operational semantics and type systems are extremely useful for studying the metatheory of logics and programming languages. However, proving properties of such systems is often an onerous task, because there are often a large number of 'standard' or straightforward cases. It is tempting to cut corners and do careful proofs only for cases that seem interesting, but this can easily lead to a counterexample being missed. It therefore seems attractive to try to formalize such proofs in order to ensure their validity. However, this cure is often worse than the disease, since theorem proving tools tend to have a high learning curve. Moreover, theorem proving generally addresses the uncommon case of formalizing an informal proof of a well-understood system which has stood the test of time, rather than the common case of finding a bug in a poorly-understood system that may still be under development.

  • A Principled Approach to Version Control. Wouter Swierstra. Version control systems are essential for managing the distributed development of large software pro jects. We present a formal model for reasoning about version control. In particular, we give a general definition of patch. Patches abstract over the data on which they operate, making our framework equally suited for version control of everything from highly-structured XML files to blobs of bits. We model repositories as a multiset of patches. The mathematical definitions of patches and repositories enable us to reason about complicated issues such as conflicts and conflict resolution.

  • C\# is a functional programming language. Andrew Kennedy. Polymorphic functions, parameterized types, lambda expressions, type inference, streams, GADTs, and combinator libraries: these are features usually associated with functional languages such as Haskell and ML. In this talk I will show how the design of C\# 3.0, launching next year, was strongly influenced by ideas from functional programming, and supports all these features. I will use classic examples from the functional programming literature to illustrate the talk.

Blog noise

Haskell news from the blogosphere.

Quotes of the Week

  • Cale: GADT pattern match in non-rigid context. There are prescriptions available for that sort of thing.
  • Bulat: Base lib includes everything, from 'const' to starship control
  • Cale: I should actually think before coding, but the type system is so good.
  • Syzygy-: Why do I get the feeling that the arrow code was written during 'Speak like a pirate day'?
  • SamB: [on the subject of fromJust] thinks that unJust would be a more fun name for that
  • apfelmus: Ah, yet another UndeadArray necromancer exhausting his stack of bones. May the forces of light suggest to structure the incantation of darkness?
  • dons: Ah, it *is* like Haskell. I see: Jiffy Pop is the family fun treat. No other brand of popcorn offers a self-contained popping pan. It can even be used outdoors.
  • thetallguy: Using and advocating Haskell is like being Calvin (and Hobbes). To you, it's alive, real, a true delight. To those who know better, it's a stuffed tiger.

Code Watch

  • Mon Nov 27 05:06:02 PST 2006. Wolfgang Thaller. Initial support for x86_64-darwin. Basic -fvia-C code generation is there, not much testing.

  • Fri Nov 24 15:05:48 PST 2006. simonpj. Fix constraint handling for lazy patterns. Lazy patterns are quite tricky! Consider f ~(C x) = 3. Can the Num constraint from the 3 be discharged by a Num dictionary bound by the pattern? Definitely not! See Note 'Hopping the LIE in lazy patterns' in TcPat. The type checker wasn't ensuring this, and that was causing all manner of strange things to happen. It actually manifested as a strictness bug reported by Sven Panne.

About the Haskell Weekly News

Each week, new editions are posted to the Haskell mailing list as well as to the Haskell Sequence and Planet Haskell. RSS is also available, and headlines appear on haskell.org. Headlines are available as PDF. The Haskell Weekly News is also available in Spanish translation.

To help create new editions of this newsletter, please see the contributing information. Send stories to dons at cse.unsw.edu.au. The darcs repository is available at darcs get http://www.cse.unsw.edu.au/~dons/code/hwn