News aggregator

Cyclic Lists, Purely

Haskell on Reddit - Thu, 08/14/2014 - 1:38am
Categories: Incoming News

ANNOUNCE: hayland

haskell-cafe - Thu, 08/14/2014 - 1:19am
I just pushed the first release of the Haskell bindings to Wayland I've been working on to Hackage. SHAMELESS SPAM ----- I'm looking for a PhD position in (mathematical) type theory (preferably in Europe). Contact me for my (interesting!) background. What is Wayland? ----- For those of you who have been living under a rock, X11 is probably going to be ditched soon (porting work for GNOME, KDE, and E is already well underway), and the graphics stack reworked, in favor of "wayland". There will no longer be a monolithic server between the compositor (aka window manager) and the window clients. In the new design, the compositor *is* the central server. The new architecture allows for proper isolation of clients (a HUGE security improvement over X11), as well as major cleanups of code (enabling embedded use). Why bind to C code? ----- In theory, wayland should only be a protocol specification (which happens to have a reference implementation) which could be implemented in Haskell. However, the current stat
Categories: Offsite Discussion

Closed Type Family Simplification

haskell-cafe - Thu, 08/14/2014 - 1:02am
When a closed type family has only one instance it seems like it should never fail to simplify. Yet this doesn't appear to be the case. When I defined (in GHC 7.8.3) the closed type family type family (:.:) f g a where (:.:) f g a = f (g a) I get errors such as 'Could not deduce (Object c3 ((:.:) f g a) ~ Object c3 (f (g a)))' (where Object is a Constraint family), indicating that f (g a) is not being substituted for (:.:) f g a as desired. Any idea why this happens? _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Does the lambda calculus have provisions for I/O? State can be done with free variables.

haskell-cafe - Wed, 08/13/2014 - 10:39pm
Hi: Does the lambda calculus have provisions for I/O? State can be done with free variables.
Categories: Offsite Discussion

FP Complete: Announcing Stackage Server

Planet Haskell - Wed, 08/13/2014 - 6:00pm
A New Service

A couple months ago I made a post explaining Stackage server, its motivations and use-cases, and that it would be available in the coming months. It's now officially available in beta!

Stackage server.

As a quick recap: the essence of Stackage is that rather than publishing at the granularity of packages, like Hackage, it publishes at the granularity of package sets: Either everything builds together, or nothing is published until it does. We call these published things “snapshots.”

Note: A snapshot is an exact image that can be reproduced at any time. With the snapshot's digest hash, you can download and install the same index and install packages based on that index all the time. Subsequently generated snapshots have no effect on previous ones.

I've been using it for a couple months for every project I've worked on, private and public. It's perfect for application developers and teams who want to share a common always-building package set. Provided you're using one of the 500+ packages we're publishing in the snapshots, there will always be a build plan for the package you want to use in your project.

And if your library is in Stackage, as explained in the previous post, you will get a heads up on Github if your updates or other people's updates cause a build failure related to your library.

How it Works

Snapshots are built every couple days. It takes about 16 hours to complete a build. You can view the build progress at

There are two types of snapshots published by FP Complete:

  1. Exclusive: this excludes packages not specified in the Stackage configuration. This means anything that you try to install from this snapshot will have a build plan.
  2. Inclusive: this includes Hackage packages not known to build. If you try to install a package not tracked by Stackage, it may or may not build.

You can use whichever suites your needs. If you want everything to always build, the former is an attractive choice. If you need to use a package not currently on Stackage, the latter choice makes sense.

Try it Right Now

Choose a snapshot. Each snapshot applies to a specific GHC version. For example, the latest (as of writing) GHC 7.8 build. You'll see something like this:

To use, copy the following to your ~/.cabal/config:

remote-repo: stackage:

Note: Remove or comment out any existing remote-repo line.

Run the following to update your packages:

$ cabal update

If you already have installed some packages, it's better to clear out your package set. See this page in the FAQ for how to do that.


How does this interact with sandboxes? Good question. Here's the rundown:

  • hsenv: Yes, works fine. Edit the .hsenv/cabal/config file and off you go.
  • cabal sandbox: Not yet! There is an open issue about this. But I have tried cabal sandboxes inside hsenv, which worked.

We've added this to the FAQ on the wiki. Contributions to this wiki page are welcome!


Personally, I'm very satisfied with this service so far. I just use my existing tools with a different remote-repo.

Others familiar with Nix have asked how they compare. They are very similar solutions in terms of versioning and curation (although Stackage has full-time maintenance); the main advantage to Stackage is that it just uses existing tools, so you don't have to learn a new tool and way of working to have a better user experience.

We'd like feedback on a few points:

  • Is the inclusive/exclusive separation useful?
  • Is the process of using Stackage in an existing system (clearing the package set and starting fresh) easy?
  • Should we establish a convention for storing Stackage snapshot hashes in projects source-tracking repositories?

And any other feedback you come up with while using it.

Stackage for businesses

As part of my last announcement for Stackage I mentioned there will also be custom services for businesses looking to build their development platform on Stackage.

These commercial services include:

  1. Premium support - FP Complete will quickly respond and make improvements or fixes to the public Stackage server as they need to happen.
  2. Private snapshots with premium support - very helpful for commercial users looking to add proprietary or custom libraries.
  3. Validated pre-compiled build images based on public or private snapshots. These can be used on developer systems or automated build systems.
  4. Packaged Jenkins server using the pre-compiled build images.

All these additional commercial services are meant to be helpful add-ons and we look forward to hearing more about what features you think would be beneficial to you. For more information email us at:

Categories: Offsite Blogs

Openings for brilliant Haskell devs for excitingproject "as close to a space station as you can get" < at >Swedish spinoff, DSLs/safety-critical/embedded software, and more

haskell-cafe - Wed, 08/13/2014 - 10:28am
Dear All, I’d like to share this exciting job opportunity (formatted text below), as this forum might be right for the very skilled developers we are looking for here. The LinkedIn posting is on the following webpage, e.g. in case the email does not display correctly: … Best wishes, Johan Glimming < at > LinkedIn: — Openings for brilliant Haskell devs for exciting project "as close to a space station as you can get" < at > Swedish spinoff, DSLs/safety-critical/embedded software, and more As we grow our business further we look for extraordinary Haskell developers to further strengthen our exceptionally skilled teams in our spinoff and startup Functor Group AB, Kista/Stockholm, Sweden, with subsidiaries. < at >functors +FunctorGroups You would have a
Categories: Offsite Discussion

Odd FFI behavior

glasgow-user - Wed, 08/13/2014 - 5:44am
I have some strange behavior with GHC 7.6.3 on Ubuntu 14 TLS when using FFI and I am looking for some ideas on what could be going on. Fundamentally, adding wait calls (delays coded in the C) changes the behavior of the C, in that returned status codes have proper values when there are delays, and return errors when there are no delays. But these same calls result in proper behavior on the Aardvark’s serial bus, return proper data, etc. Only the status get’s messed up. The module calls a thin custom C layer over the Aaardvark C layer, which dynamically loads a dll and makes calls into it. The thin layer just makes the use of c2hs eaiser. It is always possible there is some kind of memory issue, but there is no pattern to the mishap. It is random. Adding delays just changes probabilities of bad status. I made a C version of my application calling the same custom C layer, and there are no problems. This sort of indicates the problem is with the FFI. Because the failures are not general in that they ta
Categories: Offsite Discussion

Seeking help with Windows + SDL2: Phantom Header Syndrome

Haskell on Reddit - Wed, 08/13/2014 - 2:54am
C:\dev>cabal install sdl2 Resolving dependencies... Configuring sdl2-1.1.0... Failed to install sdl2-1.1.0 Last 10 lines of the build log (C:\Users\tejon\AppData\Roaming\cabal\logs\sdl2-1.1.0.log ): setup-Cabal- Missing dependency on a foreign library: * Missing (or bad) header file: SDL.h This problem can usually be solved by installing the system package that provides this library (you may need the "-dev" version). If the library is already installed but in a non-standard location then you can use the flags --extra-include-dirs= and --extra-lib-dirs= to specify where it is. If the header file does exist, it may contain errors that are caught by the C compiler at the preprocessing stage. In this case you can re-run configure with the verbosity flag -v3 to see the error messages. cabal: Error: some packages failed to install: sdl2-1.1.0 failed during the configure step. The exception was: ExitFailure 1

I've checked and triple-checked the environment variables and tried the all the suggested flags. The header is there, the libs are there, and nothing complains except cabal itself. Any suggestions?

submitted by tejon
[link] [3 comments]
Categories: Incoming News

Stream Processing with a Spreadsheet

Lambda the Ultimate - Tue, 08/12/2014 - 10:10pm

ECOOP 2014 paper (distinguished) by Vaziri et. al, abstract:

Continuous data streams are ubiquitous and represent such a high volume of data that they cannot be stored to disk, yet it is often crucial for them to be analyzed in real-time. Stream processing is a programming paradigm that processes these immediately, and enables continuous analytics. Our objective is to make it easier for analysts, with little programming experience, to develop continuous analytics applications directly. We propose enhancing a spreadsheet, a pervasive tool, to obtain a programming platform for stream processing. We present the design and implementation of an enhanced spreadsheet that enables visualizing live streams, live programming to compute new streams, and exporting computations to be run on a server where they can be shared with other users, and persisted beyond the life of the spreadsheet. We formalize our core language, and present case studies that cover a range of stream processing applications.

Categories: Offsite Discussion

ANNOUNCE: wxHaskell

haskell-cafe - Tue, 08/12/2014 - 5:37pm
L.S., I am happy to announce a new version of wxHaskell. This version binds to both wxWidgets 2.9 and 3.0 [0]. As wxWidgets 3.0 is significantly better, I advice everyone, who is already using wxHaskell, to upgrade to wxWidgets 3.0.1 What is it? ----------- wxHaskell[1] is a portable and native GUI library for Haskell. The goal of the project is to provide an industrial strength GUI library for Haskell, but without the burden of developing (and maintaining) one ourselves. wxHaskell is therefore built on top of wxWidgets – a comprehensive C++ library that is portable across all major GUI platforms; including GTK, Windows, X11, and MacOS X. Furthermore, it is a mature library (in development since 1992) that supports a wide range of widgets with the native look-and-feel. What's new? ----------- - Accept both wxWidgets 2.9 and 3.0, with a preference for 3.0 - Added bindings for wxGraphicsContext::CreatePath - Use the same custom hook for `cabal copy` in wxc/Setup.hs - Many updates in definition
Categories: Offsite Discussion

Neil Mitchell: Safe library - generalising functions

Planet Haskell - Tue, 08/12/2014 - 3:08pm

Summary: The Safe library now has exact versions of take/drop, with twelve functions implemented on top of a generalised splitAt.

The Safe library is a simple Haskell library that provides versions of standard Prelude and Data.List functions that usually throw errors (e.g. tail), but wrapped to provide better error messages (e.g. tailNote), default values (e.g. tailDef) and Maybe results (e.g. tailMay).

I recently released version 0.3.5, which provides a new module Safe.Exact containing crashing versions of functions such as zip/zipWith (which error if the lists are not equal length) and take/drop/splitAt (which error if there are not enough elements), then wraps them to provide safe variants. As an example, the library provides:

takeExact :: Int -> [a] -> [a]
takeExactMay :: Int -> [a] -> Maybe [a]

These are like take, but if the Int is larger than the length of the list it will throw an error or return Nothing. Some sample evaluations:

takeExactMay 2 [1,2,3] == Just [1,2]
takeExact 2 [1,2,3] == [1,2]
takeExactMay 2 [1] == Nothing
takeExact 2 [1] ==
1:error "Safe.Exact.takeExact, index too large, index=2, length=1"
take 1 (takeExact 2 [1]) == [1]

So takeExactMay computes up-front whether the whole computation will succeed, and returns a Nothing if it will fail. In contrast, takeExact produces elements while they are present, but if you demand an additional element that is missing it will result in an error. All the exceptions in the Safe library are designed to provide the maximum level of detail about what went wrong, here telling us the index we were after and the length of the list.

The library provides takeExact, dropExact and splitAtExact, plus Def/May/Note versions, resulting in twelve similar functions. While the implementation of any one function is reasonably short (although not that short, once proper error messages are provided), I didn't want to write the same code twelve times. However, generalising over functions that check up-front and those that check on-demand requires a bit of thought. In the end I settled for:

splitAtExact_ :: (String -> r) -> ([a] -> r) -> (a -> r -> r) -> Int -> [a] -> r
splitAtExact_ err nil cons o xs
| o < 0 = err $ "index must not be negative, index=" ++ show o
| otherwise = f o xs
f 0 xs = nil xs
f i (x:xs) = x `cons` f (i-1) xs
f i [] = err $
"index too large, index=" ++ show o ++ ", length=" ++ show (o-i)

Here the splitAtExact_ function has a parameterised return type r, along with three functional arguments that construct and consume the r values. The functional arguments are:

  • err :: String -> r, says how to convert an error into a result value. For up-front checks this produces a Nothing, for on-demand checks this calls error.
  • nil :: [a] -> r, says what to do once we have consumed the full number of elements. For take we discard all the remaining elements, for drop we are only interested in the remaining elements.
  • cons :: a -> r -> r, says how to deal with one element before we reach the index. For take this will be (:), but for functions producing a Maybe we have to check the r parameter first.

With this generalisation, I was able to write all twelve variants. As a few examples:

addNote fun msg = error $ "Safe.Exact." ++ fun ++ ", " ++ msg

takeExact = splitAtExact_ (addNote "takeExact") (const []) (:)

dropExact = splitAtExact_ (addNote "dropExact") id (flip const)

takeExactMay = splitAtExact_ (const Nothing) (const $ Just []) (\a -> fmap (a:))

dropExactMay = splitAtExact_ (const Nothing) Just (flip const)

splitAtExact = splitAtExact_ (addNote "splitAtExact")
(\x -> ([], x)) (\a b -> first (a:) b)

splitAtExactMay = splitAtExact_ (const Nothing)
(\x -> Just ([], x)) (\a b -> fmap (first (a:)) b)

Normally I would have defined takeExact and dropExact in terms of fst/snd on top of splitAtExact. However, in the Safe library error messages are of paramount importance, so I go to additional effort to ensure the error says takeExact and not splitAtExact.

Categories: Offsite Blogs

What are some Haskell alternatives to Pandas/Numpy?

Haskell on Reddit - Tue, 08/12/2014 - 1:22pm

Title mostly says it all. I'm doing some data work at my job, and since we're a python shop we're using mostly pandas and numpy. They're great at what they do, but I would love to be able to do at least some of the same things in Haskell. It seems like making something like a pandas DataFrame would be possible in Haskell, and be quite useful. What are the best libraries for manipulating and operating on large matrices in Haskell, with efficient implementations of high-level tasks like time series, merge/join/groupby, parsing CSV and XLS, etc?

submitted by saikyou
[link] [26 comments]
Categories: Incoming News

A question about Functors.

Haskell on Reddit - Tue, 08/12/2014 - 1:01pm

If a functor a categorical homomorphism on objectes such as Maybe, then why do we call Maybe a Functor? Shouldn't fmap be the functor and the Maybe type constructor be the Category?

Forgive me if this is a stupid question, i'm reading "learn you a haskell". Thank you.

submitted by yyttr3
[link] [13 comments]
Categories: Incoming News

Help? Noob attempting to build hdevtools on Windows for Platform 2014.

Haskell on Reddit - Tue, 08/12/2014 - 10:52am

Haskell Sublime Text integration requires hdevtools.

hdevtools won't build right on Windows (requires unix, and even with MSYS it throws an unqualified error building that -- granted I haven't yet tried cygwin) which is fixed by this fork.

That fork fails to build with the newly-release Platform 2014 because it requires process==1.1.* and process is now at, with previous versions not installed.

Attempting to install process- fails because Not in scope: 'unsafePerformIO'.

Changing the requirement on the windows hdevtools fork to process==1.2.* allows me to configure, then gives me this on build:

src\Info.hs:130:59: Not in scope: data constructor `GHC.MatchGroup' Perhaps you meant `GHC.DocGroup' (imported from GHC) src\Info.hs:164:5: Not in scope: `Pretty.showDocWith' Perhaps you meant `Pretty.showDoc' (imported from Pretty) src\Info.hs:229:12: Not in scope: type constructor or class `PprTyThing.PrintExplicitForalls'

And the combination of my knowledge and Haskell documentation accessibility do not yet stack up to the task of hacking this out. :) Any pointers?

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