Skip to content

Instantly share code, notes, and snippets.

@Koisell
Last active September 23, 2019 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Koisell/8e2b9605f71e8cfba45b975b139e3d63 to your computer and use it in GitHub Desktop.
Save Koisell/8e2b9605f71e8cfba45b975b139e3d63 to your computer and use it in GitHub Desktop.
// A type which holds a reference to itself:
sealed abstract class List[+A]
final case class Cons[+A](head: A, tail: List[A]) extends List[A]
final case object Nil extends List[Nothing]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment