ElixirST (ElixirST v0.6.1) View Source

This module is the starting point of ElixirST. It parses the @session (and @dual) attribute and starts analysing the AST code using session types.

A basic module, typechecked using ElixirST, takes the following form:

defmodule Examples.SmallExample do
  use ElixirST

  @session "X = !Hello()"
  @spec some_process(pid) :: atom()
  def some_process(pid) do
    send(pid, {:Hello})
    :ok
  end

  @dual "X"
  # ...
end

Link to this section Summary

Functions

Spawns two actors, exchanges their pids and then calls the server/client functions

Link to this section Functions

Link to this function

spawn(serverFn, server_args, clientFn, client_args)

View Source

Specs

spawn(
  (... -> any()),
  maybe_improper_list(),
  (... -> any()),
  maybe_improper_list()
) :: {pid(), pid()}

Spawns two actors, exchanges their pids and then calls the server/client functions

server_fn and client_fn need to accept a pid as their first parameter.