matijapretnar/eff

Running examples/*.eff

ngzhian opened this issue · 6 comments

I built eff from source ./configure && make, and tried to run the example

$ ./eff examples/choice.eff
Syntax error (file "examples/choice.eff", line 6, char 15):

running the tests work, and running the example on the interactive tutorial website works as well.

I've found that the difference is, in the examples effects are declared like so

type 'a random = effect
  operation pick : ('a * float) list -> 'a
end

whereas the tests have

effect Decide : unit -> bool;;

Did I miss any step? Thanks!

I think we forgot to update the examples. They're using the old style effect declarations. More or less, each operation .... line in the examples should become an effect ... line, and any uses of new and instances should go away. @matijapretnar is that correct?

Ah, thanks for that information. Will it be helpful for me to update the examples to this new effect declaration?

Also, may I know if this change is documented somewhere? I would be interested to learn about the reasons behind moving away from instances. Thanks!

(For some background, I'm taking a program static analysis course, and our project requires us to research on a chosen topic - mine is algebraic effects system).

If you have time, it would be very helpful to update the examples, though some of them may not translate that nicely due to lack of instances. I agree it's extremely confusing that the builtin examples don't work at all.

The main reason behind moving away from instances is complexity. They make the effect inference much harder, and it turns out it's hard to do right even without them.

For the record, I like instances.

That is because you don't have to maintain them 😃

Awesome, thanks!