Haskell
Threads by month
- ----- 2026 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1999 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1998 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1997 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1996 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1995 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1994 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1993 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1992 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1991 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1990 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1989 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1988 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1987 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1986 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1985 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1984 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1983 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1982 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1981 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1980 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1979 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1978 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1977 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1976 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1975 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1974 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1973 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1972 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1971 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 1970 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
March 2007
- 61 participants
- 57 discussions
---------------------------------------------------------------------------
Haskell Weekly News
http://sequence.complete.org/hwn/20070305
Issue 58 - March 05, 2007
---------------------------------------------------------------------------
Welcome to issue 58 of HWN, a weekly newsletter covering developments
in the [1]Haskell community.
1. http://haskell.org/
Announcements
New Book - Programming in Haskell. Graham Hutton [2]announced a new
Haskell textbook: [3]Programming in Haskell. This introduction is
ideal for beginner programmers: it requires no previous programming
experience and all concepts are explained from first principles via
carefully chosen examples. Each chapter includes exercises that range
from the straightforward to extended projects, plus suggestions for
further reading on more advanced topics. The presentation is clear and
simple, and benefits from having been refined and class-tested over
several years.
2. http://article.gmane.org/gmane.comp.lang.haskell.general/14849
3. http://www.cs.nott.ac.uk/~gmh/book.html
Gtk2Hs version 0.9.11. Duncan Coutts [4]announced Gtk2Hs - a GUI
Library for Haskell based on Gtk+, version 0.9.11, is [5]now
available. Gtk2Hs features: automatic memory management; Unicode
support; nearly full coverage of Gtk+ 2.8 API; support for several
additional Gtk+/Gnome modules (Glade visual GUI builder, cairo vector
graphics, SVG rendering, OpenGL extension and more).
4. http://article.gmane.org/gmane.comp.lang.haskell.general/14934
5. http://haskell.org/gtk2hs/download/
cabal-make version 0.1. Conal Elliott [6]announced Cabal-make, a GNU
make include file to be used with Cabal in creating and sharing
Haskell packages. A few highlights: web-based, cross-package links in
Haddock docs; syntax coloring via hscolour, with per-project CSS;
links from the Haddock docs to hscolour'd code and to wiki-based user
comment pages. [7]It is available here.
6. http://article.gmane.org/gmane.comp.lang.haskell.general/14891
7. http://haskell.org/haskellwiki/Cabal-make
Vty 3.0.0. Stefan O'Rear [8]announced a new major of [9]vty, featuring
improved performance. vty is notably used in yi to provide a terminal
interface supporting syntax highlighting.
8. http://article.gmane.org/gmane.comp.lang.haskell.general/14876
9. http://members.cox.net/stefanor/vty/dist/doc/html/index.html
Haskell Xcode Plugin. Lyndon Tremblay [10]announced the first release
of [11]a plugin for Xcode enabling Haskell syntax highlighting, Xcode
projects compiling and linking, and a couple missing features, for
Haskell (GHC).
10. http://article.gmane.org/gmane.comp.lang.haskell.general/14875
11. http://www.hoovy.org/HaskellXcodePlugin/
urlcheck 0.1: parallel link checker. Don Stewart [12]announced the
first release of [13]urlcheck, an parallel link checker, written in
Haskell. Frustrated with the resources and time consumed by
'linkchecker', urlcheck is a lightweight, smp-capable replacement in
Haskell. urlcheck pings urls found in the input file, checking they
aren't 404s. It uses Haskell threads to run queries concurrently, and
can transparently utilise multiple cores if you have them.
12. http://article.gmane.org/gmane.comp.lang.haskell.general/14863
13. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/urlcheck-0.1
The Monad.Reader: call for copy. Wouter Swierstra [14]welcomed
articles for the next issue of The Monad.Reader. Submit articles for
the next issue by e-mail before April 13th, 2007. Articles should be
written according to the guidelines available from [15]The Monad
Reader home.
14. http://article.gmane.org/gmane.comp.lang.haskell.general/14870
15. http://www.haskell.org/haskellwiki/TheMonadReader
TV-0.2 and GuiTV-0.2. Conal Elliott [16]announced TV, a library for
composing tangible values ('TVs'), values that carry along external
interfaces. In particular, TVs can be composed to create new TVs, and
they can be directly executed with various kinds of interfaces. Values
and interfaces are combined for direct use, and separable for
composition. GuiTV adds graphical user interfaces to the TV (tangible
value) framework, using Phooey. The functionality was part of TV up to
version 0.1.1, and is now moved out to a new package to eliminate the
dependency of core TV on Phooey and hence on wxHaskell, as the latter
can be difficult to install.
16. http://article.gmane.org/gmane.comp.lang.haskell.general/14862
Haskell-mode 2.2. Stefan Monnier [17]released version 2.2 of [18]the
Haskell-mode package for Emacs. It has very few visible changes,
mostly some commands to query an underlying interactive hugs/ghci in
order to get type/info about specific identifiers.
17. http://article.gmane.org/gmane.comp.lang.haskell.general/14857
18. http://www.iro.umontreal.ca/~monnier/elisp/
Data.CompactString 0.1. Twan van Laarhoven [19]announced a beta
[20]Unicode version of Data.ByteString. The library uses a variable
length encoding (1 to 3 bytes) of Chars into Word8s, which are then
stored in a ByteString.
19. http://thread.gmane.org/gmane.comp.lang.haskell.general/14834
20. http://twan.home.fmf.nl/compact-string/
HSXML version 1.13. Oleg Kiselyov [21]announced version 1.13 of
[22]HSXML. HSXML is a library for writing and transforming typed
semi-structured data in Haskell -- in S-expression syntax, with the
extensible set of `tags', and statically enforced content model
restrictions. A particular application is writing web pages in
Haskell. We obtain HTML, XHTML or other output formats by running the
Haskell web page in an appropriate rendering monad. The benefit of
representing XML-like documents as a typed data structure/Haskell code
is static rejection of bad documents -- not only those with undeclared
tags but also those where elements appear in wrong contexts.
21. http://thread.gmane.org/gmane.comp.lang.haskell.general/14835
22. http://pobox.com/~oleg/ftp/Scheme/xml.html#typed-SXML
Haskell XML Toolbox 7.1. Uwe Schmidt [23]announced a new version of
[24]the Haskell XML Toolbox. The main change is the step from cvs to
darcs. The documentation has source links into [25]the darcs
repository. [26]A tutorial is available in the Haskell wiki.
23. http://article.gmane.org/gmane.comp.lang.haskell.general/14831
24. http://www.fh-wedel.de/~si/HXmlToolbox/index.html
25. http://darcs.fh-wedel.de/hxt
26. http://www.haskell.org/haskellwiki/HXT
OmegaGB, Haskell Game Boy Emulator. Bit Connor [27]announced OmegaGB,
an emulator for the Nintendo Game Boy, written in pure Haskell. It
uses gtk2hs for the user interface, but there is also a version that
doesn't require gtk2hs and uses ascii art. You can find more
information about the program at [28]the website.
27. http://article.gmane.org/gmane.comp.lang.haskell.general/14938
28. http://www.mutantlemon.com/omegagb/
Takusen 0.6. Oleg and Alistair [29]announced a new release of
[30]Takusen, the database library for Haskell. There are a large
number of changes and bug-fixes in this release, including improved
Oracle and PostgreSQL support.
29. http://article.gmane.org/gmane.comp.lang.haskell.libraries/6209/
30. http://darcs.haskell.org/takusen
hoogle.el. David House [31]announced Hoogle.el, a simple Emacs Lisp
library that nicely integrates [32]Hoogle into Emacs.
31. http://article.gmane.org/gmane.comp.lang.haskell.general/14944
32. http://haskell.org/haskellwiki/Hoogle.el
Buggy nofib. Josep Silva Galiana [33]announced a 'buggy' version of
the nofib collection of Haskell programs. [34]All programs contain one
of these bugs: a bug that produces an incorrect result; a bug that
produces non-termination; a bug that produces an exception (e.g., div
by zero). [35]The buggy nofib suite can be used to test debugging
tools.
33. http://article.gmane.org/gmane.comp.lang.haskell.general/14825
34. http://einstein.dsic.upv.es/darcs/nofib
35. http://einstein.dsic.upv.es/nofib
nobench: Haskell implementation shootout. Don Stewart [36]announced
nobench, a cross-implementation performance benchmark suite, based on
nofib, [37]comparing the performance of various Haskell compilers and
bytecode interpreters on a range of programs.
36. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19684
37. http://www.cse.unsw.edu.au/~dons/nobench.html
Derangement version 0.1.0. Dennis Griffith [38]announced the initial
version of derangement, a library for finding a derangement of a set.
A derangement of a set is a permutation with no fixed points, like
many constrained matching problems it is susceptible to solution via a
Max-flow algorithm.
38. http://article.gmane.org/gmane.comp.lang.haskell.cafe/19714
HSH 1.0.0. John Goerzen [39]announced the first release of HSH. HSH is
designed to let you mix and match shell expressions with Haskell
programs. With HSH, it is possible to easily run shell commands,
capture their output or provide their input, and pipe them to/from
other shell commands and arbitrary Haskell functions at will. HSH
makes it easy to run shell commands. But its real power is in piping.
You can pipe -- arbitrarily -- between external programs, pure Haskell
functions, and Haskell IO functions
39. http://article.gmane.org/gmane.comp.lang.haskell.cafe/20053
A new Haskell cookbook. Martin Bishop [40]began a preliminary page,
and fleshed out some of the headers/sub-headers on the wiki page for a
good Haskell Cookbook (not a PLEAC clone). [41]Please contribute.
40. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19790
41. http://haskell.org/haskellwiki/Cookbook
Haskell'
This section covers the [42]Haskell' standardisation process.
* [43]Global variables
* [44]Polymorphic components, so far
* [45]do-and-if-then-else modification
* [46]Fixity resolution, possible specification
* [47]Disjunctive tuples
42. http://hackage.haskell.org/trac/haskell-prime
43. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2054
44. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2076
45. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2120
46. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2121
47. http://thread.gmane.org/gmane.comp.lang.haskell.prime/2133
Libraries
This week's proposals and extensions to the [48]standard libraries.
* [49]Data.Proxy
* [50]Add extra readline completion functionality
* [51]Control.Monad.Cont documentation
* [52]Add First and Last wrappers around Maybe to Data.Monoid
* [53]Add ioeGetLocation, ioeSetLocation to System/IO/Error.hs
48. http://haskell.org/haskellwiki/Library_submissions
49. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6238
50. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6256
51. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6287
52. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6319
53. http://thread.gmane.org/gmane.comp.lang.haskell.libraries/6320
Discussion
Haskell with only one typeclass. Oleg Kiselyov [54]described how, if
the ability to define typeclasses is removed from Haskell, no
expressivity is lost. If Haskell had only one, pre-defined typeclass
with only one method, we could still do normal Haskell programming
with standard and user-defined overloaded numerical functions, monads,
monad transformers, etc. Haskell with only one typeclass can express
all of Haskell98 typeclass programming idioms including constructor
classes, plus multi-parameter type classes and some functional
dependencies.
54. http://article.gmane.org/gmane.comp.lang.haskell.general/14936
Data type declarations are implicitly moduled. Chris Moline
[55]proposed an idea to allow multiple data declarations to share
constructors by having them be implicitly declared inside a module.
55. http://article.gmane.org/gmane.comp.lang.haskell.general/14847
Importance of MonadRandom. Yitzchak Gale [56]pointed out the
importance of Cale Gibbard's [57]MonadRandom. This monad makes it
possible to write functions that use randomness without having to
specify in advance whether the source of randomness will be a pure
pseudorandom number generator, as in System.Random, or physical
randomness via the IO monad, such as your operating system's source of
physical randomness, or random.org, or a hardware random generator.
56. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19058
57. http://www.haskell.org/haskellwiki/New_monads/MonadRandom
Become a GHC build slave!. Simon Marlow [58]pointed out that, thanks
largely to Ian Lynagh, GHC now has a BuildBot infrastructure to
automate nightly builds on multiple platforms. This replaces the old
set of shell scripts that we used to run nightly builds; now adding
new clients to the setup is [59]relatively easy. So far we have
various Windows builds running, and I'll be moving over the existing
Linux nightly builds in due course.
58. http://article.gmane.org/gmane.comp.lang.haskell.cafe/19103
59. http://hackage.haskell.org/trac/ghc/wiki/BuildBot
Editor support for low level hacking. Don Stewart [60]mentioned some
tools used for making low level optimisation of GHC Haskell code
easier
60. http://article.gmane.org/gmane.comp.lang.haskell.cafe/19348
Optimisation fun. Creighton Hogg [61]sparked a long thread on
optimising prime sieves in Haskell
61. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19380
OO Design in Haskell Example. Steve Downey [62]began a thread on OO
design in Haskell
62. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19897
Safe lists with GADTs. Neil Mitchell [63]explored a safe version of
head and tail, on a safe version of lists, using GADTs
63. http://thread.gmane.org/gmane.comp.lang.haskell.cafe/19901
Jobs
Research position at Nokia Research Center. Jamey Hicks [64]announced
the availability of a senior research engineer position at Nokia
Research Center Cambridge, US. They are seeking an exceptional, highly
motivated individual who is interested in a unique opportunity to
collaborate with a world-class academic research community. This
position is for the Armo project at NRC Cambridge, using Bluespec
hardware description language to radically improve Nokia's ability to
develop advanced SOCs and corresponding software for future mobile
phones and mobile computers. We are investigating co-development of
hardware and software components for such devices. Success in the
project will lead to both academic publication as well as a
significant positive impact on Nokia products and engineering.
64. http://article.gmane.org/gmane.comp.lang.haskell.general/14901
New PhD Positions Computing Science, Chalmers University. Koen
Claessen [65]announced new [66]PhD positions for 2007, at Chalmers
University of Technology. The focus is on algorithms, bioinformatics,
distributed systems and computing, functional programming, formal
methods, interaction design, language technology, language based
security, parallel and high performance computing, programming logic
and type theory, but research is not restricted to these topics.
65. http://article.gmane.org/gmane.comp.lang.haskell.general/14900
66. http://chalmersnyheter.chalmers.se/chalmers03/english/eng_vacanciesarticle.…
Positions at Oxford: refactoring tools. Oege.de.Moor [67]announced the
availability of positions in the Programming Tools Group at Oxford,
researching aspect refactoring tools
67. http://article.gmane.org/gmane.comp.lang.haskell.general/14860
Blog noise
[68]Haskell news from the blogosphere.
* [69]Writing a Simple Search Engine in Haskell: Part 0 - Introduction
* [70]Writing a Simple Search Engine in Haskell: Part 1 Maybe and List
* [71]Haskell IO for Imperative Programmers
* [72]Quotient Types for Information Hiding
* [73]How Many Functions are There of Type Bool -> Bool?
* [74]Macros for Haskell? Done.
* [75]More on Haskell, Side Effects and Code Reuse
* [76]The theory of monads
* [77]Writing code by types
* [78]Haskell: open secret in Ruby land
* [79]Ruby vs Haskell: choose what works
* [80]Real time Haskell
* [81]Folds and functional programming
* [82]Countable Ordinals in Haskell
* [83]Haskell
* [84]Programming and the Metaphorical Mind
* [85]Languages and the semiskilled developer
* [86]Building a Firewall Against Complexity
* [87]The Killer App for a new language
* [88]Time travel in Haskell
* [89]Comonads and reading from the future
* [90]Flirting with Functional Programming
* [91]A fold-like procedure in C
* [92]Monads in Qi
* [93]Monads work because they have a tight interface
* [94]What's wrong with for loops
* [95]More on what's wrong with for loops
* [96]Haskell, CAL and Scala
* [97]Haskell: Queues without pointers
* [98]Type Classes: Not Quite Overloading
* [99]Generalised Algebraic Data Types, Phantom Types, and Dependent Types
* [100]An IRC client/server in Haskell
* [101]Language design: grand architecture versus feature collections
* [102]Thoughts on one week in Haskell
* [103]Why its hard for imperative programmers to learn Haskell
* [104]Refunctoring with polymorphism
* [105]Introductory console IO in Haskell
* [106]Learn the lambda calculus
* [107]Haskell for Alphas and Betas
* [108]My evolution as a Haskell programmer
* [109]On learning Haskell
* [110]Greenspun's Tenth Rule applied to Haskell
* [111]Cabal with rpm goodness
* [112]F#
* [113]Arithemtic coding in Haskell
* [114]A filesystem tree printer
* [115]Using Bayesian filtering instead of 'if' in Haskell
* [116]Combinator parsing
* [117]Monads for vector spaces, probability and quantum mechanics pt. I
* [118]Monads, Vector Spaces and Quantum Mechanics pt. II
* [119]Learning the Haskell programming language
* [120]A twisted history of monad transformers
* [121]Monadic parsing
* [122]Forth as a Haskell DSL
* [123]A better environment for shell scripting
* [124]Smart classification using Bayesian monads in Haskell
* [125]Haskell like data structures in Common Lisp
68. http://planet.haskell.org/
69. http://blogs.nubgames.com/code/?p=18
70. http://blogs.nubgames.com/code/?p=19
71. http://blogs.nubgames.com/code/?p=22
72. http://japple.blogspot.com/2007/01/quotient-types-for-information-hiding.ht…
73. http://japple.blogspot.com/2007/01/how-many-functions-are-there-of-type.html
74. http://clemens.endorphin.org/weblog/archives/2007-01.shtml#e2007-01-31T12_2…
75. http://neilbartlett.name/blog/?p=13
76. http://scienceblogs.com/goodmath/2007/01/the_theory_of_monads_and_the_m_1.p…
77. http://neilmitchell.blogspot.com/2007/01/writing-code-by-types.html
78. http://notes-on-haskell.blogspot.com/2007/01/haskell-open-secret.html
79. http://notes-on-haskell.blogspot.com/2007/01/ruby-vs-haskell-choose-what-wo…
80. http://mikeburrell.wordpress.com/2007/02/01/real-time-haskell/
81. http://mikeburrell.wordpress.com/2007/02/01/functional-idempotence-optimiza…
82. http://japple.blogspot.com/2007/02/countable-ordinals-in-haskell.html
83. http://vanirsystems.com/danielsblog/?p=103
84. http://toomuchcode.blogspot.com/2007/02/part-1-programming-and-metaphorical…
85. http://toomuchcode.blogspot.com/2007/02/part-2-languages-and-lesser-skilled…
86. http://toomuchcode.blogspot.com/2007/02/building-firewall-against-complexit…
87. http://toomuchcode.blogspot.com/2007/02/part-4-killer-app.html
88. http://community.livejournal.com/evan_tech/216270.html
89. http://sigfpe.blogspot.com/2007/02/comonads-and-reading-from-future.html
90. http://johnleesmiller.blogspot.com/2007/02/first-post.html
91. http://www.yomi.at/archive/2007/02/115
92. http://programmingkungfuqi.blogspot.com/2007/02/monads-in-qi.html
93. http://www.sdowney.org/2007/01/monads-rest-and-c-template.html
94. http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-with-for-loop.html
95. http://notes-on-haskell.blogspot.com/2007/02/whats-wrong-with-for-loop-revi…
96. http://blog.tmorris.net/ignorance-is-mostly-bliss-but-not-always/
97. http://www.randomhacks.net/articles/2007/02/08/haskell-queues-without-point…
98. http://www.cs.nott.ac.uk/~pni/Papers/Notes/typeClassOvld.html
99. http://www.cs.nott.ac.uk/~pni/Papers/Notes/GADTs.html
100. http://blog.nurd.se/hype/?p=30
101. http://www.dysfunctor.org/2007/02/13/architecture-vs-features/
102. http://kevin.scaldeferri.com/blog/2007/02/12/OneWeek.html
103. http://qftblog.wordpress.com/2007/02/14/why-its-so-hard-for-imperative-prog…
104. http://blog.tmorris.net/refunctoring/
105. http://cod3po37ry.blogspot.com/2007/02/more-on-haskell-io-and-interact.html
106. http://foreigndispatches.typepad.com/dispatches/2007/02/an_introduction.html
107. http://paulspontifications.blogspot.com/2007/02/haskell-for-alphas-and-beta…
108. http://onthebalcony.wordpress.com/2007/02/19/my-evolution-as-a-haskell-prog…
109. http://osfameron.vox.com/library/post/on-learning-haskell.html
110. http://japple.blogspot.com/2007/02/conors-rule.html
111. http://www.serpentine.com/blog/2007/02/20/haskell-cabal-now-with-extra-crun…
112. http://reddevnews.com/news/devnews/article.aspx?editorialsid=164
113. http://vandreev.wordpress.com/2007/01/07/arithmetic-coding/
114. http://blog.moertel.com/articles/2007/02/22/a-simple-directory-tree-printer…
115. http://www.randomhacks.net/articles/2007/02/22/bayes-rule-and-drug-tests
116. http://mikeburrell.wordpress.com/2007/02/25/combinator-parsing/
117. http://sigfpe.blogspot.com/2007/02/monads-for-vector-spaces-probability.html
118. http://sigfpe.wordpress.com/2007/03/04/monads-vector-spaces-and-quantum-mec…
119. http://printf.wordpress.com/2007/02/27/haskell-functional-programming-langu…
120. http://conway.rutgers.edu/~ccshan/wiki/blog/posts/Monad_transformers.html
121. http://gbacon.blogspot.com/2007/02/my-first-monadic-program.html
122. http://shaurz.wordpress.com/2007/03/03/forth-as-a-haskell-dsl-or-lambda-the…
123. http://changelog.complete.org/posts/587-A-better-environment-for-shell-scri…
124. http://www.randomhacks.net/articles/2007/03/03/smart-classification-with-ha…
125. http://common-lisp.net/project/patty/patty.html
Quotes of the Week
* sleepingsquirrel: Programming in Haskell is like having an
interactive conversation with a teleportation machine. You tell it
you want to go to some place warm and sandy. The machine complains
about ambiguous constraints. So you tell it that there should be
plenty of free tropical fruit drinks. It carps 'Inferred location
less polymorphic than expected'. Whoops, free flowing that is...
After a few more iterations, there's a little puff of smoke, and
at the sound of the chimes, you discover you're now on the beach
in Tahiti. And although you've used the machine many times before,
you can't help but be impressed that it usually 'Just works' most
of the time.
* jmillikin: If I had to work on code with performance requirements,
Haskell would be my choice (followed by C++). Haskell has
functional goodness with the ability to break into imperative
mode, and C++ gives me direct memory management with a few
functional pieces.
* Cale: It ought to be called simonPerformIO, and only used if your
first name is Simon
* monochrom: m a -> (a -> m b) -> m b is much more to the point than
'mumble computation mumble computation'
* mwc: There's a time when your brain doesn't get the monads. Then
something violent and irreversable happens and you hate every
other language for not having monads
Code Watch
Wed Feb 28 05:07:14 PST 2007. Simon Marlow. [126]Remove vectored
returns. We recently discovered that they aren't a win any more, and
just cost code size.
126. http://article.gmane.org/gmane.comp.lang.haskell.cvs.ghc/19418
Wed Feb 21 09:04:01 PST 2007. simonpj. [127]Allow GADT syntax for
newtypes
127. http://article.gmane.org/gmane.comp.lang.haskell.cvs.ghc/19344
About the Haskell Weekly News
Each week, new editions are posted to [128]the Haskell mailing list as
well as to [129]the Haskell Sequence and [130]Planet Haskell. [131]RSS
is also available, and headlines appear on [132]haskell.org. Headlines
are available as [133]PDF.
To help create new editions of this newsletter, please see the
[134]contributing information. Send stories to dons at
cse.unsw.edu.au. The darcs repository is available at darcs get
[135]http://www.cse.unsw.edu.au/~dons/code/hwn
128. http://www.haskell.org/mailman/listinfo/haskell
129. http://sequence.complete.org/
130. http://planet.haskell.org/
131. http://sequence.complete.org/node/feed
132. http://haskell.org/
133. http://www.cse.unsw.edu.au/~dons/code/hwn/archives/20070305.pdf
134. http://haskell.org/haskellwiki/HWN
135. http://www.cse.unsw.edu.au/~dons/code/hwn
1
0
Announcing release 0.1 of "harchive", a program for backing up and
restoring data. I've included a brief feature list below. The code
is available in darcs at:
http://www.davidb.org/darcs/harchive/
The connection isn't all that fast, so if it gets too busy, I'll move
it somewhere else.
This software is in a very early stage, but is at the point where
others may be interested in looking at it. It does demonstrate that
Haskell (at least GHC) is indeed useful for this kind of low-level
seeming task.
Thanks,
David Brown
Harchive version 0.1.
- Implemented, with support for the following.
- Client/server model. The backup is stored in a file pool with
the hpool program. The hfile program can access this pool over
tcp (no authentication or encryption, so be careful).
- Stores data from multiple backups and multiple machines in a
content addressible store. Duplicated data even on separate
machines will not take additional space. Collisions can be made
arbitrarily improbable by choice of hash function size (not
easily changeable, in the current code, though).
- Pool manager uses Sqlite3 specific capabilities to get efficient
storage of the pool index. Sqlite3 is a custom binding to
Sqlite3 to take advantage of these capabilities.
- Uses openssl's sha1 library. Wouldn't be difficult to use a
different library (there are license issues with openssl).
Generally the program's performance is bound by the speed of
hashing and/or the speed of data compression.
- Uses Duncan Coutts' zlib library to get good zlib speed.
- Linux dependent. Uses the output of '/sbin/blkid' to map
devices to UUIDs of the filesystems to get persistent, and
unique identifiers for each filesystem.
- Has a primitive status display ('-v') during backup.
- Able to backup and restore directories/filesystems. Restore
semantics are as accurate as I can get them without extra
strange semantics.
- Multithreaded backup. Allows backup to run at high speed, even
while waiting for cache responses from the server. Does not
need to be built with '-threaded'.
- Restore is reasonably simple. It tends to get tested less, so
it is beneficial to move complexity to the backup side.
1
0
04 Mar '07
the recent discussion about a simpler url-interface to library haddocks prompted
me to write some vimscript to make use of the existing interface. the initial idea was
just to translate qualified name and package into a url to launch a browser with.
but as people pointed out, having to know the qualified name and even the package
makes for an inconvenient interface. so the second version read haddocks index files
to populate a dictionary of unqualified names and symbols, pointing to possible
qualifiers and urls.
once we have such a handy documentation index, we can play other ide-style
games as well, so the current version (attached) adds a few more goodies.
some inspection necessary: this is not a proper, portable, out-of-the-box release!
the script has been tested with gvim 7.0 on windows, using the haddocks released
with ghc-6.4.1, and opera as the browser. to adapt it for other systems, you'll need
to change some paths and probably the :start command. feedback/fixes welcome.
what is on offer:-)
:IDoc "<name>" -- suggest possible qualifiers, then launch doc browser
:Doc "<qualname>","<package>" -- old-style invocation
:DocIndex -- populate index from haddock index html files (takes a few secs)
CTRL-X CTRL-U -- one of the user-defined insert-mode completions
-- does now complete unqualified ids wrt the doc index
_? -- for unqualified id under cursor, suggest possible qualifiers, browse
_. -- replace unqualified id under cursor with fully qualified version
so you can place your cursor on 'mapM_', type '_?', select Prelude or Control.Monad,
and find out what it is all about. or you can type 'pres', and still in insert mode, type
CTRL-X CTRL-U, find 'preservingMatrix' as one of the possible completions, and
select it. or you can place your cursor on 'preservingMatrix', type '_.', select one of
the options, and have it replaced with 'Graphics.Rendering.OpenGL.preservingMatrix'.
(for those who believe in gui rather than functionality as the distinction
between ides and editors, the last three use little popup menus in gui vim;)
how to: read the script to check that it does what you'd expect, adapt where
necessary, then :source it, run :DocIndex (this takes a few seconds, so we should
probably cache the result in more vim-friendly format somewhere later..), and play.
as usual, no guarantees of any kind.
feel free to adapt this for your haskell filetype plugins. and i'm sure that the
ideas carry over to other intelligent editors, so perhaps someone will come
up with an emacs variant?-)
enjoy,
claus
1
0
Hoogle.el is a simple Emacs Lisp library that nicely integrates Hoogle
into Emacs.
http://haskell.org/haskellwiki/Hoogle.el
Here's the docstring from the only function it provides: hoogle-lookup:
"Lookup the identifier at point in Hoogle. If we can't find an
identifier at the point, or with a prefix arg of 1, prompts for a
name to look up. If we can find a Hoogle in the $PATH (using
`executable-find' on `hoogle-local-command'), it will be used,
unless `hoogle-always-use-web' is non-nil. For web Hoogling, the
name is appended to `hoogle-url-base' and `browse-url' is
invoked."
The file is based on work by myself, Clemens Fruhwirth and Andy
Hefner. I welcome any comments.
--
-David House, dmhouse(a)gmail.com
1
0
Hi all, I am having a problem with the implementation of a program (a
genetic algorithm) which requires randomness in it.
It all hinges on the ability to generate something (in the example below an
Int), then provide a function to update it such that the prelude's
iteratefunction (or an equivalent) may be used. In my program I
require that both
the generation and the updating function contain randomness.
I have drafted a (simplified) example of my problem:
This code show a trivial case where randomness (and hence the IO monad) is
not used and the first 10 elements of the produced list are printed:
aNum :: Int
aNum = 2
addTwo :: Int -> Int
addTwo = (+) 2
firstTen :: [Int]
firstTen = take 10 (iterate addTwo aNum)
main :: IO ()
main = do
print firstTen
As required the program terminates printing:
[2,4,6,8,10,12,14,16,18,20]
Now I present my 'conversion' of this trivial case where we both generate a
random number, and add a random amount to it upon each iteration. Again we
only wish to print the first 10:
import System.Random
-- Taken directly from function 'rollDice' in Haskell98 report
randNum :: IO Int
randNum = getStdRandom (randomR (1, 6))
addRand :: Int -> IO Int
addRand x = do
y <- randNum
return (x + y)
firstTen :: IO [Int]
firstTen = do
infiniteNums <- iterateM addRand randNum
return (take 10 infiniteNums)
main :: IO ()
main = do
tenNums <- firstTen
print tenNums
-- Monadic interpretation of prelude iterate definition
iterateM :: Monad m => (a -> m a) -> m a -> m [a]
iterateM f xM = do
x <- xM
mcons xM (iterateM f (f x))
-- Taken from prelude definition of sequence
mcons :: Monad m => m a -> m [a] -> m [a]
mcons p q = p >>= \x -> q >>= \y -> return (x:y)
However this latter case gets stuck in an infinite loop, terminating on a
stack overflow.
My question asks why this is the case, when laziness should ensure only the
first 10 cases need to be computed.
If anyone wishes to suggest another way entirely to approach this problem
that would also be welcome!
Many Thanks,
Dave
5
4
01 Mar '07
GTTSE 2007, 02-07 July, 2007, Braga, Portugal
2nd International Summer School on
Generative and Transformational Techniques in Software Engineering
http://www.di.uminho.pt/GTTSE2007
** Registration is now open **
SCOPE AND FORMAT
The summer school brings together PhD students, lecturers, technology
presenters, as well as other researchers and practitioners who are
interested in the generation and the transformation of programs, data,
models, meta-models, and documentation. This concerns many areas of
software engineering: software reverse and re-engineering, model-driven
approaches, automated software engineering, generic language technology,
to name a few. These areas differ with regard to the specific sorts of
meta-models (or grammars, schemas, formats etc.) that underlie the
involved artifacts, and with regard to the specific techniques that are
employed for the generation and the transformation of the artifacts.
The tutorials are given by renowned representatives of complementary
approaches and problem domains. Each tutorial combines foundations,
methods, examples, and tool support. The program of the summer school
also features invited technology presentations, which present setups for
generative and transformational techniques. These presentations
complement
each other in terms of the chosen application domains, case studies, and
the underlying concepts. The program of the school also features a
participants workshop. All summer school material will be collected in
proceedings that are handed out to the participants. Formal proceedings
will be compiled after the summer school, where all contributions are
subjected to additional reviewing.
The formal proceedings of the first instance of the summer school (2005)
were published as volume 4143 in the Lecture Notes in Computer Science
series of Springer-Verlag.
TUTORIALS
* Krzysztof Czarnecki (University of Waterloo)
Model Evolution
* Jean-Marie Favre (University of Grenoble)
Software Linguistics and Language Engineering
* Stan Jarzabek (National University of Singapore)
Software Reuse Beyond Components with XVCL
* Oege de Moor (Oxford University)
Code Queries with Datalog
* José Nuno Oliveira (University of Minho, Portugal)
Data Transformation by Calculation
* Markus Pueschel (Carnegie Mellon University)
How to Write Fast Numerical Code
* Walid Taha (Rice University)
A Practical Guide to Building Staged Interpreters
* Eelco Visser (Delft University of Technology, The Netherlands)
Domain-Specific Language Engineering
REGISTRATION
Online registration for the summer school is now open. The registration
form, as well as detailed information on conditions and fees, are
available at:
http://wiki.di.uminho.pt/twiki/bin/view/Events/GTTSE2007/Registration
The number of participants is limited. Participants will be selected on
the basis of the information they supply on their registration form.
SUMMER SCHOOL CHAIRS
* Ralf Lämmel (Program Chair), Microsoft Corp., Redmond, USA.
* João Saraiva (Organizing Chair), Universidade do Minho, Braga,
Portugal.
* Joost Visser (Program Chair), Universidade do Minho, Braga, Portugal.
ADDITIONAL INFORMATION
For additional information on the program, venue, and other details of
the summer school, please consult the web page:
http://www.di.uminho.pt/GTTSE2007
For remaining questions please contact gttse2007 at di.uminho.pt.
1
0
Defining new typeclasses is regarded as an important part of Haskell
programming, as the normal way of introducing overloaded
functions. This message shows that if the ability to define
typeclasses is removed, no expressivity is lost. If Haskell had only
one, pre-defined typeclass with only one method, we could still do
normal Haskell programming with standard and user-defined overloaded
numerical functions, monads, monad transformers, etc. Haskell with
only one typeclass can express all of Haskell98 typeclass programming
idioms including constructor classes, plus multi-parameter type
classes and some functional dependencies. If we additionally admit
TypeCast as a pre-defined constraint, the rest of functional
dependencies are expressible. Besides clarifying the role of
typeclasses in Haskell as method bundles, this message proposes a
model of overloading resolution that is simpler than that of Hall et
al. Perhaps this model might be of interest to Haskell' committee.
The present approach is inspired by HList's class Apply, which seems
to be, after a small adjustment, the universal class.
For clarity of terminology, we call as Haskell1 the language Haskell98
with no typeclass declarations but with a single, already declared
typeclass C (which has two parameters related by a functional
dependency). The programmers may not declare any typeclasses; but they
may add instances to C and use them. We show on a series of examples
that despite the lack of typeclass declarations, Haskell1 can express
all the typeclass code of Haskell98 and then multi-parameter type
classes and some (most useful?) functional dependencies. Haskell98
methods are defined as ordinary functions in Haskell1.
To represent the rest of functional dependencies, we later define
Haskell1' as an extension of Haskell1 with a pre-defined constraint
TypeCast (which is not user-extensible and can be considered
built-in). Finally we introduce the analogue of Haskell98 classes --
method bundles -- and use them for defining bounded existentials.
Obviously Haskell1 is merely a subset of Haskell rather than a new
language; the removal of typeclass declarations is a matter of
discipline rather than that of syntax.
We offer a model of overloading resolution that is a bit different
from that of Stuckey and Sulzmann's `A theory of overloading.' When
an instance is selected, its dependent arguments are improved
(`typecast'). If an instance is not selected, no type improvement is
applied. Granted, this model is not formalized. But then, this
message is not an ICFP paper.
The complete code described in this message is available at
http://pobox.com/~oleg/ftp/Haskell/Haskell1/Class1.hs
http://pobox.com/~oleg/ftp/Haskell/Haskell1/Class2.hs
We first disclose our one and only type class:
> class C l t | l -> t where ac :: l -> t
The constraint C is pervasive, which makes some signatures in want of
syntax sugar, which we purposely avoid for clarity.
We start by building overloaded numeric functions, the analogue of
Num. The following defines the functions `a la carte'. Later we shall
see how to bundle them into what Haskell98 calls `classes'. We begin
with addition, to be denoted (+$) to avoid the confusion with the
Prelude.
> data Add a
> infixl 6 +$
> (+$) :: forall a. C (Add a) (a->a->a) => a -> a -> a
> (+$) = ac (__:: Add a)
Whereas (+) in Haskell was a method, here the overloaded addition is a
regular function, albeit bounded polymorphic. As we shall see, the
constraints of such functions are analogues of Haskell98 class
constraints. The above signature, sans the constraint, is the same as
that of Prelude.(+). We will see later a way to avoid writing the C
constraint explicitly. Let's define the instances of the generic
addition for Ints and Floats
> instance C (Add Int) (Int->Int->Int) where ac _ x y = x + y
> instance C (Add Float) (Float->Float->Float) where ac _ x y = x + y
as well over Dual numbers
> data Dual a = Dual a a deriving Show
> instance C (Add a) (a->a->a)=>C (Add (Dual a)) (Dual a->Dual a->Dual a) where
> ac _ (Dual x1 y1) (Dual x2 y2) = Dual (x1 +$ x2) (y1 +$ y2)
The latter is defined inductively, with the addition over base types
being the base case.
> ta2 = let x = Dual (1::Int) 2 in x +$ x -- sample test
Likewise, we define the overloaded multiplication. This time, we use
partial signatures to avoid writing the C constraint:
> infixl 7 *$
> mul_sig :: a -> a -> a; mul_sig = undefined
> mul_as :: a -> Mul a; mul_as = undefined
> x *$ y | False = mul_sig x y
> x *$ y = ac (mul_as x) x y
Functions frmInteger and shw are analogous. As in Haskell98, we use
the available overloaded functions to define new generic functions. For
example,
> genf x = x *$ x *$ (frmInteger 2)
> tm1 = genf (Dual (1::Float) 2) +$ (frmInteger 3)
The complete code demonstrates the overloading of not only functions
but also of plain values: minBound.
Next we turn to constructor classes and Monads, which can be easily
restricted as frequently desired.
> data RET (m :: * -> *) a
> data BIND (m :: * -> *) a b
> ret :: forall m a. C (RET m a) (a->m a) => a -> m a
> ret = ac (__::RET m a)
> bind :: forall m a b. C (BIND m a b) (m a->(a -> m b)->m b) =>
> (m a->(a -> m b)->m b)
> bind = ac (__::BIND m a b)
We show one particular monad: Either e
> instance C (RET (Either e) a) (a -> Either e a) where ac _ = Right
> instance C (BIND (Either e) a b)
> (Either e a -> (a->Either e b) -> Either e b) where
> ac _ (Right x) f = f x
> ac _ (Left x) f = Left x
with the goal to demonstrate MonadError, which is defined in Haskell's
monad transformer library as follows
-- class Error a where
-- strMsg :: String -> a
-- class Monad m => MonadError e m | m -> e where
-- throwError :: e -> m a
-- catchError :: m a -> (e -> m a) -> m a
In Haskell1, the above code becomes
> data ERROR a
> strMsg :: forall a. C (ERROR a) (String->a) => String -> a
> strMsg = ac (__::ERROR a)
> instance C (ERROR String) (String->String) where ac _ = id
> data ThrowError (m :: * -> *) a
> throwError :: forall e m a b t1 t2.
> (C (ThrowError m a) (e -> m a), C (RET m a) t1, C (BIND m a b) t2) =>
> e -> m a
> throwError = ac (__::ThrowError m a)
Here the constraints C (RET m a) t1 and C (BIND m a b) t2 are not
called for, but we specified them anyway. That is, we require that `m'
be an instance of a Monad. These extra constraints are Haskell1
analogue of Haskell's `class constraints'.
The definition of catchError is similar.
The Either e monad is an instance of MonadError
> instance C (ThrowError (Either e) a) (e -> Either e a) where ac _ = Left
> instance C (CatchError (Either e) a)
> (Either e a -> (e -> Either e a) -> Either e a) where
> ac _ (Left x) f = f x; ac _ x _ = x
so we can write a test
> te1 x = runEither $ catchError ac (\e -> ret e)
> where
> ac = (if x then throwError "er" else ret (2::Int)) `bind`
> (\x -> ret (x *$ x)) `bind` (ret.shw)
> runEither :: Either a b -> Either a b; runEither = id
> te1r = (te1 True, te1 False)
The MonadError example demonstrated that we already have some
functional dependencies. To get them in full, we extend Haskell1 with
the ``pre-defined'' constraint TypeCast. For example, to express the
following Haskell method of two arguments with the type of the first
argument determining the types of the result and of the second
argument
-- class FC3 a b c | a -> b c where fc3 :: a -> b -> c
-- instance FC3 Bool Char Int
we write in Haskell1'
> data FC3 a b c
> fc3 :: forall a b c. C (FC3 a b c) (a->b->c) => a->b->c
> fc3 = ac (__::FC3 a b c)
> instance TypeCast (FC3 Bool b c) (FC3 Bool Char Int)
> => C (FC3 Bool b c) (Bool->Char->Int) where ac _ x y = 1
> tfc3 = fc3 True 'a'
> tfc31 = fc3 True undefined
The latter two sample definitions are accepted as they are. Without
the functional dependencies, however, we would have needed type
annotations. The accompanying complete code has the expanded example.
Finally, we introduce the analogue of Haskell98 `classes' -- bundles
of methods -- whose compelling application is bounded existentials.
Let's define the Num bundle and numeric functions that are truly
NUM-overloaded
> data NUM a = NUM{nm_add,nm_mul :: a->a->a,
> nm_fromInteger :: Integer->a, nm_show :: a->String}
> data CLS a
> instance (C (Add a) (a->a->a), C (Mul a) (a->a->a),
> C (FromInteger a) (Integer->a),
> C (SHOW a) (a->String))
> => C (CLS (NUM a)) (NUM a) where ac _ = NUM (+$) (*$) frmInteger shw
We re-visit the overloaded addition, multiplication, show and
fromInteger functions, defining them now in terms of the just
introduced `class' NUM. We should point out the uniformity of the
declarations below, ripe for syntactic sugar. For example, one may
introduce NUM a => ... to mean C (CLS (NUM a)) (NUM a) => ...
> infixl 6 +$$; infixl 7 *$$
> (+$$) :: forall a. C (CLS (NUM a)) (NUM a) => a -> a -> a
> (+$$) x y = nm_add (ac (__:: CLS (NUM a))) x y
and similarly for the other operations.
We are in a position to define a bounded existential, whose quantified
type variable 'a' is restricted to members of NUM. The latter lets us
use the overloaded numerical functions after opening the existential
envelope.
> data PACK = forall a. C (CLS (NUM a)) (NUM a) => PACK a
> t1d = let x = PACK (Dual (1.0::Float) 2) in
> case x of PACK y -> nshw (y *$$ y +$$ y +$$ (nfromI 2))
1
0