News aggregator

André Pang (ozone): Markup Plugin for RapidWeaver 5

Planet Haskell - Mon, 07/07/2014 - 12:26pm

For the RapidWeaver users out there, I’ve updated my antique Markup plugin to work with RapidWeaver 5 (slow clap). It also now lives on GitHub, like all the other cool open-source projects published after about 1970. (BitBucket is so 1969.)

As an aside, ohmigosh, there still isn’t anything out there that’s as good as RapidWeaver for building websites. I wanted to redo my site, and looked into a bunch of RapidWeaver alternatives, especially Web apps. Tumblr, Wordpress, Blogger and all that are great for just blogs, but useless for building anything more than a blog. Online site-builders like Squarespace, Weebly, and Virb are either way too dumbed down, too complex, have the most boring themes, or more likely, are all of the above. Despite RapidWeaver still being compiled for ppc and i386 only (it’s not a 64-bit app yet), and using the Objective-C 1.0 runtime (my Markup plugin uses +[NSObject poseAsClass:]!), it is still the best thing going for building sites. Amazing.

Anyway, Markup plugin, go get it.

Categories: Offsite Blogs

can we do better than cabal sandbox?

Haskell on Reddit - Mon, 07/07/2014 - 11:47am

I've heard the idea of installing shared libraries with cabal and ditching the dependencies. This to me sounds better than cabal sandboxes because it allows you to reuse libraries without needing to reinstall them, and hopefully without needing to redo your entire cabal when you go for an upgrade to your libs. Unfortunately this wouldn't (afaik) improve the amount of time it takes to install these libs.

However if it were possible to install the dependencies as well, compile these shared libraries with the installed dependencies (if the version matches) and then have a new independent library, than I think our package management infrastructure would be solved. If the installed dependency is a version mismatch, we could install this library with a temporary instance of the desired dependency, and then toss jt.

Is this possible ? Do you think this is a good idea/would help?

Also while I'm on the podium might I add that it feels like overkill for cabal to be managing packages, building and sand boxing all on it's own? I think it should at least be split into separate commands

submitted by fruitbooploops
[link] [33 comments]
Categories: Incoming News

strange behavior of GHC 7.8.2

haskell-cafe - Mon, 07/07/2014 - 4:18am
Hi cafe, I noticed that strange behavior of GHC 7.8.2. Consider the following example which requires the "ghc" package: ---- {-# LANGUAGE GeneralizedNewtypeDeriving #-} module A where import GHC import MonadUtils import Control.Monad.Trans.RWS.Lazy (RWST(..)) newtype M a = M (RWST () () () IO a) deriving (Functor,Applicative,Monad,MonadIO) ---- The "ghc" library depends on "transformers" If "transformers" ** is NOT installed, GHCi can handle the code above well: ---- % ghci -package ghc A.hs ... Loading package transformers- ... linking ... done. ... Ok, modules loaded: A. [*A] ---- However, if "transformers" ** is installed, an error happens: ---- % cabal install transformers % ghci -package ghc A.hs ... Loading package transformers- ... linking ... done. ... [1 of 1] Compiling A ( A.hs, interpreted ) A.hs:10:49: No instance for (MonadIO (RWST () () () IO)) arising from the 'deriving' clause of a data type declaration
Categories: Offsite Discussion

How to have a managed window unfocusable?

haskell-cafe - Mon, 07/07/2014 - 3:23am
Hi, I'd like to have a transparent clock floating on my desktop. If I made it ignored (unmanaged), it would not be above and would be blocked by other windows. If I made it managed and float, when I floated up and down, it would be focused and I needed to press hotkey again to move focus to correct window. Anyway I could manage it, but not focusing on it?
Categories: Offsite Discussion

ML Family workshop: First Call for Participation

General haskell list - Mon, 07/07/2014 - 2:41am
Higher-order, Typed, Inferred, Strict: ACM SIGPLAN ML Family Workshop Thursday September 4, 2014, Gothenburg, Sweden Call For Participation Early registration deadline is August 3. Please register at This workshop specifically aims to recognize the entire extended ML family and to provide the forum to present and discuss common issues, both practical (compilation techniques, implementations of concurrency and parallelism, programming for the Web) and theoretical (fancy types, module systems, metaprogramming). We also encourage presentations from related languages (such as Scala, Rust, Nemerle, ATS, etc.), to exchange experience of further developing ML ideas. The workshop is conducted in close cooperation with the OCaml Users and Developers Workshop taking place on September 5. Program * Andreas Rossberg 1ML -- core and modules as one (Or: F-ing first-class modules)
Categories: Incoming News

Haskellers in Chile

Haskell on Reddit - Mon, 07/07/2014 - 1:42am

I am an avid Haskeller and will be in Santiago, Chile for around 6 months starting August. I was wondering if there are any Chilean Haskell groups or meetups that I can join.

submitted by haskman
[link] [4 comments]
Categories: Incoming News

Designing Dependently Typed Languages - OPLSS '14

Haskell on Reddit - Mon, 07/07/2014 - 12:09am

At this year's Oregon Programming Language Summer School Stephanie Weirich gave a a series of lectures walking through the development of a simple dependently typed language in Haskell.

The videos are available as .mp4 files at:

and the github repo for the source code is available at:

submitted by mn-haskell-guy
[link] [10 comments]
Categories: Incoming News

Can we get this language FAST

Haskell on Reddit - Sun, 07/06/2014 - 10:11pm

If your average coders haskell code outperformed your average coders C code, I don't believe there'd be anything holding us back from popularity. I don't think that's impossible either if we could makes faster data structures default. list and String really don't cut it. I feel that this language should succeed and I think this is an important step along the way.

submitted by fruitbooploops
[link] [11 comments]
Categories: Incoming News

how to turn on RTS options?

haskell-cafe - Sun, 07/06/2014 - 5:53pm
I need to change some runtime options. I updated the options line in my cabal file: ghc-options: -Wall -fno-warn-orphans -O2 -rtsopts But when I rebuild and run, it's as though runtime options are still disabled. C:\johan\Haskell\projects\bio-acai>cabal build .\bio-acai.cabal has been changed. Re-configuring with most recently used options. If this fails, please run configure manually. Resolving dependencies... Configuring bio-acai- Building bio-acai- Preprocessing executable 'acai' for bio-acai- Preprocessing test suite 'tests' for bio-acai- C:\johan\Haskell\projects\bio-acai>dist\build\acai\acai.exe +RTS -H128m -K64m *acai.exe: Most RTS options are disabled. Link with -rtsopts to enable them.* My best guess is that the "ghc-options" line is the wrong place to try to turn on RTS option handling. But what's the right one?
Categories: Offsite Discussion

[ANN] codex 0.1.0 - generate tags file fromdependencies

haskell-cafe - Sun, 07/06/2014 - 5:00pm
Hi, Just to let you know that I released a new version of `codex` (a tool which generate a tags[1] file for a given cabal project using the sources of all the dependencies of that project). This release include some bug fixes as well as two new features: - Support modules added using `cabal sandbox add-source` as workspace dependencies - Support `emacs` format by disabling sorting on merge of tags files Thanks to everyone who reported bugs or submitted patch! [1]Those tags file basically contain references to functions/types definition in source code and allow "jump to definition" like functionality in text editors. source: hackage:
Categories: Offsite Discussion

Roman Cheplyaka: How to run SQL actions in persistent

Planet Haskell - Sun, 07/06/2014 - 3:00pm

When I started writing an application that used persistent to interact with a MySQL database, I decided to put the whole application inside one big SqlPersistM action, and run it once inside main. (To make it clear, this is not a Yesod application; I simply use persistent as a standalone library.)

However, as I learned more about persistent and how it worked, it became clear that this was the wrong way to use persistent. Here’s why.

Problems of one big SqlPersistM action Finalizing transactions

persistent’s SQL layer treats an SqlPersistT action as a single transaction. Thus, until you run the action, the transaction is not committed. Obviously, this is an issue for any long-running server application.

You could work around this by calling transactionSave manually. Now you have a different but related problem…

Overlapping transactions

Normally a single SQL connection can participate in just one SQL transaction. (There are probably exceptions to this rule which I am not aware of, but this is how it happens unless you do something special.)

Thus, assuming your application is multithreaded, you’ll end up committing other threads’ transactions that are active at the same time.

(Besides, I am not sure whether executing multiple SQL statements over the same connection simultaneously is supported at all.)

Resource deallocation

persistent uses resourcet to ensure that resources (such as buffers that hold result sets) are released as soon as they are not needed.

resourcet works by handling these two scenarios:

  1. No exception is thrown; resources are deallocated by an explicit release call.
  2. An exception is thrown, preventing the release action from happening. However, once the exception escapes the enclosing ResourceT block, it triggers the exception handler inside runResourceT. The exception handler then performs deallocation.

When your application consists of one long-running SqlPersistM action, chances are you’re catching some exceptions inside the ResourceT block, by the means of monad-control. Doing that invalidates resourcet’s assumptions: an exception prevents the release action from happening, and yet it never makes it up to runResourceT, and so your long-running app leaks resources.

Do it right

It implies from the above considerations that the right way to use persistent with a SQL backend is:

  1. Make SqlPersistT correspond to logical transactions in your application.
  2. Make ResourceT computations as short-lived as possible. Ideally, don’t catch exceptions inside ResourceT; use finally instead.
  3. Use a connection pool.

I am not an expert in either persistent or SQL databases; I am in the process of figuring this out myself. Corrections (and confirmations) are welcome.

Categories: Offsite Blogs

Control.Exception.bracket is broken(?)

haskell-cafe - Sun, 07/06/2014 - 2:15pm
Hello, From docs: "If an exception is raised, then bracket will re-raise the exception (after performing the release)." But what if the release action will throw an exception? There are 3 options: 1) suppress the exception from release action and rethrow the original one 2) shutdown the program 3) suppress the original exception and throw the exception from release action. Current behavior is #3 -- suppress the original exception. I think it the worse choice. What other languages do: - java has try-with-resources statement which is the nearest equivalent of haskell's "bracket". It uses the option #1 (rethrow the original exception) - in c++ it is common to use RAII for resource management, so someone's destructor performs resource cleanup. But if destructor throws exception during stack unrolling, the program is terminated (option #2) I prefer #2 because suppressing exception is a really bad idea. What is your choice? And the related thing. Release action should not use any interruptible action.
Categories: Offsite Discussion

Newbie trying to install yesod

Haskell on Reddit - Sun, 07/06/2014 - 7:12am

Hi /r/haskell,

I'm very new to Haskell. I don't know if this is the right place to ask questions so bear with me. I'd like to install yesod (Ubuntu 12.04-64) via

cabal install yesod-platform yesod-bin --max-backjumps=-1 --reorder-goals (straight from yesod website)

Whenever I run this command, I get the following message:

Resolving dependencies... Killed

and yesod doesn't get installed. What's happening? How can I solve this?

BTW, is yesod a good framework? What do you guys mostly prefer; snap or yesod or something else?


submitted by threading
[link] [4 comments]
Categories: Incoming News