summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@blackbird>2016-04-25 16:07:00 -0400
committerjoe <joe@blackbird>2016-04-25 16:07:00 -0400
commitcba7659e07a73702c5d1f1f768f72bdf2e121154 (patch)
tree8b1e63dfc38a9ff8601a7358726aa05af9ebb34b
parentf70ad35a93aec70be1b7fbc31946153ceb6015c5 (diff)
sortOn for older base package.
-rw-r--r--kiki.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/kiki.hs b/kiki.hs
index e06fa79..0284ff9 100644
--- a/kiki.hs
+++ b/kiki.hs
@@ -68,6 +68,12 @@ import qualified DNSKey as DNS
68import Data.Time.Clock.POSIX ( posixSecondsToUTCTime ) 68import Data.Time.Clock.POSIX ( posixSecondsToUTCTime )
69import Debug.Trace 69import Debug.Trace
70 70
71#if !MIN_VERSION_base(4,8,0)
72sortOn :: Ord b => (a -> b) -> [a] -> [a]
73sortOn f =
74 map snd . sortBy (comparing fst) . map (\x -> let y = f x in y `seq` (y, x))
75#endif
76
71-- {-# ANN module ("HLint: ignore Eta reduce"::String) #-} 77-- {-# ANN module ("HLint: ignore Eta reduce"::String) #-}
72-- {-# ANN module ("HLint: ignore Use camelCase"::String) #-} 78-- {-# ANN module ("HLint: ignore Use camelCase"::String) #-}
73 79