February 24, 2011

Haskell Weekly News: Issue 170

Welcome to issue 170 of the HWN, a newsletter covering developments in the Haskell community. This release covers the week of February 13 - 19, 2011.

Announcements

Simon Michael informed us of reviving of FunGEn as a community project. "FunGEn (Functional Game Engine) is a platform-independent, BSD-licensed, easy-to-install 2D game engine currently based on OpenGL and GLUT."

Alexander McPhail announced the release of vector-buffer. "It provides a buffer that can be turned into a Data.Vector.Storable. The mapM* functions map from the oldest element, not the first."

Mark P. Jones announce the availability of 2 openings for post-doctoral researches "to help design, develop, and apply a new strongly typed, pure functional language for systems programming."

Trystan Spangler made a second release of his Behavior Driven Development for Haskell, and the tool can now be found in Hackage!

Jeremy Shaw announce the release of Happstack 6. "We fully recomend that all Happstack users migrate to the new release."

Gregory D. Weber published a new release of Sifflet and sifflet-lib. "Sifflet is a visual, functional programming language and support system for students learning about recursion."

Johan Tibell announced the release of two new packages: unordered-containers (Efficient hashing-based container types), and hashable (Efficient hashing of common types).

Quotes of the Week

  • kmc: i started to read the "tutorial" and it was incomprehensible. makes the Gentle Introduction to Haskell look like Teach Yourself PHP in 24 Hours
  • ConorMcBride: Sometimes it's easier to search for good programs in the space of well typed programs, rather than in the space of ascii turds.
  • monochrom: best practice haskell is "go with your heart"
  • accel: one day, it was raining -- I was walking home -- I saw Knuth biking home, wearing a helmet, in the rain -- and I freaked out -- rain was hitting him like any other mortal ... it wasn't bounching off his aura of awesomeness

Top Reddit Stories

  • Type level natural numbers ... ready to merge into GHC mainline: From (hackage.haskell.org), scored 62 with 44 comments. Read on reddit or the original post.
  • Haskell Web Framework Happstack 6 Released: From (groups.google.com), scored 45 with 3 comments. Read on reddit or the original post.
  • Well-Typed is hiring: From (well-typed.com), scored 41 with 13 comments. Read on reddit or the original post.
  • Haskell is Better: slides from Mark Lentczner's talk at Ignite Silicon Valley: From (scribd.com), scored 40 with 43 comments. Read on reddit or the original post.
  • New, faster hashing-based containers library released: From (blog.johantibell.com), scored 40 with 6 comments. Read on reddit or the original post.
  • Disciple haskell dialect : strict evaluation as default , destructive update of data structures.: From (disciple.ouroborus.net), scored 35 with 25 comments. Read on reddit or the original post.
  • Yesod: Warp Speed Ahead: From (docs.yesodweb.com), scored 34 with 8 comments. Read on reddit or the original post.
  • Faster persistent data structures through hashing: From (blog.johantibell.com), scored 28 with 15 comments. Read on reddit or the original post.
  • Developing iPhone applications in Haskell — a tutorial: From (gergo.erdi.hu), scored 25 with 6 comments. Read on reddit or the original post.
  • An Introduction to Agda :: PDF: From (dl.dropbox.com), scored 24 with 4 comments. Read on reddit or the original post.

Top StackOverflow Answers

  • How to tell whether Haskell will cache a result or recompute it? votes: 17
    primes, in your code, is not a function, but a constant, in haskellspeak known as a CAF. If it would take a parameter (say, ()), you would get two different versions of the same list back if calling it twice, but as it is a CAF, you get the exact same list back both times;
    
    As a top-level definition, primes never gets out of scope, thus the head of the list ...
  • Specific type inference using uncurry function votes: 17
    This has nothing to do with ghci.  This is the monomorphism restriction being irritating.  If you try to compile the following file:
    
    add = uncurry (+)
    main = do
    print $ add (1,2 :: Int)
    print $ add (1,2 :: Double)
    
    You will get an error.  If you expand:
    
    main = do
    print $ uncurry (+) (1,2 :: Int)
    print $ uncurry (+) (1,2 :: Double)
    ...
  • Haskell: Unexpected output for expression [0, 0.1 .. 1] votes: 15
    This is a result of the imprecision of floating point values, it isn't particular to Haskell.  If you can't deal with the approximation inherent in floating point then you can use Rational at a high performance cost:
    
    > import Data.Ratio
    Data.Ratio> [0,1%10.. 1%1]
    [0 % 1,1 % 10,1 % 5,3 % 10,2 % 5,1 % 2,3 % 5,7 % 10,4 % 5,9 % 10,1 % 1]
    
    Just to hammer ...
  • valid haskell function names votes: 14
    From the Haskell report:
    Haskell uses the Unicode character set. However, source programs are currently biased toward the ASCII character set used in earlier versions of Haskell .
    Recent versions of GHC seem to be fine with unicode (at least in the form of UTF-8):
    ...
  • Haskell range notation to generate list. Unexpected output votes: 13
    The notation is meant to mimic the usual way to write simple sequences mathematics. The second element is not the step, but in fact the actual second element of the list.  The rest is linearly extrapolated from there.  Examples:
    
    [1,2..10] = [1,2,3,4,5,6,7,8,9,10]
    [1,3..10] = [1,3,5,7,9]
    [4,3..0]  = [4,3,2,1,0]
    [0,5..]   = [0,5,10,15,20,25,30,35...

Top StackOverflow Questions

  • How to tell whether Haskell will cache a result or recompute it? (votes: 11, answers: 1) read
  • How can one distribute Haskell programs to non-technical end users? (votes: 8, answers: 2) read
  • Haskell range notation to generate list. Unexpected output (votes: 8, answers: 2) read
  • Appropriate uses of Monad `fail` vs. MonadPlus `mzero` (votes: 8, answers: 2) read
  • Why does Haskell not have an I Monad (for input only, unlike the IO monad)? (votes: 8, answers: 3) read

About the Haskell Weekly News

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

Until next time,
Daniel Santa Cruz

No comments: