From 9bdf84360f53df797e87cce3f71fd0a6a98cde9d Mon Sep 17 00:00:00 2001 From: Stephen Compall Date: Tue, 28 Feb 2017 20:00:10 -0500 Subject: [PATCH] Well, we can do it... --- build.sbt | 2 +- posts/2017-03-01-four-ways-to-escape-a-cake.md | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index 367fb490..dec42545 100644 --- a/build.sbt +++ b/build.sbt @@ -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 diff --git a/posts/2017-03-01-four-ways-to-escape-a-cake.md b/posts/2017-03-01-four-ways-to-escape-a-cake.md index cb66ae9c..ad6e6d63 100644 --- a/posts/2017-03-01-four-ways-to-escape-a-cake.md +++ b/posts/2017-03-01-four-ways-to-escape-a-cake.md @@ -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