LoginSignup
1
1

More than 5 years have passed since last update.

関数合成メモ

Posted at
def idiot[T](func: List[T => T], rt: List[T]): List[T] = rt.map(func.reduce(_ andThen _))

assert(idiot[Int](List(identity, x => x >> 1, x => x >> 1), List(20)) == List(5))
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1