News aggregator

Problem finding rewrite rules

haskell-cafe - Thu, 08/28/2014 - 9:40pm
Dear Cafe, I'm currently looking at the optimization GHC is doing and I cannot find the rewrite rules it fires. When I run my test code with ghc -O2 -ddump-simpl-stats -ddump-rule-firings Main.hs GHC shows the rules which are fired: ... Rule fired: Class op + ... Rule fired: +## ... and so on. Nothing new, nothing special. However, where do I find the definitions of these rules ? I grepped[1] the GHC code base and found nothing so far. I didn't find any documentation on it either. Can anyone point me to some place where I can find further information ? Thank you folks and have a nice day Dominik PS.: Since I'm working on numerical stable code with directed rounding I'm only interested in these two particular rules. I suspect them to break parts of my code. [1] _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Discussion: Why is inet_addr in IO?

libraries list - Thu, 08/28/2014 - 3:41pm
inet_addr doesn't do any lookups, it is basically a glorified parsing problem converting from a string to a host address. Why, beyond the obvious implementation details, does it live in IO? Given that the current version lives in IO, should there be a version that is obviously made pure so that folks who want to use it directly can do so without having to bury it behind an unsafePerformIO? This isn't a concrete proposal at this time, but more an attempt to sound out if such a proposal should be formed. -Edward _______________________________________________ Libraries mailing list Libraries< at >
Categories: Offsite Discussion


haskell-cafe - Thu, 08/28/2014 - 3:06pm
Hi Cafe, In my experience, "hackathon" can refer to two very different sorts of events: hacking marathons (such as jacobsHack), where participants tend to work overnight to accomplish something amazing in a limited time; and hacker weekends (such as Hac Phi), where participants work on projects, socialize, and then (presumably) rest at night. Both of these sorts of events have their place in the world, and I'm in no way suggesting one is "better" than the other. But, I do think it be good for all of us to name them differently, so folks know what they are signing up for. In particular, I'm worried that calling hacker weekends "hackathons" may discourage those of us with outside, inflexible commitments (e.g. kids; the need for 8 hours of sleep) from attending. Conversely, folks looking for the higher-energy environment of an all-night marathon might be disappointed to show up at a hacker weekend. What do you think? Is this distinction pointless? Would being consistent about this difference help? Here are
Categories: Offsite Discussion

Call to arms for Haskell students

haskell-cafe - Thu, 08/28/2014 - 11:51am
Dear Haskellers, My (previous) university is organizing one of the first university hackathons in Europe. I am participating and would like to have a Haskell team for the hackathon. However, I don't know any Haskellers around or who can travel to Bremen. Let me know if anyone is interested to participate and team up with me. If it helps there are quite inexpensive flights to Bremen. The hackathon is only for students though. Quoted is the formal invite. Best regards, Ernesto It is about time to bring hackathons to European universities. A few
Categories: Offsite Discussion

Haskell Weekly News: Issue 303

General haskell list - Thu, 08/28/2014 - 6:40am
Welcome to issue 303 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers from August 17 to 23, 2014 Quotes of the Week * monochrom: "point free" can be decomposed to: "point" refers to ".", "free" refers to using no "$". :) Top Reddit Stories * λ Bubble Pop! Domain:, Score: 97, Comments: 41 Original: [1] On Reddit: [2] * The fundamental problem of programming language package management Domain:, Score: 82, Comments: 54 Original: [3] On Reddit: [4] * How Programming language subreddits talk (including Haskell) Domain:, Score: 72, Comments: 31 Original: [5] On Reddit: [6] * A fast, generic and type-safe image processing library written in Haskell Domain:, Score: 59, Comm
Categories: Incoming News

Haskell Platform 2014 build problems on OS X

haskell-cafe - Wed, 08/27/2014 - 9:39pm
Hello! I just want to point to your attention this issue of Homebrew: It seems that they’re forced to remove the formula for the Haskell Platform because, it seems, the build process has become extremely complicated and they can’t figure out how to automate it. Is there someone that know enough internals of the platform to help them or to give some advice? Thanks, Nicola
Categories: Offsite Discussion

ANN: cgi 3001.2.0.0

General haskell list - Wed, 08/27/2014 - 7:32pm
Hello, I've just uploaded a new version of cgi to hackage [1]. This release supports GHC 7.8.3, 7.6.3, and 7.4.2. I'm also looking for co-maintainers or backup maintainers of cgi, please email me directly if you're interested. This release was made possible with the assistance and guidance of Carter Schonwald and was based on a patch by Alexander Vershilov. Thanks. [1]
Categories: Incoming News

Conduit+GHC high memory use for simple Sink

haskell-cafe - Wed, 08/27/2014 - 7:19pm
Hello Cafe, First I'd like to thank Michael Snoyman and Gabriel Gonzalez for the work they've done on the conduit and pipes stream processing libraries, and all the accompanying tutorial content. I've been having fun converting a text processing app from C to Haskell. I'm seeing unexpectedly high memory usage in a stream-processing program that uses the conduit library. I've created a example that demonstrates the problem. The program accepts gzip files as arguments, and for each one, classifies each line as either Even or Odd depending on the length, then outputs some result depending on the Sink used. For each gzip file: action :: GzipFilePath -> IO () action (GzipFilePath filePath) = do result <- runResourceT $ CB.sourceFile filePath $$ Zlib.ungzip =$ CB.lines =$ token =$ sink2 putStrLn $ show result The problem is the following Sink, which counts how many even/odd Tokens are se
Categories: Offsite Discussion

[ANN] Wheb 0.3 release

haskell-cafe - Wed, 08/27/2014 - 2:26pm
Hello all, I have been working on a web framework that I use for my personal projects and I thought I would share my small progress. I started this project several months ago when I hit a big bump in difficulty going from a simple skeleton project to a more intricate project using alternative frameworks. Lately I've added three main features: WebSockets, Cache and Redis. WebSockets use the same WhebT interface as the standard HTTP handlers allowing you to share functions and middlware accross your application. Cache is a new plugin for simplistic Caching. It provides an interface to cache ByteStrings under Text keys. Like the other plugins, it is backend agnostic so you can write your own backend or use the prebuilt Redis cache (this requires you to configure your redis instance for caching). In addition to Redis acting as a Cache, you can also use it as a database and as a backend for the plugins Auth and Sessions. You can mix Redis with other plugins. For one of my projects I use the MongoDB plugin f
Categories: Offsite Discussion

Types depending on tuples.

haskell-cafe - Tue, 08/26/2014 - 8:46am
I'm doing some geometry in 2 and 3 dimensions. To do this, I've got Vector2d and Vector3d classes, which are basically just wrappers around 2 and 3-tuples of doubles: type Vector2d = (Double, Double) type Vector3d = (Double, Double, Double) I've also got a typeclass Vector so I can do polymorphic things on them: type Vector3d = (Double, Double, Double) (Ok, polymorphic thing). I now have a need to convert lists of Vector's to a list of lists of Doubles. I'd like that to be part of the Vector typeclass, but - well, declaring it is interesting. I can't just add a method "toLists :: a -> [Double]", because (according to ghc), there's no match between the expected type 'Double' and the actual type '[t1]'. Can I declare this typeclass? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Undesired email

haskell-cafe - Mon, 08/25/2014 - 6:12pm
Dear List, I have a problem with me new smartphone. Sorry for the inconvenient. Best, FelipeZ _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Proposal: Simplify/Generalize Data.Dynamic

libraries list - Mon, 08/25/2014 - 4:15pm
I'd like to propose a cleanup to the API of Data.Dynamic. By way of (partial) motivation, a couple of years back Lennart posed a question on stackoverflow <> about how to use Dynamic to implement apD :: forall f. Typeable1 f => (forall a. a -> f a) -> Dynamic -> Dynamic At the time, I offered a solution that is no longer applicable in a world with polykinded Typeable. But, if we change the definition of Data.Dynamic to data Dynamic where Dynamic :: Typeable a => a -> Dynamic from its current magic implementation in terms of unsafeCoerce and a manually held typeRep, then fromDynamic becomes a trivial application of Data.Typeable.cast and dynApply becomes easier, This would enable us to implement Data.Dynamic with its full constructor exposed without losing safety. In lieu of supplying the constructor, we could offer a form of withDyn :: Dynamic -> (forall a. Typeab
Categories: Offsite Discussion

Document for review: evaluation order and state tokens

glasgow-user - Mon, 08/25/2014 - 11:25am
As part of trac ticket 9390[1], Simon PJ recommended that we try to get a document written that clarifies some of the issues regarding evaluation order, and get it included in the GHC wiki. After a few iterations with review from Simon, I've got a first "publicly consumable" version available at: I'd appreciate any feedback on this document before I add it to the wiki. Michael [1] _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >
Categories: Offsite Discussion

[ANN] igrf-0.2

haskell-cafe - Mon, 08/25/2014 - 12:35am
igrf is a library that provides an implementation of the International Geomagnetic Reference Field, which is just what it sounds like. I've tested it against NOAA's online calculator, but use it at your own risk. Note that the input is in geocentric and not geodetic coordinates. There is haddock documentation, I'm working on figuring out why it isn't on hackage and how to fix it. -Doug McClean _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Proposal: (breaking change to avoid fragile breakage) change the definition of foldr2, zip, and zipWith

libraries list - Sun, 08/24/2014 - 8:22pm
BACKGROUND TRAC: #9495 GHC's definition of foldr2 violates the spec of the Haskell Report, making some programs less defined than they should be, and does so in a way that is quite fragile, dependent on a number of different factors—that is, it is likely hard to debug. Details: The current "baseline" definition of foldr2 (before rewrite rules) does what the Report requires: foldr2 :: (a -> b -> c -> c) -> c -> [a] -> [b] -> c foldr2 k z = go where go [] _ys = z go _xs [] = z go (x:xs) (y:ys) = k x y (go xs ys) There are two rewrite rules, foldr2/left and foldr2/right, designed to allow foldr2 to fuse with build appearing in either the first or second list argument. foldr2/left is perfectly safe (as long as the build argument is legitimate). foldr2/right is not, as comments in the source partially explain. The problem shows up if you have something shaped like zip [1,7,42,5] (1:8:4:11:undefined) but where the second list (ending in undefined) is actually produced using build, and GHC c
Categories: Offsite Discussion

Munich Haskell Meeting

haskell-cafe - Sun, 08/24/2014 - 7:43pm
Dear all, next Tuesday, 26th of August, Munich's Haskell enthusiasts will meet again at Cafe Puck around 19h30. Everyone is wellcome. Please note that we will meet at Cafe Puck. To help us reserve enough tables, please go to and click the button. Heinrich
Categories: Offsite Discussion

time and old-locale

libraries list - Sun, 08/24/2014 - 6:18am
For time-1.5, I'm removing the dependency on old-locale, and including that code directly in Data.Time.Format. The package will also include its own deprecated System.Locale. I expect this to be a popular, decade-overdue move, but if you have some complaint, let me know before I release it. Repository is at
Categories: Offsite Discussion


glasgow-user - Sat, 08/23/2014 - 11:45pm
After 3 days of frustrating trials and errors, I managed to install the new hmatrix package on Slackware 13.1. I post this message in case anyone else hits the same problem, as the process requires some alteration of the standard build process of ATLAS, LAPACK, hmatrix and hmatrix-gsl. The following steps assume that LAPACK is built against an optimized ATLAS library. 1.) By default, ATLAS builds only static libraries. However, hmatrix needs shared objects, so ATLAS should be configured with the --share option and, after the build is complete, the commands "make shared" and/ore "make ptshared" need to be issued in BUILDDIR/lib 2.) LAPACK also buils by default only static libraries and, for the same reason as above, we need position independent conde in ALL the objects in liblapack. In order to do this we need to 2.1.) Add -fPIC to OPTS, NOOPT and LOADOPT in LAPACKROOT/ 2.2.) Change the BLASLIB macro in the same file to point to the optimized tatlas (os satlas) library 2.3.) Add t
Categories: Offsite Discussion

ANNOUNCE: goatee, goatee-gtk: Go game editor

General haskell list - Sat, 08/23/2014 - 9:35pm
After 359 days, I'm pleased to announce the first official release of Goatee, a game editor for the board game Go. (Don't worry, those two remaining liberties are eyes.) Here's the project summary: UI features include: - Game navigation, variations and variation modes, game tree restructuring. - Annotations: marks (r/w), arrows and lines (r/o), visibility (r/o). - Full support for game info. - Manual editing of SGF properties. - One-color and blind Go modes. Two Hackage packages are available: 'goatee' is the shared library, and 'goatee-gtk' is the UI. Lots more is planned; stay tuned! Cheers, Bryan
Categories: Incoming News

lightweight web interface for Haskell?

haskell-cafe - Sat, 08/23/2014 - 7:36pm
Hi Cafe, Does anyone know of a website where I can write a few lines of Haskell and have them run? Ideally, there would be a place to write a module and then a place to load the module into GHCi. I seem to recall something that fit my needs at, but that site is no longer working. I'm asking because I'll be teaching an undergraduate course this fall in introductory Haskell. There are no prerequisites for the course, and my course roster suggests that I'll have several students with no programming background at all. (This is great, actually -- I love facilitating a new programmer's first steps!) It might be nice to get students off the ground quickly before bogging them down with installation details -- hence the website I'm looking for. Thanks! Richard
Categories: Offsite Discussion