Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update creating-new-domains.md #102

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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