Skip to content

Instantly share code, notes, and snippets.

@JohnReedLOL
Created July 4, 2016 19:06
Show Gist options
  • Save JohnReedLOL/bad7f65650265f0dabe04441e5219acd to your computer and use it in GitHub Desktop.
Save JohnReedLOL/bad7f65650265f0dabe04441e5219acd to your computer and use it in GitHub Desktop.
val times2 = (x: Int) => x*2
type toExtend = shapeless.PolyDefns.->[Int, Int]
// These are the same
object doubleObj1 extends (Int -> Int) (times2)
object doubleObj2 extends (->[Int, Int]) (times2)
object doubleObj3 extends ->[Int, Int](times2)
object doubleObj4 extends shapeless.PolyDefns.->[Int, Int](times2)
object doubleObj5 extends toExtend(times2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment