Skip to content

Instantly share code, notes, and snippets.

@Koisell

Koisell/list.scala

Last active Sep 23, 2019
Embed
What would you like to do?
// 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
You can’t perform that action at this time.