Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/creating-new-domains.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ We will create a list of primitives for our toy example next.

Each member of our list must be an instance of the `Primitive` class where each primitive has a unique name that binds it to its corresponding OCaml code (discussed later), a type imported from `dreamcoder/type.py`, and a lambda function: `Primitive(name, type, func)`.
```python
def _incr(x): return lambda x: x + 1
def _incr2(x): return lambda x: x + 2
def _incr(x): return x + 1
def _incr2(x): return x + 2

primitives = [
Primitive("incr", arrow(tint, tint), _incr),
Expand Down Expand Up @@ -190,8 +190,8 @@ from dreamcoder.type import arrow, tint
from dreamcoder.utilities import numberOfCPUs

# Primitives
def _incr(x): return lambda x: x + 1
def _incr2(x): return lambda x: x + 2
def _incr(x): return x + 1
def _incr2(x): return x + 2


def addN(n):
Expand Down