Skip to content

Commit

Permalink
Well, we can do it...
Browse files Browse the repository at this point in the history
  • Loading branch information
S11001001 committed Mar 1, 2017
1 parent cd43f1f commit 9bdf843
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -20,7 +20,7 @@ lazy val tutVersion = SettingKey[String]("tutVersion")

tutInput := (baseDirectory in ThisBuild).value / "posts"
tutOutput := (baseDirectory in ThisBuild).value / "_posts"
tutVersion := "0.4.4"
tutVersion := "0.4.8"

watchSources ++= (tutInput.value ** "*.md").get

Expand Down
14 changes: 8 additions & 6 deletions posts/2017-03-01-four-ways-to-escape-a-cake.md
Expand Up @@ -382,13 +382,15 @@ a singleton type**.
`u.type#Needle`.
4. This shortens to `u.Needle`.

By our inability to constrain `U` in this way, though, we are
If we are unable to constrain `U` in this way, though, we are
restricted to places where `U` occurs in covariant position when using
cake-extracted APIs, though. We can invoke functions like `init`,
because they only have the singleton index occurring in covariant
position. **We are out of luck with any functions with a contravariant
or invariant occurrence of the index, though.** This is, well, most of
them.
cake-extracted APIs. We can invoke functions like `init`, because
they only have the singleton index occurring in covariant position.

Invoking functions like `iter`, where the index occurs in
contravariant or invariant position, requires being able to add this
constraint, so that we can use singleton equivalence directly on the
type variable `U`. This is quite a bit trickier.

## Extracting more types

Expand Down

0 comments on commit 9bdf843

Please sign in to comment.