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

Rename isIdentity to isFixedPoint #10

Merged
merged 2 commits into from
Nov 22, 2018
Merged

Conversation

bxt
Copy link
Contributor

@bxt bxt commented Nov 12, 2018

There's an example in lecture 5 typeclasses incarnations in the chapter Categorical FP:

def isIdentity[A: Eq](a: A)(f: A => A): Boolean = {
  implicitly[Eq[A]].eqv(a, f(a))
}

The function name isIdentity suggests that it returns wether f is the identity function. But I think it only checks wether a is a fixed point of f. So I would propose to rename it.

There's an example in lecture 5 typeclasses incarnations in the chapter Categorical FP:

```scala
def isIdentity[A: Eq](a: A)(f: A => A): Boolean = {
  implicitly[Eq[A]].eqv(a, f(a))
}
```

The function name `isIdentity` suggests that it returns wether `f` is the identity function. But I think it only checks wether `a` is a fixed point of `f`. So I would propose to rename it.
@pheymann
Copy link
Member

Hi @bxt ,
thanks for the PR we appreciate it. Regarding your change, you are right. The function only shows that f is a fixpoint. We have no 'proof' that ∀ a : a == f(a).

Before we can merge, could you execute the following sbt command:

$> sbt "project typeclasses-incarnations-lecture" "fullCompile"

and commit the changed JavaScript presentation?

@bxt
Copy link
Contributor Author

bxt commented Nov 21, 2018

Hey @pheymann, sure, I ran the command and commited the changed JavaScript presentation.

@pheymann
Copy link
Member

👍

@pheymann pheymann merged commit e28c8ea into scalasummerschool:master Nov 22, 2018
@bxt bxt deleted the patch-1 branch November 22, 2018 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants