Wednesday, December 13, 2017

Defining backticks using "pipe" operations

(Thanks to Simon Fowler and others on the Links team for the discussion leading to this...)

In Haskell, you can use a 2-argument function as if it were an infix operator by putting "backticks" around it like this:

ghci> let plus x y = x + y
ghci> 1 `plus` 2
3

In a number of functional languages such as F# and OCaml, the following "pipe" operations have become popular (I'll continue using Haskell syntax, though):

ghci> let (|>) x f = f x
ghci> let (<|) f x = f x
ghci> [1,2,3] |> map (plus 1)
[2,3,4]


Read more »

Labels: ,

posted by Unknown @ 15:55 3 Comments

Tuesday, March 01, 2016

PhD studentships in programming languages, provenance, data management

I am currently advertising two PhD studentships, on topics spanning programming languages, provenance, and data management, to start in fall 2016.

Both of these studentships are fully funded for applicants of any nationality (in contrast to many UK PhD studentships which are only funded up to the UK/EU tuition level, and do not cover full tuition fees for students from outside the European Union.)
Read more »

Labels: , , , , , ,

posted by Unknown @ 17:14 0 Comments

Thursday, November 05, 2015

Private type members in Scala aren't

I haven't posted in a while now, and one major reason is that I've been teaching a new course on Programming Languages. I've been using Scala, somewhat experimentally, and as a (perhaps misguided) way of forcing myself to learn some Scala.

In the last few lectures, I've been covering Scala's object system. I'm not an expert on Scala by any means, but I was a little surprised by the way "private" appears to work (or more accurately, not work) on type members of classes/objects.

Read more »

Labels: ,

posted by Unknown @ 11:43 3 Comments

Tuesday, September 30, 2014

Dijkstra monads

Dijkstra monads in monadic computation
Bart Jacobs
CMCS 2014

This paper discusses a monad for predicate transformers (dubbed the Dijkstra monad in an earlier paper by Swamy et al. that is now also on my reading list). This post is an attempt to express a very, very small part of the ideas of the paper in Haskell, to try to make some sense of them.

Read more »

Labels: ,

posted by Unknown @ 18:46 8 Comments

Monday, August 04, 2014

More on composing queries in F#

I ran across some StackOverflow questions from a couple of years ago asking about composing query expressions in F#, and gave answers showing how FSharpComposableQuery can help with this:

http://stackoverflow.com/questions/13826749/how-do-you-compose-query-expressions-in-f

http://stackoverflow.com/questions/10158512/dynamic-sql-queries-with-f-3-0

Tomas Petricek's previous posts on dynamic LINQ queries in C# and F# 2.0 were, of course part of the inspiration for our work. FSharpComposableQuery updates these ideas to F# 3.0 and, hopefully, makes them easily usable without the need for tricks.

I also ran across a more recent blog post by Loïc Denuziere that discusses the related issue of how to splice partial F# query expressions together to build more complex ones. His approach cleverly defines an alternative query operator, pquery, that can be used to define query snippets that don't get evaluated immediately. He suggests the following code (copied from the end of the post):

Read more »

Labels: , ,

posted by Unknown @ 12:16 0 Comments

Thursday, December 19, 2013

Asynchronous functional reactive programming for GUIs

Asynchronous functional reactive programming for GUIs
Evan Czaplicki and Stephen Chong
PLDI 2013 (see also http://elm-lang.org/)

This paper presents a new functional reactive programming-based programming language aimed at graphical user interaction (particularly on Web pages as embedded in Javascript). Graphical user interaction has frequently been cited as a motivation for FRP techniques since the first work on it by Elliott and Hudak. Early techniques had some significant performance problems, while more recent techniques have introduced restrictions or refinements that seek to reconcile convenient programming with efficiency.

Read more »

Labels: , , ,

posted by Unknown @ 17:13 0 Comments

Thursday, November 07, 2013

PhD opportunities in data-centric programming at LFCS, University of Edinburgh

And now for a word from our sponsors...

I would like to recruit 1-2 PhD students, working on any of the following topics (with further details given at the associated links).

  • Language-based provenance security: Provenance-based security and audit; applications to slicing, failure analysis for system configuration languages; information-flow and provenance-tracking for multi-tier programs; designing new [functional/declarative] languages or dynamic information flow analyses for secure, high-reliability datacenter programming
  • Data-centric programming and provenance: Types and language design for integrating multiple data-centric programming models; language-integrated query; extending bidirectional programming for synchronizing data across data models; language-based techniques for data curation and preservation, provenance tracking, or archiving; query and update techniques for longitudinal or provenance-aware queries.
One position is funded by a Microsoft Research PhD studentship, joint with Paul Anderson and Dimitrios Vytiniotis (MSR-Cambridge). The funding includes a laptop for the student and there may be additional opportunities for collaboration or internships (at the discretion of MSR). A second funded position may be available.

Applicants should have a good honors degree or equivalent in computer science, or a related discipline, and ideally familiarity with foundations of programming languages, security, or databases and interests in applications of these foundations to real systems.

Other PhD studentships are also available, including on topics related to types and programming languages. Please contact me (jcheney@inf.ed.ac.uk) or others in LFCS to discuss alternative project ideas.

Read more »

Labels: , , ,

posted by Unknown @ 11:35 0 Comments

Wednesday, October 02, 2013

ICFP 2013

ICFP 2013 (The 18th ACM SIGPLAN International Conference on Functional Programming)

ICFP is the conference I attend most regularly; since 2002 I've attended every year except 2004, 2007 and 2011. As mentioned in the last post, I attended ICFP 2013 in Boston, somewhat gratuitously: I wasn't presenting our paper, but was excited by the program and wanted to see a lot of talks. I wasn't disappointed. I attended just about every session. Here is a quick summary of papers/talks that especially stood out, with some reactions: (Please don't be offended if I don't mention your paper - all the talks were good, but these were the ones that made a special impression)

Day 1:

The first day had a distinctively dependently-typed feel, with a little algorithms thrown in.
Read more »

Labels: ,

posted by Unknown @ 15:55 0 Comments

Sunday, September 01, 2013

DBPL 2013

DBPL 2013

I attended DBPL 2013 in Riva Del Garda, Italy - a very attractive venue. I was stupid and only came for the day of the workshop. There were a lot of interesting talks.
Read more »

Labels: , ,

posted by Unknown @ 21:24 0 Comments

AltStyle によって変換されたページ (->オリジナル) /