emperor-lang/emperor

Unchecked purity

Closed this issue · 1 comments

Describe the bug

Purity is not checked when evaluating functions. This is in three main areas.

  1. Impure functions may be passed to pure ones
  2. Impure functions may be called from pure ones
  3. Pure functions may be called without saving their results

To Reproduce

Attempt to compile the following.

module test

p :: int -> int
p x:
    return x
#

f :: (@int -> int) -> int
f g:
    @p(1)
    return g(1)
#

Expected behaviour

The above should fail to compile on all three counts.

Environment (please complete the following information):

  • OS: Ubuntu
  • Emperor version: unreleased

Additional context

N/A

This was resolved in #23