Profile cover photo
Profile photo
Felix Palludan Hargreaves
119 followers
119 followers
About
Posts

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment
Is there really no library support for a function that removes the first occurrence of some element from some list:

http://pastebin.com/xNB321KM

The pastebin shows the function I am missing. Note: it should only remove the first, not all occurrences.

Is this something that exists with another name:

def liftOrIdentity[T](f: (T, T) => T) = (a: Option[T], b: Option[T]) =>
(a, b) match {
  case (Some(a), None) => Some(a)
  case (None, Some(b)) => Some(b)
  case (Some(a), Some(b)) => Some(f(a, b))
  case (None, None) => None
}

???

Post has attachment
Scala coffee...nice!
Photo

Post has attachment
Wait while more posts are being loaded