The Active package

I just found an interesting package named active. It allows modelling animations as functions from times to values, and combining animations compositionally. When I get to implementing that part of Sylvia, I might look into it further.

Advertisements

Status update

I’ve been trying to get the Y combinator &c. rendering correctly, and it’s much harder than I though it would be.

My initial idea was to detect when the object above an applicator is a lambda. If so, it can be merged into it:

This worked well for simple cases, like the one above.

But how do we render more complex cases like this?

(The above image was taken from the original paper.)

The issue is with the abstraction on the right: it closes over the outer parameter, so it needs to extend a line over and above the abstraction on the left. To do that, we need to take into account:

  1. What variables are required by the abstraction, so we know where the lines should lead to;
  2. The height of all the objects to its left, so the lines can properly detour over them.

That’s what I’m implementing now, and I hope to finish it before the end of this month.

Some eye candy

I’ve finished the initial part of the renderer! Yay!

If you’re curious, you can grab the code from Hackage.

Here’s a sample rendering, for the impatient:

A collection of combinators

From left to right: Identity (λx → x), Kestrel (λx y → x), Kite (λx y → y), Starling (λ f g x → f x (g x)).

Ω and Y don’t look that nice, so they aren’t shown here. I’ll put them up as soon as I fix the code.

blog init

This is the first post! On this blog! It’s so exciting! Lots of exclamation points! Yay!

Now for a few intelligent sounding quotes to hide the lack of real content in this blog:

He had moved from thoughts to words, and now from words to actions.

– George Orwell, Nineteen-Eighty Four

‘Begin at the beginning,’ the King said gravely, ‘and go on till you come to the end: then stop.’

– Lewis Carroll, Alice’s Adventures in Wonderland