View Source ElixirST (ElixirST v0.8.3)

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

Summary

Functions

Creates a session by spawning two actors, exchanging their pids and then calls the functions server_fn and client_fn need to accept a pid as their first parameter.

Functions

Link to this function

session(serverFn, server_args, clientFn, client_args)

View Source
@spec session(
  (... -> any()),
  maybe_improper_list(),
  (... -> any()),
  maybe_improper_list()
) ::
  {pid(), pid()}

Creates a session by spawning two actors, exchanging their pids and then calls the functions server_fn and client_fn need to accept a pid as their first parameter.

Link to this function

spawn(serverFn, server_args, clientFn, client_args)

View Source
@spec spawn(
  (... -> any()),
  maybe_improper_list(),
  (... -> any()),
  maybe_improper_list()
) ::
  {pid(), pid()}

Renamed to session/4