News aggregator

Making GHCi awesomer?

Haskell on Reddit - Sat, 10/18/2014 - 9:59am
Categories: Incoming News

Using phantom types for specifying algorithmic behaviour?

Haskell on Reddit - Fri, 10/17/2014 - 10:42pm

I'm wondering if there has been anything similar done, and if you have any specific thoughts about using such a pattern, and the implicit reliance on using typeclasses to encode "behaviour".

Code sample to illustrate what I'm thinking of

{-# Language EmptyDataDecls, FlexibleInstances #-} module Algorithmic where import Data.Foldable import Data.Monoid data LeftFold data RightFold data Tree b a = Empty | Leaf a | Node (Tree b a) a (Tree b a) deriving Show instance Functor (Tree b) where fmap f Empty = Empty fmap f (Leaf a) = Leaf (f a) fmap f (Node l c r) = Node (fmap f l) (f c) (fmap f r) instance Foldable (Tree LeftFold) where foldMap f Empty = mempty foldMap f (Leaf x) = f x foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r instance Foldable (Tree RightFold) where foldMap f Empty = mempty foldMap f (Leaf x) = f x foldMap f (Node l k r) = foldMap f r `mappend` f k `mappend` foldMap f l sample1 :: Tree b Int sample1 = Node (Node (Leaf 1) 2 (Leaf 3)) 4 (Node (Leaf 5) 6 Empty) test1 = Data.Foldable.foldr (:) [] (sample1 :: Tree LeftFold Int) test2 = Data.Foldable.foldr (:) [] (sample1 :: Tree RightFold Int) submitted by alt_account10
[link] [3 comments]
Categories: Incoming News

beginnners book

haskell-cafe - Fri, 10/17/2014 - 7:14pm
Hello, What is a good book to learn Haskell with a lot of exercises so I can check if I understand everything right ? Roelof
Categories: Offsite Discussion

A neat trick for GHCi

Haskell on Reddit - Fri, 10/17/2014 - 6:16pm
Categories: Incoming News

2^770000 triggers Bus Error?

haskell-cafe - Fri, 10/17/2014 - 4:46pm
Running ghci under OSX I am seeing the following behavior: Prelude> 2^750000 {... lots of digits...} Prelude> 2^760000 Segmentation Fault: 11 Prelude> 2^770000 Bus Error: 10 and I'm curious why this happens. More details: $ ghci --version The Glorious Glasgow Haskell Compilation System, version 7.8.3 I'm using the 64-bit version of the Haskell Platform (x86_64-darwin-7.8.3). _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Erik de Castro Lopo: Haskell : A neat trick for GHCi

Planet Haskell - Fri, 10/17/2014 - 4:16pm

Just found a really nice little hack that makes working in the GHC interactive REPL a little easier and more convenient. First of all, I added the following line to my ~/.ghci file.


All that line does is define a GHC_INTERACTIVE pre-processor symbol.

Then in a file that I want to load into the REPL, I need to add this to the top of the file:


and then in the file I can do things like:

#ifdef GHC_INTERACTIVE import Data.Aeson.Encode.Pretty prettyPrint :: Value -> IO () prettyPrint = LBS.putStrLn . encodePretty #endif

In this particular case, I'm working with some relatively large chunks of JSON and its useful to be able to pretty print them when I'm the REPL, but I have no need for that function when I compile that module into my project.

Categories: Offsite Blogs

Neil Mitchell: Fixing Haddock docs on Hackage

Planet Haskell - Fri, 10/17/2014 - 2:49pm

Summary: A few weeks ago Hackage stopped generating docs. I have a script that generates the docs, and also fixes some Haddock bugs.

Update: The Haddock documentation generators are running once again, but may be somewhat behind for a little while. A few weeks ago Hackage stopped generating documentation, so if you look at recently uploaded pages they tend to either lack docs, or have very alert maintainers who did a manual upload. I've packaged up my solution, which also fixes some pretty annoying Haddock bugs. Given that I can now get docs faster and better with my script, I'll probably keep using it even after Haddock on Hackage gets restarted.

How to use it

  • You are likely to get better results if you always install the packages you use with documentation.
  • Ensure you have tar, curl, cp and cabal on your $PATH.
  • cabal update && cabal install neil
  • Make a release, don't touch any other code, then make sure you are in the project directory.
  • neil docs --username=YourHackageUsername
  • Type in your Hackage password at the prompt.

And like that, your docs are online. To see an example of something that was generated with this process, look at Shake.

What I fixed

I automated the process using scripts originally taken from the lens library, supplemented with suggestions from Reddit. I then do a number of manual fixups.

  • Haddock now makes cross-module links where it doesn't know what the target is default to types. Concretely, if I write 'Development.Shake.need' in Haddock it generates a link to #t:need, which doesn't exist, when it should be #v:need - I fix that.
  • Update: fixed in Haddock 1.14 or above, as per this ticket.
  • On Windows, if you use CPP and multiline bird-tick (>) Haddock blocks you get a blank line between each line. I fix that.
  • If you follow some of the simpler scripts links outside your package won't work (or at least, didn't for me). I fix that.

The neil tool

The neil tool is my personal set of handy Haskell scripts. I make all my releases with it (neil sdist), and do lots of checks that my packages conform to my rules (neil check). I also use it for driving my Travis instances. It's in fairly regular flux. Until now, I've always kept it in Darcs/Git and never released it - it's personal stuff tuned to how I work.

You might also notice that neil provides a library. Don't use that, I intend to delete it in a few weeks. Update: library removed.

Categories: Offsite Blogs

visual editing of haskell code for computer music

Haskell on Reddit - Fri, 10/17/2014 - 2:45pm

Hi! I recently stumbled over this article: Visual Haskell: A First Attempt (H. John Reekie, 1994)

It proposes a graphical language (called "visual haskell") isomorphic to a subset of haskell. This graphical language is inspired by well known dataflow languages used as tools for computer music (e.g. puredata). It also points out some analogies between the functional programming paradigma and the control flow paradigma.

I find the idea extremlely appealing - I wonder if there would be a way to create a tool that allows for graphical editing of haskell programs by exploiting the analogies between the functional programming paradigm and dataflow graph diagrams. Would such a tool be an adequate solution to create computer music (or more general: for modeling signal processing graphs), like puredata?

so I started to research about:

  • digital (audio) signal processing using haskell
  • existing tools for making computer music using haskell

3 Names seem to be relevant: H. John Reekie, Henning Thielemann, Paul Hudak.

These are the articles I found so far: found at : found at found at : * [Haskell School Of Music - From Signals to Symphonies (Paul Hudak, ver. 2.6 vom Januar 2014)]( These are the existing tools/libraries to create computer music using haskell I found so far:
  • Euterpea:

    • successor of Haskore and HasSound
    • computer music library proposed by the paper "Haskell School Of Music - From Signals to Symphonies" (Paul Hudak)
  • Synthesizer

    • library for digital signal processing as proposed by the paper "Compiling Signal Processing Code embedded in Haskell via LLVM" (Henning Thielemann)
  • dsp

    • another library for signal processing by Henning Thielemann?

Suggestions about articles to read, persons to get in touch with, tools to take a look on would be greatly appreciated.

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

Haskell software engineering master thesis

haskell-cafe - Fri, 10/17/2014 - 11:07am
Hi, everyone! I'm about to write a software engineering/management master thesis at the IT University of Gothenburg, and I'm considering to do research into the Haskell world. It should probably be in one of the following five fields: empirical software engineering, requirements engineering, software architecture, model-driven engineering or quality management. The focus should probably be more towards an empirical study, rather than something more computer science-related. It should also add to general body of knowledge, and not be too tied to, for example, a specific implementation. Does anyone have any suggestions of relevant topics that I could write about, or perhaps some related papers that I could read? Thanks! Warm regards, Jon Kristensen _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

ICFEM 2014, Luxembourg, 3-7 November 2014: Last Call for Participation

General haskell list - Fri, 10/17/2014 - 10:45am
16th International Conference on Formal Engineering Methods ICFEM 2014, Luxembourg, 3-7 November 2014 Last Call for Participation ---------------------------------------- The 16th International Conference on Formal Engineering Methods (ICFEM 2014) will be held at the Melia Hotel in Luxembourg, Luxembourg from 3rd November to 7 November 2014. Since 1997, ICFEM has been serving as an international forum for researchers and practitioners who have been seriously applying formal methods to practical applications. Highlights: ---------------------------------------- + Keynote speakers: Nikolaj Bjorner (Microsoft Research), Lionel Briand (University of Luxembourg) and Vincent Danos (University of Edinburgh) + The conference is now available + Panel discussion on November 4th: Are Formal Engineering Methods and Agile Methods Friend or Enemy? + Two affiliated workshops FTSCS 2014 and SOFL+MSVL. PC Chairs ---------------------------------------- + Steph
Categories: Incoming News

Neil Mitchell - Downloads - Fri, 10/17/2014 - 6:08am
Categories: Offsite Blogs

Neil Mitchell - Downloads - Fri, 10/17/2014 - 6:08am
Categories: Offsite Blogs


haskell-cafe - Fri, 10/17/2014 - 3:49am
Hi, Has anybody tried GHC on Yosemite? I cannot afford to do it by myself this time. So, I would like to know. --Kazu
Categories: Offsite Discussion

Best way to Introduce FP into a dev team with many C,C++ and Java developers?

haskell-cafe - Fri, 10/17/2014 - 3:00am
Hi, Recently our development team had decided to attempt using Haskell or Scala as one of our programming language. (We had hoped some of our problem will be addressed through taking advantage of some element of FP, like immutability and Rx) Most of our team members have fairly good knowledge of C, C++ and Java. And few of them, including myself, have been self-studying a FP language like Haskell and Scala since last year. Besides some early starters, functional programming is quite new to us. When we held a lecture on FP, we found many of our developers were struggling in grasping some idea of FP. They fumbled with writing functional programming style code. We kept on lecturing several times, but still not quite successful. It seems more difficult than it looks - thinking in functional programming way for the long time C, C++ and Java developers. Does anyone had an experience with initiating FP adoption into a large dev team without pain? Our development team has around 300+ people. Thanks. _______
Categories: Offsite Discussion