Skip to content

Instantly share code, notes, and snippets.

@travisbrown
Forked from milessabin/gist:4719811
Created February 6, 2013 14:38
Show Gist options
  • Save travisbrown/4722927 to your computer and use it in GitHub Desktop.
Save travisbrown/4722927 to your computer and use it in GitHub Desktop.
scala> def foo[A, B, C](a: SNat[A], b: SNat[B], c: SNat[C])(implicit ssum: SSum[A, B, C]) = ssum
foo: [A, B, C](a: shapeless.SNat[A], b: shapeless.SNat[B], c: shapeless.SNat[C])(implicit ssum: shapeless.SSum[A,B,C])shapeless.SSum[A,B,C]
scala> foo(2, 3, 5)
res0: shapeless.SSum[Int(2),Int(3),Int(5)] = $anon$1@53d76e96
scala> foo(2, 3, 7)
<console>:15: error: could not find implicit value for parameter ssum: shapeless.SSum[Int(2),Int(3),Int(7)]
foo(2, 3, 7)
^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment