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.
My agenda for the day looks like this:
- Introduction to Haskell and motivational speech
- Hello world
- function definition
- function application
- IO and do-notation
- Common datatypes
- Type signatures
- Defining your own datatypes
- The Standard Library (with friends)
- A larger assignment combining all of the above
- 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]
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.
- 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.
[link] [27 comments]
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]
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.
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]
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