News aggregator

wren gayle romano: Dissertating, ahoy!

Planet Haskell - Thu, 04/07/2016 - 1:09am

Usually whenever we think about gradschool we think about the switch from "doing classwork, quals, etc" to "dissertating" is a single-step process, which we call "becoming a PhD candidate" (as opposed to being a PhD student). In practice there are over half a dozen steps. Filing the paperwork declaring your completion of classwork, quals, etc is just the first few. (Okay, easy enough) Then there's the prospectus, for the graduate school. (The what for the who now?) Then the forming of your research committee. (Right, okay) Then the proposal. (Wait, how is this different from the other thing?) Then the proposal defense. (Um, okay, but not every department requires this?) Plus a few other steps I'm surely forgetting.

As of yesterday, I am officially finally totally completely absolutely done with all the paperwork, and can finally get back to actually working on the thesis itself!

Categories: Offsite Blogs

Magnus Therning: Qt5+D-Bus+CMake, a complete example

Planet Haskell - Wed, 04/06/2016 - 6:00pm

Yesterday I started digging into Qt5 and D-Bus. I never found a complete example, so I put one together myself:

Categories: Offsite Blogs

Neil Mitchell: Github Offline Issues with IssueSync

Planet Haskell - Wed, 04/06/2016 - 2:33pm

For a while I've been looking for something to download the GitHub issues for a project. I do a lot of development work on a train with no internet, so referring to the tickets offline is very useful. I've tried lot of tools, in a very wide variety of languages (Ruby, Python, Perl, Javascript, PHP) - but most of them don't seem to work - and the only one I did manage to get working only gave a curses UI.

Finally, I've found one that works - IssueSync. Installing it worked as described. Running it worked as described. I raised tickets for the author and they fixed them. I even sent a pull request and the author discussed and merged it. It downloads all your issues to Markdown files in an issues directory. I then "list" my issues using:

head -n1 -q issues/*.md | grep -v CLOSED

It's simple and works nicely.

Categories: Offsite Blogs

accessing the RTS -M flag value from GHC.RTS.Flags

haskell-cafe - Tue, 04/05/2016 - 9:46pm
Given, import GHC.RTS.Flags main = do gcf <- getRTSFlags print (maxHeapSize (gcFlags gcf)) And running on x86-64 in GHC 7.10.3, $ ./ghcflags 0 $ ./ghcflags +RTS -M1M 256 $ ./ghcflags +RTS -M1024K 256 $ ./ghcflags +RTS -M4096K 1024 Is there anyway I can get access to the value stored in the -M flag and depend on that value being correct? I was not able find it in the user's guide or anywhere else for that matter. Thanks, Adam
Categories: Offsite Discussion

Text.Regex.matchRegex: Success is empty?

haskell-cafe - Tue, 04/05/2016 - 9:16pm
Esteemed Haskellers, It is working for me, but I am puzzled by the matchRegex function: > import Text.Regex > :i matchRegex matchRegex :: Regex -> String -> Maybe [String] -- Defined in ‘Text.Regex’ Searches that fail return Nothing: > matchRegex (mkRegex "z") "abracadabra" Nothing which makes sense. But why do searches that succeed return an empty list of Strings? > matchRegex (mkRegex "a") "abracadabra" Just [] >
Categories: Offsite Discussion

Documenting extensions

haskell-cafe - Tue, 04/05/2016 - 9:12pm
I'd like to believe the Haskell report is a bible. I learned H98 using the Prelude as a source of examples and Hugs as a testbed. That was a comfortable and rewarding combination. Later I discovered that by default GHC rejected almost all my report-conforming (H98 and H2010) code. Ironically, its website at the time asserted, "Haskell is a standard language." In fact, far from reflecting biblical authority, the de facto Haskell discussed in this cafe comes in some 2^99 flavors -- enough to use a different language for every run of the compiler for the life of the universe. Witness: ghc --supported-languages | grep -v '^No[A-Z]' | wc -l (99 is the answer for GHC 7.8.4. In fact not all combinations of -X options are legal, but you get the point.) Unfortunately there is no coherent discussion of all those Haskells. The extensions section of the GHC User Guide gives no formal syntax, often teaches semantics only by example, and is replete with sales pitches, partial analogies, inconsistent terminology, an
Categories: Offsite Discussion

Brent Yorgey: The network reliability problem and star semirings

Planet Haskell - Tue, 04/05/2016 - 7:28pm

In a previous post I defined the network reliability problem. Briefly, we are given a directed graph whose edges are labelled with probabilities, which we can think of as giving the likelihood of a message successfully traversing a link in a network. The problem is then to compute the probability that a message will successfully traverse the network from a given source node to a given target node.

Several commenters pointed out the connection to Bayesian networks. I think they are right, and the network reliability problem is a very special case of Bayesian inference. However, so far this hasn’t seemed to help very much, since the things I can find about algorithms for Bayesian inference are either too general (e.g. allowing arbitrary functions at nodes) or too specific (e.g. only working for certain kinds of trees). So I’m going to put aside Bayesian inference for now; perhaps later I can come back to it.

In any case, Derek Elkins also made a comment which pointed to exactly what I wanted to talk about next.

Star semirings and path independence

Consider the related problem of computing the reliability of the single most reliable path from to in a network. This is really just a disguised version of the shortest path problem, so one can solve it using Dijkstra’s algorithm. But I want to discuss a more general way to think about solving it, using the theory of star semirings. Recall that a semiring is a set with two associative binary operations, “addition” and “multiplication”, which is a commutative monoid under addition, a monoid under multiplication, and where multiplication distributes over addition and . A star semiring is a semiring with an additional operation satisfying . Intuitively, (though can still be well-defined even when this infinite sum is not; we can at least say that if the infinite sum is defined, they must be equal). If is a star semiring, then the semiring of matrices over is also a star semiring; for details see Dolan (2013), O’Connor (2011), Penaloza (2005), and Lehmann (1977). In particular, there is a very nice functional algorithm for computing , with time complexity (Dolan 2013). (Of course, this is slower than Dijkstra’s algorithm, but unlike Dijkstra’s algorithm it also works for finding shortest paths in the presence of negative edge weights—in which case it is essentially the Floyd-Warshall algorithm.)

Now, given a graph and labelling , define the adjacency matrix to be the matrix of edge probabilities, that is, . Let be the star semiring of probabilities under maximum and multiplication (where , since ). Then we can solve the single most reliable path problem by computing over this semiring, and finding the largest entry. If we want to find the actual most reliable path, and not just its reliability, we can instead work over the semiring , i.e. probabilities paired with paths. You might enjoy working out what the addition, multiplication, and star operations should be, or see O’Connor (2011).

In fact, as shown by O’Connor and Dolan, there are many algorithms that can be recast as computing the star of a matrix, for an appropriate choice of semiring: for example, (reflexive-)transitive closure; all-pairs shortest paths; Gaussian elimination; dataflow analysis; and solving certain knapsack problems. One might hope that there is similarly an appropriate semiring for the network reliability problem. But I have spent some time thinking about this and I do not know of one.

Consider again the simple example given at the start of the previous post:

For this example, we computed the reliability of the network to be , by computing the probability of the upper path, , and the lower path, , and then combining them as , the probability of success on either path less the double-counted probability of simultaneous success on both.

Inspired by this example, one thing we might try would be to define operations and . But when we go to check the semiring laws, we run into a problem: distributivity does not hold! , but . The problem is that the addition operation implicitly assumes that the events with probabilities and are independent: otherwise the probability that they both happen is not actually equal to . The events with probabilities and , however, are not independent. In graph terms, they represent two paths with a shared subpath. In fact, our example computation at the beginning of the post was only correct since the two paths from to were completely independent.

Graph reduction

We can at least compute the reliability of series-parallel graphs whose terminals correspond with and :

  • If consists of a single edge, return that edge’s probability.
  • Otherwise, is a composition of two subgraphs, whose reliabilities we recursively compute. Then:
    • If is a sequential composition of graphs, return the product of their reliabilities.
    • If is a parallel composition of two graphs with reliabilities and , return .

In the second case, having a parallel composition of graphs ensures that there are no shared edges between them, so and are indeed independent.

Of course, many interesting graphs are not series-parallel. The simplest graph for which the above does not work looks like this:

Suppose all the edges have probability . Can you find the reliability of this network?

More in a future post!


Dolan, Stephen. 2013. “Fun with Semirings: A Functional Pearl on the Abuse of Linear Algebra.” In ACM SIGPLAN Notices, 48:101–10. 9. ACM.

Lehmann, Daniel J. 1977. “Algebraic Structures for Transitive Closure.” Theoretical Computer Science 4 (1). Elsevier: 59–76.

O’Connor, Russell. 2011. “A Very General Method for Computing Shortest Paths.”

Penaloza, Rafael. 2005. “Algebraic Structures for Transitive Closure.”

Categories: Offsite Blogs

Journal of Functional Programming - Call for PhDAbstracts

haskell-cafe - Tue, 04/05/2016 - 9:34am
If you or one of your students recently completed a PhD in the area of functional programming, please submit the dissertation abstract for publication in JFP: simple process, no refereeing, deadline 30th April 2016. Best wishes, Graham ============================================================ CALL FOR PHD ABSTRACTS Journal of Functional Programming Deadline: 30th April 2016 ============================================================ PREAMBLE: Many students complete PhDs in functional programming each year. As a service to the community, the Journal of Functional Programming publishes the abstracts from PhD dissertations completed during the previous year. The abstracts are made freely available on the JFP website, i.e. not behind any paywall. They do not require any transfer of copyright, merely a license from the author. A dissertation is eligible for inclusion if parts of it have or could have appeared in JFP, that is, if it is in the general area of f
Categories: Offsite Discussion

Journal of Functional Programming - Call for PhD Abstracts

General haskell list - Tue, 04/05/2016 - 9:34am
If you or one of your students recently completed a PhD in the area of functional programming, please submit the dissertation abstract for publication in JFP: simple process, no refereeing, deadline 30th April 2016. Best wishes, Graham ============================================================ CALL FOR PHD ABSTRACTS Journal of Functional Programming Deadline: 30th April 2016 ============================================================ PREAMBLE: Many students complete PhDs in functional programming each year. As a service to the community, the Journal of Functional Programming publishes the abstracts from PhD dissertations completed during the previous year. The abstracts are made freely available on the JFP website, i.e. not behind any paywall. They do not require any transfer of copyright, merely a license from the author. A dissertation is eligible for inclusion if parts of it have or could have appeared in JFP, that is, if it is in the general area of f
Categories: Incoming News

Call for papers for David Turner's Festschrift issue ofJUCS

General haskell list - Tue, 04/05/2016 - 9:07am
Friends David Turner was one of the two people who changed my life by introducing me to functional programming (*). David designed and implemented a succession of functional languages, Sasl, KRC, and Miranda, that made lazy functional programming into a tool you could use to get work done. They all used SK-combinator reduction in their implementations, a technique of irresistibly simple beauty, invented by Curry and Feys, but refined and popularised by David. For David’s 70th birthday, the Journal of Universal Computer Science is running a special Festschrift issue on “Functional programming: past, present, and future” in David’s honour. The Call for Papers is attached. Here’s the timetable. · 1 July 2016: Paper submissions. · 1 September 2016: Author notification. · 1 October, 2016: Revised version due. · 15 October 2016: Final notification. · 30 October 2016: Camera Ready Copy. Do consider submitting a paper. Simon (*) Arthur Norman w
Categories: Incoming News

Philip Wadler: Steven Pinker's The Sense of Style

Planet Haskell - Tue, 04/05/2016 - 2:35am

I recently read Pinker's The Sense of Style, and urge you to read it too. It is chock full of practical advice on how to make your writing better. Chapter One shows you how to appreciate good writing; I never knew an obituary could be so zippy. Chapter Two explains the approach to writing called 'the classical style', which I have used my whole life without realising it. Chapter Three describes how to keep knowing what you are talking about from getting in the way of communicating clearly. Pinker is an expert on modern grammar, and Chapter Four clarifies how to parse your sentences to avoid ambiguity and employ referents correctly. Chapter Five details the mechanics of how to make a passage cohere. Chapter Six catalogues, from Pinker's position on the usage panel for the American Heritage dictionary, contentious points of diction, with his advice on how to resolve them and what points to consider when resolving them for yourself.
I recommend it highly, and doubly so if you are ever likely to write something that I will have to read.

Categories: Offsite Blogs

Darcs+Pijul Hacking Sprint #11 (May 6th-8th,Helsinki)

haskell-cafe - Mon, 04/04/2016 - 10:36pm
Dear Hackers, The 11th Darcs Sprint, organised by and jointly with the Pijul team, will be in Helsinki, on Friday May 6th-Sunday May 8th, at Aalto University's startup sauna in the Otaniemi Campus. Please check the details at Many thanks to Pierre-Étienne Meunier for organising it. The Darcs planning page is at: Here are three things to know: 1. Everybody is welcome to join us. We'd love to have you, whatever your hacking experience with Pijul or Darcs. Also, if you've got a wacky idea for the future of version control, or a cool use for the Darcs or Pijul libraries, you should join us too. 2. If you're attending please add your name to 3. We may be able to reimburse travel costs (within reason!). Let us know if you'd like a reimbursement, and save your receipts. Many thanks to everybody who participated in our fundraising drives or who gave money on the side. Tha
Categories: Offsite Discussion

[ANN] bond-haskell: yet another data serializationlibrary

haskell-cafe - Mon, 04/04/2016 - 8:48pm
bond-haskell and bond-haskell-compiler is a pair of packages adding Haskell support to bond serialization framework. Bond is an open source, cross-platform framework for working with schematized data. It supports cross-language serialization/deserialization and powerful generic mechanisms for efficiently manipulating data. It is broadly used at Microsoft in high scale services. For a discussion how Bond compares to similar frameworks (most notably protobufs) see Microsoft's bond package or other foreign code is not needed for building or using bond-haskell, all dependencies are published to hackage. For those interested, Microsoft's code is published at _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe< at >
Categories: Offsite Discussion

[ANN] protobuf-simple: Protocol Buffers library

haskell-cafe - Mon, 04/04/2016 - 8:32pm
Hello, I've just released protobuf-simple, an Haskell implementation of Google's Protocol Buffers with an emphasis on simplicity. This implementation consists of a library for the encoding and decoding of data and an executable for generating Haskell types from proto files. The code can be found at Kind regards, Martijn Rijkeboer
Categories: Offsite Discussion

CFP SBLP 2016: 20th Brazilian Symposium on Programming Languages *** Deadline for Abstracts Approaching***

General haskell list - Mon, 04/04/2016 - 8:24pm
[Apologies if you receive multiple copies of this CFP] *** Deadline for Abstracts Approaching*** ======================================================= The Brazilian Symposium on Programming Languages is a well-established symposium which provides a venue for researchers and practitioners interested in the fundamental principles and innovations in the design and implementation of programming languages and systems. SBLP 2016 will be held in Maringá, in the Southern region of Brazil, and will be the 20th edition of the symposium. SBLP is part of the 7th edition of CBSoft, the Brazilian Congress on Software: Theory and Practice. More information is available at IMPORTANT DATES Abstract submission: April 8th 2016 Paper submission: April 15th 2016 Author notification: May 27th 2016 Camera ready deadline: June 10th 2016 Symposium dates: September 22nd and 23rd Authors are invited to submit original research on any relevant top
Categories: Incoming News

Ken T Takusagawa: [btzawyfg] Point-free argument names

Planet Haskell - Mon, 04/04/2016 - 5:47pm

In a traditional "pointful" definition of a function in Haskell, the names of the function parameters can provide documentation of what the argument is for:

f num_oranges = ...

In point-free style, that opportunity for documentation goes away.

However, if the function has a type signature, then each type element of the signature can be annotated with documentation stating what it is.  The feature already exists in Haddock, though it is not too frequently used.

f :: Int -- ^ The 'Int' argument
-> Float -- ^ The 'Float' argument
-> IO () -- ^ The return value

Categories: Offsite Blogs

Managed Languages Conference: PPPJ 2016 Call for Papers

General haskell list - Mon, 04/04/2016 - 10:30am
PPPJ '16 13th International Conference on Principles and Practices of Programming on the Java Platform: Virtual Machines, Languages, and Tools August 29 - September 2, 2016 Lugano, Switzerland In-cooperation with ACM SIGPLAN, SIGSOFT, SIGAPP and SPEC RG PPPJ '16 is a forum for researchers and practitioners to present and discuss novel results on all aspects of managed languages and their runtime systems, including virtual machines, tools, methods, frameworks, libraries, case studies, and experience reports. Managed languages and runtime systems of interest include, but are not limited to, Java, Scala, JavaScript, Python, Ruby, C#, F#, Clojure, Groovy, Kotlin, R, Java VM, Dalvik VM and Android Runtime (ART), LLVM, .NET CLR, RPython. ------------------------------------------------------------------------------- IMPORTANT DATES Abstract submission deadline: June 2, 2016 Submission deadline: June 6, 2016 Author notification: July 11, 2016 Camera-ready
Categories: Incoming News

Philip Wadler: Greenwald on Clinton, Sanders, and Israel

Planet Haskell - Mon, 04/04/2016 - 8:51am
Democracy News interviews Glen Greenwald on Clinton, Sanders, and Israel.
AMY GOODMAN: Let’s go to a clip of Hillary Clinton addressing AIPAC, the American Israel Public Affairs Committee.
HILLARY CLINTON: Many of the young people here today are on the front lines of the battle to oppose the alarming boycott, divestment and sanctions movement known as BDS. ... We must repudiate all efforts to malign, isolate and undermine Israel and the Jewish people.
AMY GOODMAN: That was Hillary Clinton addressing AIPAC. Glenn Greenwald?
GLENN GREENWALD: What she’s doing there is affirming one of the most vile slanders that currently exists. There is a campaign in the United States and in Israel to literally outlaw any advocacy of a boycott movement against Israel, similar to the boycott and divestment and sanctions campaign that brought down Israel and the United States’s closest ally, which was the apartheid regime in South Africa. Now you can certainly raise objections to the tactic of boycotting Israel, and lots of people have, but to render it illegal depends upon this grotesque equating of an advocacy of a boycott of Israel with anti-Semitism and then saying that because anti-Semitism should be banned from universities or from private institutions, that it should be literally outlawed, to ban advocating the boycott of Israel, as well. And people in Europe are actually being arrested for advocating a boycott of Israel. Students in American universities are being sanctioned and punished for doing so.
And what Hillary Clinton did was go before AIPAC and pander, as grotesquely as she typically does, by affirming this line that if you "malign," quote-unquote, the government of Israel and support a boycott of it, in opposition to their decades-long occupation of the Palestinians, it means essentially that you’re guilty of maligning the Jewish people. She is conflating the government of Israel with Jews, which, ironically enough, is itself a long-standing anti-Semitic trope. But it’s just part of her moving to the right in order to position herself for the general election by affirming some of the United States government’s worst and most violent policies.
AMY GOODMAN: Now, Democratic candidate Vermont Senator Bernie Sanders was the only one to skip the AIPAC conference earlier this week. He did address the issue on the campaign trail, though, from Utah, calling for an end to Israel’s occupation of Palestinian territories.
SEN. BERNIE SANDERS: It is absurd for elements within the Netanyahu government to suggest that building more settlements in the West Bank is the appropriate response to the most recent violence. It is also not acceptable that the Netanyahu government decided to withhold hundreds of millions of shekels in tax revenue from the Palestinians, which it is supposed to collect on their behalf.
AMY GOODMAN: That was Bernie Sanders in Utah. Glenn Greenwald, I believe he did offer to address AIPAC by video stream or Skype, as did Romney in 2012, but we heard he was told no.
GLENN GREENWALD: Yeah, I mean, a couple months ago, Donald Trump, on an MSNBC program, said, when asked about Israel and Palestine, that he thought the U.S. should be neutral in order to be a more effective arbiter, which until 20 years ago was a standard mainstream U.S. position, but now has become very shocking. Same with what Bernie Sanders just said. To hear a prominent American politician stand up and actually criticize Israel in such stark and blunt terms, calling them occupiers, essentially, and criticizing how they’re treating the Palestinians, is almost shocking to the ear. Hillary Clinton would never do it, nor would leading Republican politicians. And yet it’s really a very mild way to talk about Israel. And it shows just how far to the right the discourse has shifted in the United States when it comes to Israel, and how much a part of that rightward shift is Hillary Clinton, when you think about how almost shocking it is to hear pretty mild criticisms of Israel coming from Sanders or mild proclamations of neutrality coming from Trump.
Categories: Offsite Blogs

Philip Wadler: US citizens in Scotland: How to renew your passport

Planet Haskell - Mon, 04/04/2016 - 8:05am
The US Embassy website states that if you reside in Scotland you must send your passport to London to renew it, but this is not correct: passports can be renewed by mail to the US consulate in Edinburgh or in person. I renewed in person last week, and found the staff friendly and helpful. They know that the website is incorrect, but London has not yet fixed it. I copy below the information I received from the Edinburgh consulate, in the hope that it may help others.
Thank you for your email.  If you meet the following criteria you are eligible to renew your passport by mail:1.      Your passport was valid for 10 years;
2.      It was issued within the last 15 years;
3.      It is in good condition;
4.      Was issued in your current name or you have changed your name and can submit legal documentation (e.g. marriage certificate, Statutory Declaration) to prove this change.

You can mail your renewal application to this office using the address at the foot of this email.  The passport must be sent using the Royal Mail special delivery service and the following items must be sent:1.      The passport to be renewed;
2.      Your original marriage certificate, if you wish to change your name by marriage, or Statutory Declaration, if you wish to change your name by this method;
3.      Completed passport renewal form DS82,<wbr></wbr>documents/organization/212241.<wbr></wbr>pdf.   Please note:  if your current passport was issued within 12 months of this application and you are applying for a new passport in your married name or to correct a data error you should use form DS5504,<wbr></wbr>documents/organization/212249.<wbr></wbr>pdf;
4.      Completed credit card payment form for the fee of $110 - no fee is payable if you are able to use form DS5504 to apply for a replacement passport,<wbr></wbr>libraries/unitedkingdom/<wbr></wbr>164203/cons-acs/card_payment_<wbr></wbr>ppt_by_mail.pdf;
5.      A U.S. passport photograph,<wbr></wbr>citizen-services/u-s-<wbr></wbr>passports/how-to-renew-a-<wbr></wbr>passport/photographs/;
6.      A pre-paid, self-addressed Royal Mail special delivery envelope for the safe return of the passports.
Our turnaround time for applications by mail is approximately 2 weeks.
If you prefer to apply in person you can do so during our counter service hours, 9am-11:30am Tuesdays and Wednesdays.  No appointment is necessary.  Our turnaround time for passports submitted in person is approximately 7-10 days from submission of the application.
If you do not meet the above criteria you will have to book an appointment online, selecting the option for residents of Scotland, to apply in person at the Consulate General,<wbr></wbr>citizen-services/u-s-<wbr></wbr>passports/
Kind regardsU.S. Consulate General3 Regent TerraceEdinburghEH7 5BWTel: (44) 131 556 8315Fax (44) 131 557 6023
Follow us on Twitter - @USAinScotland
Categories: Offsite Blogs

Call for Contributions - Haskell Communities and Activities Report, May 2016 edition (30th edition)

haskell-cafe - Mon, 04/04/2016 - 12:24am
Dear all, It's that time of the year again ( :) We would like to collect contributions for the 30th edition of the ============================================================ Haskell Communities & Activities Report Submission deadline: 30 April 2016 ============================================================ The short story follows: * If you are working on _any_ project that is in some way related to Haskell, please write a short entry and submit it. Even if the project is small, unfinished or used only by yourself or you think it is not important enough, please reconsider and submit an entry anyway! * The submission file can be in _any_ format you like. Although the final report uses LaTeX, if it is easier for you to submit a Markdown file, text file, Doc file or anything else, please do so. We'll be happy to do the translation and get
Categories: Offsite Discussion