News aggregator

Getting Into Netwire

Haskell on Reddit - Sun, 03/15/2015 - 5:32am
Categories: Incoming News

chat #haskell

Haskell on Reddit - Sun, 03/15/2015 - 5:05am
Categories: Incoming News

Wrong .hsc file paths on Windows

haskell-cafe - Sat, 03/14/2015 - 9:08pm
Hello, I was trying to port some of my code to Windows. I've installed GHC with MinGHC (https://github.com/fpco/minghc). Unfortunately some packages, namely zlib and network, won't install, with the same error: getModificationTime cannot locate a file like CodecCompressionZlibStream.hsc or NetworkSocketTypes.hsc. With zlib, I figured out I just need to change mentions of "Codec/Compression/(...)" adding two slashes instead of one. Now with network I'm stuck, I can't find where the path was set at all. Is there some step I should have done prior to installation that would get the paths right? Best regards, Marcin Mrotek
Categories: Offsite Discussion

Language extensions

Haskell on Reddit - Sat, 03/14/2015 - 3:26pm

One thing I am having a little trouble understanding is the number of language extensions in Haskell. Lens requires templates. Then there is OverloadedStrings. Is there any source that can explain the different extensions out there, what they do, and whether they are "OK" to use? Is there a reason that these extensions have not been merged into Haskell?

submitted by tempforfather
[link] [39 comments]
Categories: Incoming News

Why are ADTs necessary?

Haskell on Reddit - Sat, 03/14/2015 - 1:04pm

As I understand it, GHC Haskell compiles a lot of constructs out, ending up with a very simple language, Core. For example, typeclasses are compiled out, and the dictionaries are passed around explicitly.

I was wondering why Algebraic Data Types are not also compiled out. This would make Core simpler. An ADT like

data X = X1 Int | X2 Bool Int

could be represented as this type:

(Int -> r) -> (Bool -> Int -> r) -> r

and then pattern matching could be compiled to function application.

The two things that occur to me, as possible reasons why this is not done, are the resulting types being recursive, and possible difficulties with optimization.

The List type, for instance, would have to turn into a function with this type:

type List a = r -> (a -> List a -> r) -> r

This is a recursive type, and isn't allowed in Haskell; but recursive types aren't intractable or anything, they are supported in ocaml with the -rectypes flag.

The second issue is optimization: Just 5 can be stored and accessed as a very simple binary representation, something like {0x0001, 0x0005}. The equivalent without ADTs, (\f g -> g 5), would probably have a more complicated representation, unless special optimizations were applied to these kinds of expressions.

Is one of these issues the main reason that ADTs are kept even at the Core level? Or is it something else?

submitted by jpriestley
[link] [39 comments]
Categories: Incoming News

π-day

haskell-cafe - Sat, 03/14/2015 - 11:23am
Happy super pi day everybody! Henk-Jan van Tuyl
Categories: Offsite Discussion

repa parallelization results

haskell-cafe - Fri, 03/13/2015 - 6:23pm
https://gist.github.com/aeyakovenko/bf558697a0b3f377f9e8 so i am seeing basically results with N4 that are as good as using sequential computation on my macbook for the matrix multiply algorithm. any idea why? Thanks, Anatoly
Categories: Offsite Discussion

Generalizing map?

libraries list - Fri, 03/13/2015 - 10:32am
A dozen of functions like concat, foldr, mapM, have been generalized through BBP. Then, why do we leave `map` just for lists? Obviously `map` can be generalized, so map :: Functor f => (a -> b) -> f a -> f b map = fmap The current definition of `map` looks too special to be a special case of mapM (map f = runIdentity . mapM (Identity . f)). _______________________________________________ Libraries mailing list Libraries< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries
Categories: Offsite Discussion

Proposal: Export cycleN from Data.Sequence

libraries list - Wed, 03/11/2015 - 4:14pm
Yesterday I rewrote `*>` for Data.Sequence (again), using an internal function cycleN :: Int -> Seq a -> Seq a The name of the function is based on that of Data.Sequence.iterateN. cycleN takes a sequence and cycles it as many times as requested: cycleN 0 $ fromList [1,2] = [] cycleN 5 $ fromList [1,2] = [1,2,1,2,1,2,1,2,1,2] The function is written to maximize sharing in the result sequence and to minimize construction time. Specifically, cycleN n xs should take something like O(|xs| + log n) space (of which all but O(log |xs| + log n) is shared with the structure of xs) and O(log |xs| + log n) time. With current (on GitHub) Data.Sequence exports, the only way to get this functionality with these time and space bounds is to combine replicate with *> : cycleN n xs = replicate n () *> xs This strikes me as a bit unpleasant. David
Categories: Offsite Discussion

-staticlib flag for building standalone static libraries producing very large libraries

glasgow-user - Sat, 03/07/2015 - 1:18pm
Hi all, Can anyone explain the following problem I'm having? I'm currently writing a game in Haskell. When I produce a plain old executable (for local testing) it's about 23M. However, when I create a static lib using the -staticlib flag it is 54M. Why the discrepancy? Sean _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users< at >haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
Categories: Offsite Discussion

New gtk2hs 0.12.4 release

gtk2hs - Wed, 11/21/2012 - 12:56pm

Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!

~d

Categories: Incoming News