From 0af5a2e4ade0b032e1ec6d25c51de2ff95dd2799 Mon Sep 17 00:00:00 2001 From: iximeow Date: Thu, 27 Nov 2014 02:06:03 -0800 Subject: Rough cut of challenge 10 --- src/utils/TupleUtils.scala | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/utils/TupleUtils.scala') diff --git a/src/utils/TupleUtils.scala b/src/utils/TupleUtils.scala index 2a6dd6c..2318c11 100644 --- a/src/utils/TupleUtils.scala +++ b/src/utils/TupleUtils.scala @@ -1,10 +1,13 @@ package ixee.cryptopals.utils +import ixee.cryptopals.utils.FunctionUtils._ + object TupleUtils { implicit class Tuple2[A, B](t: (A, B)) { def mapAll[C, D](_1: A => C = ident, _2: B => D = ident): (C, D) = (_1(t._1), _2(t._2)) - def <-:(f: A => C + def <-:[C](f: A => C): (C, B) = (f(t._1), t._2) + def :->[D](f: B => D): (A, D) = (t._1, f(t._2)) } } -- cgit v1.1