package ixee.cryptopals.utils object FunctionUtils { // Because doing (_ f _).tupled confuses the inferencer... def tup[A, B, C](f: (A, B) => C): ((A, B)) => C = f.tupled def ident[A]: A => A = { x => x } implicit class Compositor[A, B](f: A => B) { def :|[C](g: B => C): A => C = f.andThen(g) } implicit class Tap[A](x: A) { def tap(f: A => Any): A = { f(x) x } } }