Skip to content

Commit

Permalink
Making Vado compile with base 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Frumin committed Jun 25, 2013
1 parent 5c4adb5 commit 8d62f47
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/System/Process/Vado.hs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE CPP #-}
-----------------------------------------------------------------------------
--
-- Module : System.Process.Vado
Expand Down Expand Up @@ -36,11 +37,22 @@ import qualified Data.Attoparsec.Text as P (takeWhile1)
import Data.Text.IO (hPutStrLn)
import System.FilePath (addTrailingPathSeparator, makeRelative, (</>))
import Data.Maybe (catMaybes, fromMaybe)
#if MIN_VERSION_base(4,6,0)
import Text.Read (readMaybe)
#endif
import System.Exit (ExitCode)
import System.Process (readProcess)
import System.Directory (getHomeDirectory, getCurrentDirectory)

#if !MIN_VERSION_base(4,6,0)
-- | Parse a string using the 'Read' instance.
-- Succeeds if there is exactly one valid result.
readMaybe :: Read a => String -> Maybe a
readMaybe s = case readEither s of
Left _ -> Nothing
Right a -> Just a
#endif

-- | Remote file system mount point
data MountPoint = MountPoint {
remoteUser :: Text -- ^ Account used on remote machine
Expand Down

0 comments on commit 8d62f47

Please sign in to comment.