News aggregator

Neil Mitchell: Why is the Hoogle index so out of date?

Planet Haskell - Tue, 02/10/2015 - 12:22pm

Summary: Hoogle 4 is out of date. The alpha version Hoogle 5 has fresh code and data every day (and isn't yet ready).

Someone recently asked why Hoogle's index is so out of date. Making the index both more current (updated daily) and larger (indexing all of Stackage) is one of the goals behind my Hoogle 5 rewrite (which still isn't finished). Let's compare the different update processes:

Hoogle 4 updates took about two hours to complete, if they went well, and often had to be aborted. I first compiled the Hoogle binary on the machines, which often failed, as typically the version of GHC was very old. Once I'd got a compiled binary, I needed to generate the database, which took about 2 hours, and occasionally failed halfway through. Once I had the new binary and databases I moved everything to correct place for Apache, accepting a small window of downtime during the move. Assuming that worked, I did a few test searches and smiled. Often the new Hoogle binary failed to start (usually failure to find some files, sometimes permissions) and I had to switch back to the old copy. Fixing up such issues took up to an hour. I had a mix of Windows .bat and Linux .sh scripts to automate some of the steps, but they weren't very robust, and required babysitting.

Hoogle 5 updates happen automatically at 8pm every night, take 4 minutes, and have yet to fail. I have a cron script that checks out the latest code and runs an update script. That script clones a fresh repo, compiles Hoogle, builds the databases, runs the test suite, kills the old version and launches the new version. The Hoogle code is all tested on Travis, so I don't expect that to fail very often. The upgrade script is hard to test, but the two failure modes are upgrading to a broken version, or not upgrading. The upgrade script runs checks and fails if anything doesn't work as expected, so it errs on the side of not upgrading. I use Uptime Robot to run searches and check the server is working, along with a canary page which raises an error if no upgrade happens for two days.

Clearly, the Hoogle 5 version update story is better. But why didn't I do it that way with Hoogle 4? The answer is that Hoogle 4 came out over six years ago, and a lot has changed since then:

  • Hoogle 4 is a CGI binary, served through Apache, while Hoogle 5 is a Haskell Warp server. By moving the logic into Haskell, it's far easier for me to configure and manage. Warp was only released on Hackage in 2011.
  • Hoogle 4 runs on the on the main server, where my mistakes can easily take out the home page (as a result, the home page once said "moo" for 10 minutes). Hoogle 5 runs on a dedicated VM where I have root, and no one else runs anything, so I can experiment with settings about swap files, IP tables and cron jobs.
  • My job has provided a lot of practice doing drive-by sysadmining over the last 6 years. I've also had a lot of practice doing critical releases on a nightly basis. In comparison, Hoogle is pretty simple.
  • The revised/rethought approach to Hoogle databases is a lot faster and uses a lot less memory, so it takes under a minute to generate databases, instead of over an hour. That time difference makes it much easier to experiment with different approaches.

When will Hoogle 5 be ready? It doesn't yet do type search, there is no offline version and no API. There are probably lots of other little pieces missing. If you want, feel free to use it now at You can still use Hoogle 4 at, or the more up-to-date FP complete hosted Hoogle 4.

Categories: Offsite Blogs

First Call for Papers, PxTP 2015

General haskell list - Tue, 02/10/2015 - 11:46am
The Fourth International Workshop on Proof eXchange for Theorem Proving (PxTP) August 2-3, 2015, Berlin, Germany associated with CADE 2015 Important dates * Abstract submission: Thu, May 7, 2015 * Paper submission: Thu, May 14, 2015 * Notification: Tue, June 16, 2015 * Camera ready versions due: Thu, June 25, 2015 * Workshop: August 2-3, 2015 Background The PxTP workshop brings together researchers working on various aspects of communication, integration, and cooperation between reasoning systems and formalisms. The progress in computer-aided reasoning, both automated and interactive, during the past decades, made it possible to build deduction tools that are increasingly more applicable to a wider range of problems and are able to tackle larger problems progressively faster. In recent years, cooperation of such tools in larger verification environments has demon
Categories: Incoming News

Proposal: NF newtype

libraries list - Tue, 02/10/2015 - 10:46am
I propose the following (abstract) data type, functions, and instance be added to deepseq (naming amenable to bikeshedding): newtype NF a = NF a -- abstract makeNF :: NFData a => a -> NF a getNF :: NF a -> a instance NFData (NF a) where rnf x = x `seq` () NF is an abstract data type representing data which has been evaluated to normal form; the guarantee specifically is, if NF is in whnf, then it is in nf. Crucially, when we have 'NF a', we ONLY need to seq it in order to assure that it is fully evaluated. This guarantee is sufficient for a variety of cases where normal data is necessary, e.g. when transmitting data over Channels. For example, from the monad-par library 'put_' could be used in place of 'put' with this type signature. put_ :: IVar (NF a) -> (NF a) -> Par () Cheers, Edward
Categories: Offsite Discussion

The GHC Team: GHC 7.10 Prelude: we need your opinion

Planet Haskell - Tue, 02/10/2015 - 9:52am

This post asks for your help in deciding how to proceed with some Prelude changes in GHC 7.10. Please read on, but all the info is also at the survey link, here: ​ Deadline is 21 Feb 2015.

The Core Libraries Committee (CLC) is responsible for developing the core libraries that ship with GHC. This is an important but painstaking task, and we owe the CLC a big vote of thanks for taking it on.

For over a year the CLC has been working on integrating the Foldable and Traversable classes (shipped in base in GHC 7.8) into the core libraries, and into the Prelude in particular. Detailed planning for GHC 7.10 started in the autumn of 2014, and the CLC went ahead with this integration.

Then we had a failure of communication. As these changes affect the Prelude, which is in scope for all users of Haskell, these changes should be held to a higher bar than the regular libraries@ review process. However, the Foldable/Traversable changes were not particularly well signposted. Many people have only recently woken up to them, and some have objected (both in principle and detail).

This is an extremely unfortunate situation. On the one hand we are at RC2 for GHC 7.10, so library authors have invested effort in updating their libraries to the new Prelude. On the other, altering the Prelude is in effect altering the language, something we take pretty seriously. We should have had this debate back in 2014, but here we are, and it is unproductive to argue about whose fault it is. We all share responsibility. We need to decide what to do now. A small group of us met by Skype and we've decided to do this:

  • Push back GHC 7.10's release by at least a month, to late March. This delay also gives us breathing space to address an unrelated show-stopping bug, Trac #9858.
  • Invite input from the Haskell community on which of two approaches to adopt (​this survey). The main questions revolve around impact on the Haskell ecosystem (commercial applications, teaching, libraries, etc etc), so we want to ask your opinion rather than guess it.
  • Ask Simon Marlow and Simon Peyton Jones to decide which approach to follow for GHC 7.10.

Wiki pages have been created summarizing these two primary alternatives, including many more points and counter-points and technical details:

This survey invites your input on which plan we should follow. Would you please

  • Read the details of the alternative plans on the three wiki pages above
  • Add your response to ​the survey

Please do read the background. Well-informed responses will help. Thank you!

DEADLINE: 21 February 2015

Simon PJ

Categories: Offsite Blogs

Why all the tooling woes?

Haskell on Reddit - Tue, 02/10/2015 - 9:05am

I have seen a lot of discussion (and complaints) about the Haskell toolchain on this forum.

One popular area of discussion has to do with resolving dependencies, dealing with breaking changes, and deciding who should maintain backwards compatibility (and how).

This is sort of an umbrella issue for topics like "what's up with Cabal", or, "too much CPP is happening!"

I'm wondering why we seem to discuss these issues so much more within the Haskell community than within, say, the Ruby or Clojure communities.

The too-convenient explanation is to say, "in the Ruby and Clojure universes, it doesn't matter if there are subtle errors in the way dependencies interact, since people can release their code anyway; with Haskell, we reject invalid programs, so this class of programs can't be released"

I imagine that there is some truth to the above explanation; what are the other root causes that force us to debate the aforementioned dependency-resolution-umbrella-issue more than other language communities?

submitted by skatenerd
[link] [7 comments]
Categories: Incoming News

Cross-Compiling GUI Libraries from Linux to Windows

Haskell on Reddit - Tue, 02/10/2015 - 3:23am

I'm not sure this is the best venue for this, but I wanted to gather all of this in one place and I don't have a good place to put it.

I'm not too experienced with Haskell, but I've been wanting to use it for a while. However, most of the projects I want to do are small cross-platform GUI utilities to replace Clojure+Swing to fix: how bad Swing looks, the size of a full Clojure JAR, Clojure's start times, and the need for the JVM. So, I tried to get Gtk2Hs, wxHaskell, and HsQML to work. I'm currently using Fedora 20, so I first tried the MinGW compiler packaged with that. I didn't get too far with that. I turned to the next best thing: Wine (by the time I was done with this, I could have used some of the more drinkable kind). I started by installing the 32-bit Haskell Platform 2014.2.0.0 in Wine and adding that to the path. That worked just fine: I could run wine cabal and wine ghc.

To start, I tried installing wxHaskell. I started by trying to compile wxWidgets, but their directions recommended using MSYS2, which I found doesn't work with Wine. I eventually downloaded wxPack, which is about a gigabyte. While following the wiki page on installing wxHaskell in Windows, I also had to remove the "48" from "lib/gcc48_lib" and "lib/gcc48_dll" in wxPack to make the paths match. Installing wxHaskell from Hackage failed with:

src\cpp\glcanvas.cpp:43:60: error: 'wxGLContext' has not been declared src\cpp\glcanvas.cpp:102:1: error: 'wxGLContext' does not name a type src\cpp\glcanvas.cpp:109:1: error: 'wxGLContext' does not name a type src\cpp\glcanvas.cpp:116:1: warning: '__cdecl__' attribute only applies to function types src\cpp\glcanvas.cpp:116:1: error: 'wxGLContext' was not declared in this scope src\cpp\glcanvas.cpp:116:1: error: 'self' was not declared in this scope src\cpp\glcanvas.cpp:116:1: error: expected primary-expression before 'void' src\cpp\glcanvas.cpp:116:1: error: initializer expression list treated as compound expression src\cpp\glcanvas.cpp:117:1: error: expected ',' or ';' before '{' token

So, I installed from the wxHaskell Git repository by putting "wine" in front of every mention of "cabal" in the bin/mk-cabal script and ran that. Then I compiled a small Hello World program. I copied the appropriate DLLs next to that program and tried running it. That failed with:

err:module:attach_process_dlls "wxc.dll" failed to initialize, aborting

Looking at more verbose debug messages pointed toward an exception being raised while wxc.dll was loading. I really wasn't sure where to go from there, so I gave up on wxHaskell.

Next, I tried HsQML. Fortunately, the directions on that site worked more or less perfectly. I compiled the hsqml-demo-samples to make sure they worked. My first problem was how the directories were arranged by Cabal; since I wanted it to work as a portable application, the executable should be at the root. Running cabal configure --bindir=$prefix --datadir=$prefix/data before building fixed that. Then, I needed to gather the dependencies into the application directory. In the case of the demos, those are:

  • <Qt directory>/qml/QtQuick/ -> ./QtQuick/
  • <Qt>/qml/QtQuick.2/ -> ./QtQuick.2/
  • <Qt>/plugins/platforms/qwindows.dll -> ./platforms/qwindows.dll
  • icudt53.dll (the rest of these are from <Qt>/bin to the executable directory)
  • icuin53.dll
  • icuuc53.dll
  • libgcc_s_dw2-1.dll
  • libstdc++-6.dll
  • Qt5Core.dll
  • Qt5Gui.dll
  • Qt5Network.dll
  • Qt5Qml.dll
  • Qt5Quick.dll
  • Qt5Widgets.dll

My next biggest concern was the size of all of these dependencies, which came out to about 50 MB. First, I stripped everything, which helped a little. Next, I tried UPX, which cut it almost in half. Finally, I found that icudt53.dll, which started out at 22 MB and compressed to about 8 MB, could shrink further by customizing the included ICU data, as described in this forum post, which has a reduced DLL. That pushed all the dependencies down to 16 MB. With the first OpenGL demo as an example app (820 KB compressed), it was possible to put everything needed into a ZIP file of 11 MB while uncompressing to 17 MB. One last note on Qt: while testing in a Windows VM, I found that Qt would not work (failing with errors like unable to resolve `glBindBuffer`) because I needed to upgrade VirtualBox Guest Additions and enable 3D acceleration.

The last one I tried was Gtk2Hs. The directions only talk about GTK+ 2. Following them works fine, but GTK+ 2 didn't look very native. However, following those directions, but substituting the GTK+ 2 bundle for the GTK+ 3 bundle and installing the gtk3 package worked fine. I was able to compile a simple Hello World. For deployment, I copied all of the DLLs from the bin directory of the GTK bundle. I also noticed that the font didn't look native either, which was fixed by adding a etc/gtk-3.0/settings.ini file with the executable containing:

[Settings] gtk-font-name = Tahoma 8

All those DLLs took up 23 MB. Running them through UPX compressed them down to 9 MB. Together with the application (4 MB compressed), a complete distributable ZIP took only 7 MB.

So, after all that work, as well as many failures along the way, I was able to compile Windows executables in Linux using only free software, while avoiding recompiling any of the large GUI toolkits. I was also able to fulfill all my goals. Gtk2Hs was the most painless and the smallest. On the other hand, I've always disliked how GTK looks. HsQML, while immature, gives me Qt, which I think looks better than GTK, while not being much larger, once you use the minimal ICU DLL. More objectively, I think data binding with QML is really convenient and useful, as it enables better separation of concerns.

In summary, I couldn't get wxHaskell to work, Gtk2Hs and HsQML worked, and I think Qt is pretty and cool.

submitted by TJSomething
[link] [5 comments]
Categories: Incoming News

Noam Lewis: Inference of ‘new’ statements, and ambiguous types

Planet Haskell - Tue, 02/10/2015 - 2:16am

To prevent possible name clashes, the name of my type inference engine for JavaScript is now Inferny Infernu . I hope I don’t have to change the name again!

In other news, here is some recent progress:

‘new’ now requires ‘this’ to be a row type

I changed inference of ‘new’ calls, so that the constructed function must have a row type as it’s “this” implicit parameter (nothing else makes sense).

The change to “new” typing made it possible to define the built in String, Number, Boolean type coercion functions in a way that disallows constructing them (e.g. “new String(3)”) which is considered bad practice in JavaScript. The reason is that the constructed values are “boxed” (kind of) so that they don’t equate by reference as normal strings, booleans and numbers do. For example, new String(3) == '3' but at the same time, new String(3) !== '3'.

Ambiguous Types

I added an initial implementation of what I call ambiguous types. These are simple type constraints that limit a type variable to a set of specific types.

The motivation for type constraints is that some JavaScript operators make sense for certain types, but not all types. So having a fully polymorphic type variable would be too weak. For example, the + operator has weird outputs when using all sorts of different input types (NaNNaNNaNNaNNaNNaN….batman!). I would like to constrain + to work only between strings or between numbers.

With the new type constraints, + has the following type:

a = (TNumber | TString) => ((a, a) -> a)

The syntax is reminiscent of Haskell’s type classes, and means: given a type variable “a” that is either a TNumber or a TString, the type of + is: (a, a) -> a

I’m thinking about implementing full-blown type classes, or alternatively, a more powerful form of ambiguous types, to deal with some other more complicated examples.

Tagged: Haskell, Javascript
Categories: Offsite Blogs

Data.Graph nitpicks

libraries list - Tue, 02/10/2015 - 1:15am
Hi folks, I was just using the stronglyConnComp function in Data.Graph and found some minor annoying things: 1. stronglyConnComp takes an out-list as input. On the other hand, none of the other graph algorithms, like dfs, etc do this. stronglyConnComp seems to basically be an algorithm on graphs, so why doesn't it take the graph as input? Can we change stronglyConnComp to take a graph as input? That would make the interface more uniform. 2. Why is stronglyConnComp in a special haddock section whereas all the other algorithms are in the "Algorithms" section? How about we group it with all the other algorithms? 3. Why are there are so few instances of SCC? In particular, why not derive Show and Eq? Cheers, Andi _______________________________________________ Libraries mailing list Libraries< at >
Categories: Offsite Discussion

Fun with fibonacci

Haskell on Reddit - Tue, 02/10/2015 - 12:50am
Categories: Incoming News

Injective type families for GHC

haskell-cafe - Mon, 02/09/2015 - 5:58pm
Haskellers, I am finishing work on adding injective type families to GHC. I know that in the past many people have asked for this feature. If you have use cases for injective type families I would appreciate if you could show them to me. My implementation has some restrictions and I want to see how severe these restrictions are from a practical point of view. Janek --- Politechnika Łódzka Treść tej wiadomości zawiera informacje przeznaczone tylko dla adresata. Jeżeli nie jesteście Państwo jej adresatem, bądź otrzymaliście ją przez pomyłkę prosimy o powiadomienie o tym nadawcy oraz trwałe jej usunięcie. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

4Yr PostDoc with McBride/Ghani

General haskell list - Mon, 02/09/2015 - 5:06pm
Please forward to anyone you think might be interested cheers neil Salary range: £30434 - £34,233 FTE: 1.0 Term: Fixed Term (4 years) Closing date: 23 February 2015 Applications are invited for a Research Associate to work under the supervision of Professor Neil Ghani and Dr Conor McBride on the EPSRC grant "Homotopy Type Theory: Programming and Verification". Homotopy Type Theory (HoTT) is a revolutionary new approach to type theory where types are interpreted as spaces, terms as points and equalities as paths. Decades of research in homotopy theory has uncovered the structure of such paths and HoTT uses this structure as the basis of a new theory of equality. Excitingly, within homotopy theory, one naturally studies higher homotopies of paths between paths and this gives the higher dimensional structure of equality we previously lacked. The objective of this grant is to translate the advances of HoTT into more concrete programming language and verification tools. You will join a team consis
Categories: Incoming News

Cabal: Missing field in record constructionconfigProf

haskell-cafe - Mon, 02/09/2015 - 3:00pm
L.S., I am trying to install a package with the new GHC 7.10 RC 2 (I recompiled cabal.exe with it, and now "cabal update" finally works again). The install fails, even after renaming the cabal config file: Config file path source is default config file. Config file C:\Users\X\AppData\Roaming\cabal\config not found. Writing default configuration to C:\Users\X\AppData\Roaming\cabal\config Resolving dependencies... Configuring random-1.1... cabal: Distribution\Client\Config.hs:(246,37)-(299,9): Missing field in record construction configProf What does this message mean? How can I correct this? Regards, Henk-Jan van Tuyl
Categories: Offsite Discussion

Philip Wadler: Say no to a Scottish national ID system

Planet Haskell - Mon, 02/09/2015 - 2:39pm
The Scottish government has opened for consultation plans of that would lead to database sharing among a vast range of organisations, and could lead to the introduction of de facto ID cards via the back door. Responses to the consultation are due by 25 February 2015. ORG Scotland writes:

A minor, barely noticed consultation is not the way to make a major change to Scottish citizens’ privacy and their relationship with the state. Creating a national ID register was rejected by the SNP and the UK, and the bare minimum should be for the Scottish Executive to introduce primary legislation whereby the public and MSPs can debate the nature of these changes and whether they are acceptable.

Respond to the consultation quickly, courtesy of ORG.

ORG is planning meetings to discuss how we can stop the Scottish Government's plans in EdinburghGlasgow and Aberdeen, and is tracking developments in their blog.
Here is the original consultation,  and a detailed response by ORG.
Categories: Offsite Blogs