# `Skuld.Comp.Types`
[🔗](https://github.com/mccraigmccraig/skuld/blob/main/lib/skuld/comp/types.ex#L1)

Type definitions for Skuld.Comp.

These types define the core abstractions of the evidence-passing effect system.

# `computation`

```elixir
@type computation() :: computation(term())
```

# `computation`

```elixir
@type computation(_result) :: (env(), k() -&gt; {result(), env()})
```

A computation awaiting execution.

The type parameter documents what the computation produces when run.
Dialyzer erases it (it's a phantom parameter), but it appears in
hover docs, ExDoc, and generated specs for readability.

## Examples

    @spec get_todo(String.t()) :: computation({:ok, Todo.t()} | {:error, term()})
    @spec get_todo!(String.t()) :: computation(Todo.t())

# `env`

```elixir
@type env() :: Skuld.Comp.Env.t()
```

The environment carrying evidence, state, and leave-scope

# `handler`

```elixir
@type handler() ::
  (args :: term(), env() -&gt; {result(), env()})
  | (args :: term(), env(), k() -&gt; {result(), env()})
```

A handler interprets effect operations. Total+linear handlers are 2-arity; general handlers are 3-arity.

# `k`

```elixir
@type k() :: (term(), env() -&gt; {result(), env()})
```

Continuation after an effect

# `leave_scope`

```elixir
@type leave_scope() :: (result(), env() -&gt; {result(), env()})
```

Leave-scope handler - cleans up or redirects

# `result`

```elixir
@type result() :: term()
```

Any result value - opaque to the framework

# `sig`

```elixir
@type sig() :: atom() | {atom(), atom()}
```

Effect signature - identifies which handler handles an operation. Can be a simple atom or a tuple for tagged effects.

# `transform_suspend`

```elixir
@type transform_suspend() :: (Skuld.Comp.ExternalSuspend.t(), env() -&gt;
                          {Skuld.Comp.ExternalSuspend.t(), env()})
```

Transform-suspend handler - decorates ExternalSuspend values when yielding

---

*Consult [api-reference.md](api-reference.md) for complete listing*
