News aggregator

Help on simpleHttp in Network.HTTP.Conduit problem

haskell-cafe - Wed, 01/22/2014 - 12:10am
I copied and pasted some html parsing demo source from FP School. While the code works on the FP demo site (in the IDE), I get the following error on my Windows 7 64 bit: InternalIOException getAddrInfo: does not exist (error 10093). Thanks _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Functional Jobs: Haskell Developer at Zalora (Full-time)

Planet Haskell - Tue, 01/21/2014 - 9:56pm

Full-time Position in Pure Haskell

ZALORA was founded in early 2012, offering clothes and accessories online in 7 Southeast Asian countries. It has grown steadily, reaching its millionth order in May 2013. We're now looking to double the size of our Haskell team.

The Haskell team works in parallel to our existing PHP developers. Your job will be to disassemble our legacy LAMP architecture (PHP, MySQL, Memcache, Solr) and build a Haskell-based service-oriented architecture in its place. This means working across the full stack, from system-level tools to web-based interfaces, depending on your expertise and area of interest.

Most of the team is here in Singapore. We help with relocation but allow remote work as well.

Our Development Philosophy

  • Build modular and simple systems.
  • Apply purely functional principles, even outside of Haskell code.
  • Build properly, however long it takes (no deadlines).


  • No regular hours, no dress code, no status report meetings.
  • Freedom to make technical choices and influence the architecture.
  • Release your code as Open Source—if you can generalize it.


We will hire almost purely based on your code quality and experience. Experience with functional programming is a must.

Send us:

  • Your Github profile or code samples AND/OR
  • The code for the selection task below. We promise feedback within 72 hours.


Write a FastCGI or HTTP server in Haskell that provides a restful API for managing an inventory of shoes:

  • POST new shoes as a JSON body, with attributes "description", "color", "size", and "photo". The "photo" attribute should be a base-64 encoded string representing a JPEG image (think "data URI"). For example, {"description": "SADIE Faux Suede Heels with Bow", "color": "red", "size": "35", "photo": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB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qx6VDPbg9yR7wvjwmLSqSlu2zdtWpKlZwxMSiQ2PsOEq/cnWvZvhLXfPhsQHNzWDT2HFOtsrgLUkKPurt80DP31BMMgIwdlpMfaW2RytqYTpd5gt8uozg/K9PeH1uBeO4uxDU+7JaaoyxKMal1IvIcekR0oTkOkKKu9CypHrCVYSD6shRa7/AKP+lxXSxZVWoi7nkXM7UpglrUqMIzTJCAnCG+9fJxyrPOE8DHLU9uQBlZhc5Yp6yWWHGlxyMDA39lvzA0wNNNKVYnGuONNNCEOmmmhC/9k="}
  • GET a shoe as an HTML page listing the shoe details, where the photo is served as an <img> tag with "src" pointing to a path on the local filesystem (i.e. the photo must be accessible as a local file, not as a data URI).
  • GET a list of shoes as an HTML page with hyperlinks to all available shoes.

Get information on how to apply for this position.

Categories: Offsite Blogs

Philip Wadler: Craftsman or Scientist?

Planet Haskell - Tue, 01/21/2014 - 9:19pm
More from Dijkstra (see previous entry), this time on whether computing is a craft or a science. Of course, it is both. Spotted by Sebastian Fisher.
My somewhat elliptic title refers, of course, to the programmer; so much you may have guessed. What, in all probability, you could not have guessed, is that I have chosen to use the words "craftsman" and "scientist" in a very specific meaning: they have been chosen to characterize the results of two extreme techniques of education, and this luncheon speech will be devoted to a (be it short) discussion of their role in the education of programmers, in the teaching of programming. For the transmission of knowledge and skills both techniques have been used side by side since many centuries.
Categories: Offsite Blogs

Philip Wadler: Dijkstra on Haskell and Java

Planet Haskell - Tue, 01/21/2014 - 9:07pm
A letter from Edsgar Dijkstra, written in 2001, argues that Haskell, not Java, should be used to teach introductory programming at the University of Texas. Blogged by Chris Done, spotted by Shayan Najd.
Colleagues from outside the state (still!) often wonder how I can survive in a place like Austin, Texas, automatically assuming that Texas’s solid conservatism guarantees equally solid mediocrity. My usual answer is something like “Don’t worry. The CS Department is quite an enlightened place, for instance for introductory programming we introduce our freshmen to Haskell”; they react first almost with disbelief, and then with envy —usually it turns out that their undergraduate curriculum has not recovered from the transition from Pascal to something like C++ or Java.
Categories: Offsite Blogs

Philip Wadler: A TED talk about what's wrong with TED talks

Planet Haskell - Tue, 01/21/2014 - 8:52pm
<object class="BLOGGER-youtube-video" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=",0,40,0" data-thumbnail-src="" height="266" width="320"><param name="movie" value=";source=uds"/><param name="bgcolor" value="#FFFFFF"/><param name="allowFullScreen" value="true"/><embed allowfullscreen="true" height="266" src=";source=uds" type="application/x-shockwave-flash" width="320"></embed></object>I enjoy well-presented talks---not least so I can steal ideas about how to present well for my own talks---and TED is a great source of these. My ambition is to present at TED one day. Nonetheless, this analysis points out an interesting problem with TED. My ambition is unchanged and I'll keep watching the talks, but perhaps with a more skeptical eye. Spotted via Boing Boing.
Categories: Offsite Blogs

Philip Wadler: The Ziebell projection of the world: 30 people's sketches combined

Planet Haskell - Tue, 01/21/2014 - 8:12pm
Spotted on Boing-Boing.
Zak Ziebell, then a 17-year-old San Antonio senior, challenged 30 people to sketch a map of the world, then combined them into a vague smudge. Then he produced this unnervingly realistic map of the alternative Earth lurking in his subjects' collective memories.
Categories: Offsite Blogs

How to work around blocking in an unsafe FFI call?

Haskell on Reddit - Tue, 01/21/2014 - 5:09pm

I'm having a problem with an application I'm working on where sClose in Network.Socket blocks inside the call to close. Unfortunately I'm using Unix domain sockets which don't support any of the timeout socket options, at least on OS X. Functions like timeout don't work since the FFI call is unsafe. Is there anything that can be done to timeout a call like this outside of killing the entire process?

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

Associated patterns

haskell-cafe - Tue, 01/21/2014 - 12:31pm
Dear haskell-cafe, I've read in Reddit that pattern synonyms have been merged in GHC HEAD [ ]. I would like to know whether associated patterns, that is, patterns which come under the umbrella of a type class, have also been implemented. I think that associated patterns would fill the gap in difference of features between type classes and common data types. For plain data types, you can declare both functions and patterns (either via constructors or now via pattern synonyms). However, you can only declare functions (either term-level or type-level) in type classes. This means that the pattern match mechanism, very useful to get clear code, is not useful if you want to use type classes. Alejandro. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

Haskell IO, how to read numbers?

Haskell on Reddit - Tue, 01/21/2014 - 6:54am

I'm really new to haskell and I really don't understand IO. All I want to do is read in a number from the user and print out the successor of that number. Something like this:

main = do putStrLn "What number do you want to find the sqrt of? : " name <- getLine print $ succ name

I've been reading and i've found one persons explanation:

prompt :: (Read a) => String -> IO a prompt s = putStr s >> getLine >>= return . read triArea :: (Fractional a) => a -> a -> a triArea base height = (base * height) / 2 main :: IO () main = do base <- prompt "The base? " height <- prompt "The height? " let area = triArea base height putStrLn $ "The area of that triangle is " ++ show (area :: Float)

Which to be completely honest doesn't make any sense to me. I looked up >> and >>= on Hoogle, but I don't understand the content.


Thanks everyone, I got it to work!

prompt x = do putStrLn x number <- getLine return number main = do number <- prompt " Please input a number: " print $ succ ( read number :: Int) submitted by yyttr3
[link] [18 comments]
Categories: Incoming News

ghc-mod list: cannot satisfy -package cairo

haskell-cafe - Tue, 01/21/2014 - 5:44am
I'm receiving an error from ghc-mod in my cabal sandbox: %./.cabal-sandbox/bin/ghc-mod list Dummy:0:0:Error:<command line>: cannot satisfy -package cairo (use -v for more information) The obvious potential problem is that cairo isn't installed. However, %cabal repl Preprocessing executable 'Notation' for Notation- GHCi, version 7.6.3: :? for help ... Prelude Main> import Graphics.Rendering.Cairo Prelude Graphics.Rendering.Cairo Main> My cabal file includes: build-depends: base >=4.6 && <4.7, mtl >=2.1 && <2.2, containers >=0.4 && <0.5, cairo >= 0.12 && <= 0.13 I'm on OSX 10.9.1. I had to point cairo to gcc-4.9 instead of clang to make it compile. Where else can I look for the problem?
Categories: Offsite Discussion

MissingH fails to compile

haskell-cafe - Tue, 01/21/2014 - 3:54am
Dear Haskell developers, I am trying to build a current version of git-annex, and stumble over a compilation failure of one of its dependencies, MissingH. I am using GHC 7.4.2 and Cabal, both bootstrapped on RHEL 5.x/6.x using a helper makefile [1] that has worked fine so far. The command to install git-annex is cabal install git-annex-5.20140108 --flags=-assistant --flags=-dbus --flags=-webapp --flags=-webdav --flags=-xmpp The build log for MissingH- is attached. I would be glad for any pointers on how to resolve this issue. Thanks, Peter [1] Building MissingH- Preprocessing library MissingH- [ 1 of 47] Compiling System.Console.GetOpt.Utils ( src/System/Console/GetOpt/Utils.hs, dist/build/System/Console/GetOpt/Utils.o ) [ 2 of 47] Compiling System.Debian ( src/System/Debian.hs, dist/build/System/Debian.o ) src/System/Debian.hs:31:1: Warning: Module `System.Cmd' is deprecated: Use "System.Proc
Categories: Offsite Discussion