Welcome to issue 169 of the HWN, a newsletter covering developments in the Haskell community. This release covers the week of February 6 - 12, 2011.

Congrats to Bryan O'Sullivan and Mark Lentczner for pulling off a successfull BayHac 2011!

#### Announcements

Joao Fernandes sent out a call for papers for the 4th International Conference on Software Language Engineering to be held in Braga, Portugal, 3-6 July 2011.

Bas van Dijk annouced version 0.1 and version 0.2 of his monad-control library. "monad-control is a rewrite of monad-peel than uses CPS style operations and exploits RankNTypes language extensions to simplify and speed up most functions."

Gregory Collins and the Snap team proudly announced the release of Snap 0.4 "containing a whole bunch of nifty new features."

Peter Scott announced pwstore, a library that aims to "handle all the details of password storage for you, in a way that should be so easy to use that there's no reason not to use it."

Bas van Dijk released case-insensitive 0.1. "The package provides the module Data.CaseInsensitive which exports the CI type constructor which can be parameterised by a string-like type... Comparisons of values of the resulting type are then insensitive to cases."

Ryan Newton released a package to do accelerated AES and RNG.

Brent Yorgey sent in a second call for submissions to the Monad.Reader -- special poetry and fiction edition.

John Lato released version 3.0.1 of ListLike, which "provides polymorphic functions with Data.List-style api for many different data types, including list, arrays, and bytestrings.

John also released version 0.7.0.2 and 0.8.0.1 of iteratee, after discovering a memory leak which affects all current versions of iteratee. He states that he would "strongly encourage all users of earlier versions to upgrade to one of these releases."

Ganesh Sittampalam and the darcs team are pleased to announce version 2.5.1, a minor upgrade for the 2.5 release. "The main focus of this release is support for the GHC 7.0 series and the upcoming February 2011 Haskell Platform, but the release also includes bug fixes and minor usability improvements."

Trystan Spangler announced the release of hspec: Behavior Driven Development for Haskell. "hspec ties together requirements and code that verifies the requirements are met. The verifying code can be a boolean expression, a QuickCheck property, or an explination of why it's pending. The requirements can then be turned into documentation of what the code does and what remains to be implemented."

Wren Ng Thornton announce bytestring-trie 0.2.3, a "long awaited release for efficient finite maps from (byte)strings to values."

Brent Yorgey would like to invite you to save the date for the Haskell hackathon in Philadelphia, July 29-31.

#### Quotes of the Week

*smerdyakov:*Some might argue that you can derive False from a sentence containing both "dependent types" and "contract programming."*Einstein:*Make everything as simple as possible, but not simpler.*Einskell:*Make everything as monad as possible, but not monadder.*kmc:*it's important to show that Haskell is usable not just for useless maths, but also for real-world tasks such as rendering teapots*ddarius:*Attempting to join #not-not-math sent me to #math. Freakin' Boole.*gwern:*[quoting a hypothetical edwardk] 'I HAVE CONSUMED YOUR KNOWLEDGE; LEAVE ME LEST I CONSUME YOUR FLESH AS WELL'*monochrom:*@let germanize = concat . words

#### Top Reddit Stories

*Announcing: Snap Framework v0.4*: From (snapframework.com), scored 40 with 3 comments. Read on reddit or the original post.*Haskell Summers of Code retrospective (updated for 2010)*: From (gwern.net), scored 31 with 7 comments. Read on reddit or the original post.*How to write type-level lambda-abstractions at the value level*: From (haskell.org), scored 26 with 7 comments. Read on reddit or the original post.*Storing passwords securely: don't roll your own*: From (finger-tree.blogspot.com), scored 25 with 22 comments. Read on reddit or the original post.*#haskell-game & Haskellers Game Interest Group*: From (self.haskell), scored 25 with 3 comments. Read on reddit or the original post.*Type class generics to be replaced in GHC 7.2 or 7.4*: From (haskell.org), scored 24 with 2 comments. Read on reddit or the original post.*What can I do with Haskell?*: From (self.haskell), scored 22 with 33 comments. Read on reddit or the original post.*There seems to be lots of interest in SMT solvers in the Haskell community these days, so I started ##smt on freenode*: From (self.haskell), scored 20 with 6 comments. Read on reddit or the original post.*darcs 2.5.1 released*: From (lists.osuosl.org), scored 16 with 0 comments. Read on reddit or the original post.*monad-control*: From (mail-archive.com), scored 11 with 2 comments. Read on reddit or the original post.

#### Top StackOverflow Answers

- How does Data.MemoCombinators work?
*votes: 20*

This library is a straightforward combinatorization of the well-known technique of memoization. Let's start with the canonical example: fib = (map fib' [0..] !!) where fib' 0 = 0 fib' 1 = 1 fib' n = fib (n-1) + fib (n-2) I interpret what you said to mean that you know how and why this works. So I'll focus on the combinatorization. We ... - What's similar to fmap for monadic values?
*votes: 16*

pelotom's answer is the straightforward one. But not the fun one! sequence is the Haskell function that one can think of as flipping the order of type constructors between a list and a monad. sequence :: (Monad m) => [m a] -> m [a] Now what you want is, so to speak, to flip the order of type constructors between a Maybe and a monad. Data.Traversable ... - Does there exist a monad instance for Data.Map / Data.IntMap?
*votes: 15*

Is there any particular reason you want to avoid using monad transformers? if you get the MaybeT package from Hackage you can achieve what you want like this: import Control.Monad import Control.Monad.Maybe import Control.Monad.State import qualified Data.Map as Map type MapM k v a = MaybeT (State (Map.Map k v)) a lookupM k = MaybeT $ Map.lookup k `liftM` ... - How to split a string in Haskell?
*votes: 11*

There is a package for this called split. cabal install split Use it like this: ghci> splitOn "," "my,comma,separated,list" ["my","comma","separated","list"] It comes with a lot of other functions for splitting on matching delimiters or having several delimiters. - Haskell (n+1) in pattern matching
*votes: 10*

It's a specific case of what is called "n+k patterns", which is generally disliked, and will be has been removed from the language. See here for more information. Here is a good note on n+k patterns, which quotes the following from the Haskell 98 Report (emphasis mine): Matching an n+k pattern (where n is a variable and k is a positive integer ... - Setting upper limit to the input set according to the output function
*votes: 10*

The check fib x < 1000000 in the list comprehension filters away the fib x values that are less than 1000000; but the list comprehension has no way of knowing that greater values of x imply greater value of fib x and hence must continue until all x have been checked. Use takeWhile instead: takeWhile (< 1000000) [ fib x | x <- [0..35]]

#### Top StackOverflow Questions

- How does Data.MemoCombinators work? (
*votes: 13, answers: 4*) read - How to best synchronize game engine and network server in Haskell? (
*votes: 10, answers: 3*) read - How to choose right Haskell C type? (
*votes: 9, answers: 1*) read - How to split a string in Haskell? (
*votes: 9, answers: 5*) read - Haskell (n+1) in pattern matching (
*votes: 7, answers: 1*) read

#### About the Haskell Weekly News

To help create new editions of this newsletter, please send
stories to `dstcruz@gmail.com`

. I'm in dire need of
finding good "quotes of the week". If you happen to come across
any, please don't hesitate to send it along.

Until next time,

Daniel Santa Cruz

## 1 comment:

> # How to split a string in Haskell? votes: 11There is a package for this called split. cabal install split Use it like this: ghci> splitOn "," "my,comma,separated,list" ["my","comma","separated","list"] It comes with a lot of other functions for splitting on matching delimiters or having several delimiters.

There seems to be a format issue with the Stack Overflow entries, where there's no space between the vote count and description.

Post a Comment