summaryrefslogtreecommitdiff
path: root/src/utils/FunctionUtils.scala
blob: 84c141b91b9aa75100473e488be51a3495e66dd6 (plain)
1
2
3
4
5
6
7
8
9
10
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

  implicit class Compositor[A, B](f: A => B) {
    def :|[C](g: B => C): A => C = f.andThen(g)
  }
}