Simon Peyton Jones
π€ SpeakerAppearances Over Time
Podcast Appearances
So it's nice pure int to int function or dirty int to int function.
So you may say, perhaps you're about to say, that's a bit of a blunt instrument.
Either completely pure or completely dirty, right?
It gets you an awfully long way.
But nevertheless, it would be cool if you could say, oh, I am into effectful doing reading of files only int.
So in the type, you'd like to say, what kind of effects can it have?
Can it throw exceptions?
Can it spawn new threads?
So you'd like to enumerate the effects this computation could have, right?
That will be cool.
That's called an effect system.
And there's, you know, a bazillion programming language papers about effect systems.
And it turns out that you can indeed, in the type system of Haskell, and indeed OCaml is rapidly becoming the same, you can express not just all or nothing, does it do IO, game over,
but rather which particular effects does it do, including no effects at all.
That's pure.
A good place to start is a library called Bluefin, which my colleague Tom Ellis has designed.
It's a very nice take on how to do effects systems in Haskell.
Yep.
And because you have to thread, because the type system gets in your face, you were trying to
Like map, say.