Skip to content

Commit 6288a47

Browse files
authored
Remove defterm (#473)
* eliminate defterm * lint
1 parent 7588d67 commit 6288a47

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

effectful/ops/syntax.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import numbers
66
import operator
77
import typing
8-
import warnings
98
from collections.abc import Callable, Iterable, Mapping
109
from typing import Annotated, Any
1110

@@ -325,7 +324,7 @@ def analyze(self, bound_sig: inspect.BoundArguments) -> frozenset[Operation]:
325324
The :func:`analyze` methods of :class:`Scoped` annotations that appear on
326325
the signature of an :class:`Operation` are used by :func:`defop` to generate
327326
implementations of :func:`Operation.__fvs_rule__` underlying alpha-renaming
328-
in :func:`defterm` and :func:`defdata` and free variable sets in :func:`fvsof` .
327+
in :func:`evaluate` and :func:`defdata` and free variable sets in :func:`fvsof` .
329328
330329
Specifically, the :func:`analyze` method of the :class:`Scoped` annotation
331330
of a parameter computes the set of bound variables in that parameter's value.
@@ -419,28 +418,14 @@ def deffn[T, A, B](
419418
420419
.. note::
421420
422-
In general, avoid using :func:`deffn` directly. Instead, use
423-
:func:`defterm` to convert a function to a term because it will
424-
automatically create the right free variables.
421+
In general, avoid using :func:`deffn` directly. Instead, use :func:`trace`
422+
to convert a function to a term because it will automatically create the
423+
right free variables.
425424
426425
"""
427426
raise NotHandled
428427

429428

430-
@_CustomSingleDispatchCallable
431-
def defterm[T](__dispatch: Callable[[type], Callable[[T], Expr[T]]], value: T):
432-
"""Convert a value to a term, using the type of the value to dispatch.
433-
434-
:param value: The value to convert.
435-
:returns: A term.
436-
"""
437-
from effectful.ops.semantics import evaluate
438-
439-
warnings.warn("defterm is replaced by evaluate", DeprecationWarning)
440-
441-
return evaluate(value)
442-
443-
444429
@_CustomSingleDispatchCallable
445430
def defdata[T](
446431
__dispatch: Callable[[type], Callable[..., Expr[T]]],

0 commit comments

Comments
 (0)