News aggregator

Future of DYNAMIC_GHC_PROGRAMS?

glasgow-user - Mon, 05/19/2014 - 1:50pm
I need to build GHC 7.8 so that Template Haskell will work without shared libraries (due to a shortage of space). I understand that this can be done by turning off DYNAMIC_GHC_PROGRAMS and associated build options. Is this possibility going to be kept going forward, or will it be deprecated once dynamic GHC is fully supported on all platforms? -- View this message in context: http://haskell.1045720.n5.nabble.com/Future-of-DYNAMIC-GHC-PROGRAMS-tp5749793.html Sent from the Haskell - Glasgow-haskell-users mailing list archive at Nabble.com.
Categories: Offsite Discussion

Any advice for my Haskell workshop?

Haskell on Reddit - Mon, 05/19/2014 - 1:24pm

I would love to hear some of your thoughts on this "introduction to Haskell" workshop I'm planning. I suspect some of you have experience as teachers/lecturers and knows a thing or two about teaching Haskell.

I have about 6 hours for the whole thing and my main goal is to get people interested enough that they will study Haskell themselves afterwards (and come to my next workshop :)

The participants are all experienced developers, but their understanding of functional programming ranges from novice to expert. And I can safely assume they are all novices in Haskell.

The guiding principles I have come up with so far is as follows: * Give some motivation for WHY they should endure the initial "pain" when learning Haskell * Compare language features to Java, C# and Javascript (because they're all familiar with at least one of those) * Short lectures of about 20-30 minutes followed by the participants getting their hands dirty by solving assignments related to the topic. Rinse and repeat 5-6 times * Don't wait with introducing IO - otherwise I fear their misconception of Haskell being unfit for real world applications will only be enforced. * Ideally have a lot of TAs around to help people who are stuck (... inside the IO monad) * Provide some words of advise for further learning (such as staying away from monad tutorials and don't get intimidated by mathy stuff)

My agenda for the day looks like this:

  1. Introduction to Haskell and motivational speech
  2. Functions
    • Hello world
    • function definition
    • function application
  3. IO and do-notation
    • putStrLn
    • getLine
  4. Datatypes
    • Common datatypes
    • Type signatures
    • Defining your own datatypes
    • Typeclasses
  5. The Standard Library (with friends)
  6. A larger assignment combining all of the above
  7. Wrap-up and advice for further exploration

... to sum up my questions: 1) Any thoughts on my guiding principles or the agenda? 2) Anything in particular you have noticed when teaching Haskell that I should be aware of? 3) Should I use GHCi or compile/run from a file?

Thank you ever so much for the feedback!

submitted by tobiasgw
[link] [5 comments]
Categories: Incoming News

In search of a working http client library

Haskell on Reddit - Mon, 05/19/2014 - 11:50am

Can somebody suggest a working http client library?

At this point I don't even care how clean and easy the API is to use. The only requirement is that it actually works.

All I need is to fetch a small (<1KB) JSON document from a server and extract a single field out of it. JSON decoding is working fine with aeson. It's the http part that's incredibly difficult to do.

Thanks.

TLDR:

  • Anything based on tls is unusable as it has a buggy implementation of wildcard certificate matching (this includes wreq, http-conduit, http-client).
  • Spawning curl is not an option because it may not be installed on the host.
  • http-streams works to my satisfaction.
submitted by qwfp
[link] [27 comments]
Categories: Incoming News

Making the encoding Haskell package compile withghc-7.8.2

haskell-cafe - Mon, 05/19/2014 - 10:51am
Hello. I use encodign in a Haskell application and I would like to have it working with ghc-7.8.2. So I am kindly asking to, if possible, update the encoding package[1] to be compilable with ghc-7.8.2. Currently it fails with the messages: [...] * Prepending /usr/lib64/ghc-7.8.2 to LD_LIBRARY_PATH /usr/bin/ghc -package Cabal-1.20.0.0 --make /tmp/portage/dev-haskell/encoding-0.7/work/encoding-0.7/Setup.hs -dynamic -o setup [1 of 8] Compiling Data.Static ( Data/Static.hs, Data/Static.o ) Data/Static.hs:39:28: Couldn't match expected type ‘Bool’ with actual type ‘Int#’ In the expression: eqWord# v (int2Word# 4294967295#) In the expression: if eqWord# v (int2Word# 4294967295#) then Nothing else (if (I# (word2Int# v)) > 1114111 then error (show (I# (word2Int# v)) ++ " is not a valid char (" ++ show (I# i) ++ ")") else Just (chr (I# (word2Int# v)))) /usr/bin/ghc -package Cabal-1
Categories: Offsite Discussion

Why do these two definitions have different types?

Haskell on Reddit - Mon, 05/19/2014 - 9:03am

I found a type discrepancy between two definitions which should be identical:

λ> let sumAll = map sum λ> :t sumAll sumAll :: [[Integer]] -> [Integer] λ> let sumAll' xs = map sum xs λ> :t sumAll' sumAll' :: Num b => [[b]] -> [b]

Interestingly, the point-free definition in a full let-expression does not get specialised:

λ> :t let sumAll = map sum in sumAll let sumAll = map sum in sumAll :: Num b => [[b]] -> [b]

So my question is why does the point-free definition get specialised to Integer? I tested this at ghc.io, not sure what GHC version they use.

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

Functional Jobs: Haskell Developer at skedge.me (Full-time)

Planet Haskell - Mon, 05/19/2014 - 8:34am

skedge.me is seeking a Haskell developer to improve and maintain our Snap-based web application stack.

skedge.me is committed to using the best tool for the job throughout our software stack. That includes a mixture of cutting-edge tools like Haskell and the Nix package manager as well as tried-and-true products like PostgreSQL and Linux. Your role will be to find, use, and create tools like these to build a robust and powerful software platform to serve our clients' needs.

This job requires that you be able to hit the ground running with Haskell. As part of your application, please submit a small to medium sized code sample (approximately 100 to 1000 lines) demonstrating your ability to write clear, concise, and efficient Haskell code, together with a brief English explanation of what the code does, how it works, and how to build and run it.

Your Haskell code is our primary consideration in reviewing your application. However, experience with PostgreSQL, Linux, NixOS, web server programming, Varnish, AWS or other similar technologies is a plus. It is also a plus if you are local to the NYC area, as our offices are located in Midtown.

Get information on how to apply for this position.

Categories: Offsite Blogs

How about an STM hash table implementation?

Haskell on Reddit - Mon, 05/19/2014 - 8:29am
Why TVar (HashMap (TVar a)) is bad

While this datastructure captures the updates to individual rows perfectly, it is awful for capturing the updates to the table structure. I.e., deleting or inserting a row marks the whole table as changed, so multiple transactions cannot be modifying the table structure concurrently. Now imagine dealing with a table of a million rows (e.g., in some database implementation). It is not scalable.

How to solve this

We need a data structure which will split the table into chunks in such a way that updating one chunk will not affect the other. This will allow multiple transactions to be effectively running on different chunks of the table concurrently without conflicts.

Hash Array Mapped Trie

Essentially HAMT is an implementation of a hash table, which distributes the data across multilevel arrays (or lists). For details there is a great paper about this data structure.

This approach turned out to be very efficient for implementing persistent maps in particular, so it got adopted in languages like Clojure, Scala and, of course, Haskell with the great "unordered-containers" library. It also seems to be a perfect candidate to implement STM hash table based on. Essentially all we need to change about its implementation is just place all nodes in TVars.

With this post I'd like to receive a criticism of the idea and related or alternative propositions.

submitted by nikita-volkov
[link] [37 comments]
Categories: Incoming News

Philip Wadler: The Greens, UKIP, and D'Hondt: Update

Planet Haskell - Mon, 05/19/2014 - 5:45am
Immediately after my preceding post, I spotted the above which makes the same point far more graphically. Via @Gary Dunion and Conor McBride/@pigworker.
Categories: Offsite Blogs

Philip Wadler: The Greens, UKIP, and D'Hondt

Planet Haskell - Mon, 05/19/2014 - 5:28am
<iframe allowfullscreen="" frameborder="0" height="315" src="http://www.youtube.com/embed/6CU3F3ToIIg" width="560"></iframe>

EU elections use the D'Hondt system, which means that if, say, your goal is to keep UKIP from electing a MEP from Scotland, your vote is, in a sense, three times more effective if you vote for Green then if you vote for the SNP or Labour—watch the video or follow the links (Wikipedia, European Parliament) to understand why.

If you wish to vote tactically, you need to know how the parties stand in the polls. Below is data for Scotland from two polls on 13--15 May, spotted via UK Polling Report. I'm voting my heart, with the Greens, but it's nice to know that it is also a tactically wise vote in opposition to UKIP.

YouGov ComRes Labour 31 16 SNP 30 40 Green 12 7 Conservative 10 21 UKIP 9 8 Lib Dem 7 5 Other 0 1
Categories: Offsite Blogs

[containers] Proposal: Change to the Data.Map Monoid

libraries list - Mon, 05/19/2014 - 1:05am
Hi, Currently the Monoid instance for Data.Map is implemented using union/unions, which are left biased. On key collision, it discards values from the right hand side of `mappend` - https://github.com/ghc/packages-containers/blob/bae098fb0a3994bc2b0ec3313004b40cd097ed8d/Data/Map/Base.hs#L341-L344 If you compare this with the Monoid for Maybe, it's like we're defaulting to First as the monoid instance for maps. A more useful instance, however very much a breaking change, would be to make the instance depend on a Monoid (or better yet, a Semigroup) for the values in the map: instance Monoid v => Monoid (Map k v) where mappend = unionWith mappend This lets us build up maps with values in a useful Monoid, and mappend them with gusto. Thoughts? - Nick Partridge Discussion period: 2 weeks. _______________________________________________ Libraries mailing list Libraries< at >haskell.org http://www.haskell.org/mailman/listinfo/libraries
Categories: Offsite Discussion