News aggregator

Neil Mitchell: November talks

Planet Haskell - Sun, 11/02/2014 - 3:31pm

Summary: I'll be talking at CodeMesh 2014 on 5th November and FP Days on 20th November.

I am giving two talks in London this month:

CodeMesh 2014 - Gluing Things Together with Haskell, 5th Nov

I'll be talking about how you can use Haskell as the glue language in a project, instead of something like Bash. In particular, I'll cover Shake, NSIS and Bake. The abstract reads:

A large software project is more than just the code that goes into a release, in particular you need lots of glue code to put everything together - including build systems, test harnesses, installer generators etc. While the choice of language for the project is often a carefully considered decision, more often than not the glue code consists of shell scripts and Makefiles. But just as functional programming provides a better way to write the project, it also provides a better way to write the glue code. This talk covers some of the technologies and approaches we use at Standard Chartered to glue together the quant library. In particular, we'll focus on the build system where we replaced 10,000 lines of Makefiles with 1,000 lines of Haskell which builds the project twice as fast. We'll also look at how to test programs using Haskell, how to replace ancillary shell scripts with Haskell, and how to use Haskell to generate installers.

FP Days 2014 - Building stuff with Shake, 20th Nov

I'll be giving a tutorial on building stuff with Shake. It's going to be less sales pitch, more how you structure a build system, and how you use Shake effectively. The abstract reads:

Build systems are a key part of any large software project, relied upon by both developers and release processes. It's important that the build system is understandable, reliable and fast. This talk introduces the Shake build system which is intended to help meet those goals. Users of Shake write a Haskell program which makes heavy use of the Shake library, while still allowing the full power of Haskell to be used. The Shake library provides powerful dependency features along with useful extras (profiling, debugging, command line handling). This tutorial aims to help you learn how to think about writing build systems, and how to make those thoughts concrete in Shake.

Categories: Offsite Blogs

Nomyx: win 10000 Blings!

Haskell on Reddit - Sun, 11/02/2014 - 1:43pm

Join us on Nomyx: www.nomyx.net
It's a unique game where you can change the rules of the game, while playing it.
Log in, and you'll understand better what the title means (check rule 44 proposed by me in the game)!

submitted by kaukau
[link] [8 comments]
Categories: Incoming News

Discussion: Arities of <*> and *> for Monad instances

libraries list - Sun, 11/02/2014 - 11:29am
http://hackage.haskell.org/package/base-4.7.0.1/docs/Control-Applicative.html says that The other methods have the following default definitions, which may be overridden with equivalent specialized implementations: u *> v = pure (const id) <*> u <*> v and If f is also a Monad, it should satisfy ... (<*>) = ap The (potential) trouble is that these have higher arities than is always natural. For example, it would seem reasonable to say (<*>) Just f = fmap f (<*>) Nothing = const Nothing and to replace the default definition of (*>) like so: (*>) a1 = (<*>) (id <$ a1) but these are not strictly equivalent because they have arity 1 instead of arity 2. Would such definitions be be better in some cases? If so, should we weaken the rules a bit? _______________________________________________ Libraries mailing list Libraries< at >haskell.org http://www.haskell.org/mailman/listinfo/libraries
Categories: Offsite Discussion

Help With Bindings

Haskell on Reddit - Sun, 11/02/2014 - 9:25am

I'm relatively new to Haskell and am trying to implement nim, I have written all the code but cannot for the life of me work out the type bindings, the code is long but I was hoping someone could explain to me what the bindings for each function are and why? Thanks.

nim :: ? nim = do putStrLn "Enter first player's name!" n1 <- getLine putStrLn "Enter second player's name!" n2 <- getLine putStrLn "Enter pile amounts, enter 0 to stop adding piles." ps <- getPiles [] w <- play n1 n2 ps f <- (w ++ " has won!") return f play :: ? play n1 n2 ps = do p <- (n1 ++ "'s Turn! \n") putStrLn p displayGame ps m <- getMove nps <- (takeAway ps (getFst m) (getSnd m)) if won ps == True then return n1 else play n2 n1 nps getPiles :: ? getPiles xs = do putStr "Enter amount in next pile : " x <- (read getLine) if x == 0 then do xs ++ [x] getPiles xs else xs getFst :: (Int,Int) -> Int getFst (x,_) = x getSnd :: (Int,Int) -> Int getSnd (_,x) = x

The bindings for other functions used are -

won :: [Int] -> Bool takeAway :: [Int] -> Int -> Int -> [Int] getMove :: IO (Int,Int) displayGame :: [Int] -> IO ()

I realize that this might be allot to ask but I have hit a dead end and my "teammates" are of no help.

submitted by con7con
[link] [22 comments]
Categories: Incoming News

Haskell on the JVM?

Haskell on Reddit - Sun, 11/02/2014 - 7:16am

This has been asked before here and here. It would be great to have a JVM backend for Haskell. Why is there no serious effort from the Haskell community to implement it?

submitted by dmz
[link] [35 comments]
Categories: Incoming News

runStateT :: StateT s a -> s -> m (a, s)

Haskell on Reddit - Sat, 11/01/2014 - 9:21pm

Anyone else feel that runStateT and friends (execState, runReader etc) would be better flipped? I always find myself writing flip runStateT, because I never need to parameterise the state variable and it's convenient to use multiline do syntax for the action. Just curious.

submitted by scottansan
[link] [18 comments]
Categories: Incoming News

How would you simplify this? Guards prevent better pattern matching. :(

Haskell on Reddit - Sat, 11/01/2014 - 2:49pm

Haskell people, any ideas on how I can refactor this code? : http://tinyurl.com/l38hdp3 I use a lot of fromJust and isNothing, which looks horrible, but I cannot pattern match on them because I'm using guards. Since I have a lot of guards that are kinda irregular, using nested ifs seemed worse. Not to mention that the order of the guards matters. I don't see how to pattern match the Maybe values. The current version works but it's ugly. I wonder what you'd do. (By the way, there are a lot of tests in the repo that you can run. The tests cover the requirements of Turkish syllabification) Thanks!

submitted by wavesofthought
[link] [14 comments]
Categories: Incoming News

Help building haskell application with cabal

Haskell on Reddit - Sat, 11/01/2014 - 2:06pm

Hello all! I am trying to build the program geordi (specifically the clang branch) which can be found here: https://github.com/Eelis/geordi/tree/clang when i run it though i get these errors: http://paste.ubuntu.com/8778876/ . I am on ubuntu 14.04 64 bit, and got ghc and cabal with apt-get. Any help would be appreaciated! thanks! (I tried fixing the errors myself but im more of an oop/structural language guy... functional languages scare me)

submitted by DTSCode
[link] [7 comments]
Categories: Incoming News

How to use randomized algorithm within theimplementation of pure data structures?

haskell-cafe - Sat, 11/01/2014 - 10:25am
Hi cafe, I'm currently implementing the data structure representing algebraic numbers. Implementing algebraic number arithmetic requires polynomial factorisation. Pure algorithm for factoring (Berlekamp's algorithm) is more expensive than the randomized one (Cantor-Zassenhaus algorithm) , so I want to use the latter algorithm. Since C-Z algorithm is a randomized algorithm, we have to have an access for random number generator when calculating algebraic number arithmetics e.g. writing Num instance for algebraic numbers. Here is the problem: how to pass-around random number generator throughout pure computaion? I think one immediate solution is to create global state with `newStdGen` and `unsafePerformIO` like below: ``` randSrc :: IORef StdGen randSrc = unsafePerformIO $ newIORef =<< newStdGen {-# NOINLINE randSrc #-} getRand :: IO Int getRand = atomicModifyIORef' randSrc (swap . next)
Categories: Offsite Discussion

Joachim Breitner: Can one recommend Debian stable to Desktop users?

Planet Haskell - Sat, 11/01/2014 - 8:52am

My significant other is running Debian stable on her laptop, and it has worked fine for quite a while. But since a week or two, she could not access her University IMAP account via Evolution. Obviously quite a showstopper!

Today I had a closer look, and my suspicion was that the University changed their SSL configuration due to the recent POODLE attack and that Evolution was incompatible with that. After some more searching, I found that Ubuntu had applied a patch, originally from Fedora, two weeks ago. For Debian, there is a bug report but no sign of action.

So I fetched the sources, applied the patch, built the package, installed it and things were working again. Yay for that! But this is obviously not the best way to handle such issues.

I know that Debian is volunteer driven and we often lack the manpower for certain things, so I don’t want to rant about this particular issue. I also continue to be a happy user of Debian unstable on my laptop, and Debian stable on my servers. But I seriously wonder: Can I really recommend Debian stable to users, for their laptops and desktops? If not, what are the alternatives? Ubuntu obviously comes to mind, having some full-time staff for such issues... But that would be giving up on promoting Debian as the universal operating system.

Update (2010-11-3): Laney just uploaded a fixed package. Thanks!

Categories: Offsite Blogs

A functional GUI library built from ground up?

Haskell on Reddit - Sat, 11/01/2014 - 3:24am

Coming to learn a functional programming which has much attention nowadays and also being mostly a GUI programmer I found a lot of libraries in Haskell (and other FP languages) which decorate an existing and popular choices for writing a cross-platform UI (Qt, Gtk, wx etc). Decoration happens in many possible styles be it FRP, FFI, whatever else I missed.

But I never found a more or less modern library which was built from ground up using an FP idioms and best practices.

I wonder why is it so? Is it because FRP is good for this but kinda not yet figured out exactly? Or is it because FP was used mainly in data manipulation or algorithmic tasks so far, but less in UI? Or some other reason?

Is it even possible to build such a library which would be modern, functional and provide a comprehensive set of widgets to work with? Is it just a question of manpower?

Or did I miss any existing effort to build such a library?

submitted by dimsuz
[link] [19 comments]
Categories: Incoming News

Debugging Wreq/http-client https requests

haskell-cafe - Sat, 11/01/2014 - 12:16am
I have a program that is POST'ing some data to a remote server. However, some part of the data I'm sending is wrong I believe. If this were plain http without encryption, wireshark would allow me to see the exact data being sent over the wire. However, with https it is encrypted. Is there an inbuilt way to debug requests sent by wreq or more likely, a way to output debug info for http-client? Alternatively, is there a way to use NSS support with either of these libraries: http://security.stackexchange.com/questions/35639/decrypting-tls-in-wireshark-when-using-dhe-rsa-ciphersuites Thanks in advance to all for your time.
Categories: Offsite Discussion