aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Shared
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2017-10-04 16:56:11 +0200
committerDaniel Gröber <dxld@darkboxed.org>2017-10-04 16:56:11 +0200
commit1e36bd795f2045271d0f413db60de184b20dfc39 (patch)
treea32578e938a09c85e2a9ae792e01f80ccdf38a17 /src/CabalHelper/Shared
parenta3f381ba91898ce674f0fe5c948fad9ceb03b61e (diff)
Move 'trim' to common
Diffstat (limited to 'src/CabalHelper/Shared')
-rw-r--r--src/CabalHelper/Shared/Common.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/CabalHelper/Shared/Common.hs b/src/CabalHelper/Shared/Common.hs
index 239fe3c..6a12d86 100644
--- a/src/CabalHelper/Shared/Common.hs
+++ b/src/CabalHelper/Shared/Common.hs
@@ -25,6 +25,7 @@ module CabalHelper.Shared.Common where
import Control.Applicative
import Control.Exception as E
import Control.Monad
+import Data.Char
import Data.List
import Data.Maybe
import Data.Version
@@ -82,6 +83,9 @@ parsePkgId bs =
parseVer :: String -> Version
parseVer vers = runReadP parseVersion vers
+trim :: String -> String
+trim = dropWhileEnd isSpace
+
majorVer :: Version -> Version
majorVer (Version b _) = Version (take 2 b) []