From c940bfc5343ee3edf53566366f6857eb08c04a1d Mon Sep 17 00:00:00 2001 From: hasufell Date: Sun, 14 Dec 2014 18:01:13 +0100 Subject: [PATCH] PRELUDE: simplify 'first' --- MyPrelude.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MyPrelude.hs b/MyPrelude.hs index 176e618..4db0fb5 100644 --- a/MyPrelude.hs +++ b/MyPrelude.hs @@ -2,6 +2,7 @@ module MyPrelude where +import Control.Arrow ((***)) import Data.List @@ -64,7 +65,7 @@ rmdups = -- |Apply a function to the first element of a tuple. first :: (a -> b) -> (a,c) -> (b,c) -first f (x,y) = (f x, y) +first = (*** id) -- |Sequentialize a list, such as: