diff options
author | joe <joe@blackbird> | 2016-04-25 16:07:00 -0400 |
---|---|---|
committer | joe <joe@blackbird> | 2016-04-25 16:07:00 -0400 |
commit | cba7659e07a73702c5d1f1f768f72bdf2e121154 (patch) | |
tree | 8b1e63dfc38a9ff8601a7358726aa05af9ebb34b | |
parent | f70ad35a93aec70be1b7fbc31946153ceb6015c5 (diff) |
sortOn for older base package.
-rw-r--r-- | kiki.hs | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -68,6 +68,12 @@ import qualified DNSKey as DNS | |||
68 | import Data.Time.Clock.POSIX ( posixSecondsToUTCTime ) | 68 | import Data.Time.Clock.POSIX ( posixSecondsToUTCTime ) |
69 | import Debug.Trace | 69 | import Debug.Trace |
70 | 70 | ||
71 | #if !MIN_VERSION_base(4,8,0) | ||
72 | sortOn :: Ord b => (a -> b) -> [a] -> [a] | ||
73 | sortOn 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 | ||