module System.MemInfo.Prelude (
isNull,
isNullOrSpace,
readUtf8Text,
module Control.Concurrent,
module Control.Exception,
module Control.Monad,
module Data.Char,
module Data.Foldable,
module Data.Hashable,
module Data.List,
module Data.List.NonEmpty,
module Data.Maybe,
module Data.Map.Strict,
module Data.Set,
module Data.Text,
module Data.Text.Encoding,
module Numeric.Natural,
module System.FilePath,
module System.Directory,
module System.IO.Error,
module System.IO,
module System.Posix.Types,
module Text.Read,
) where
import Control.Concurrent (threadDelay)
import Control.Exception (handle, throwIO)
import Control.Monad (filterM, unless, when)
import qualified Data.ByteString as BS
import Data.Char (isSpace)
import Data.Foldable (foldlM)
import Data.Hashable (hash)
import Data.List (foldl')
import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
import Data.Map.Strict (Map)
import Data.Maybe (isJust, mapMaybe)
import Data.Set (Set)
import Data.Text (Text)
import Data.Text.Encoding (decodeUtf8)
import Numeric.Natural (Natural)
import System.Directory (
doesFileExist,
getSymbolicLinkTarget,
listDirectory,
)
import System.FilePath (takeBaseName)
import System.IO (stderr)
import System.IO.Error (isDoesNotExistError, isPermissionError)
import System.Posix.Types (CPid (..), ProcessID)
import Text.Read (readEither, readMaybe)
isNull :: Char -> Bool
isNull :: Char -> Bool
isNull = (forall a. Eq a => a -> a -> Bool
== Char
'\0')
isNullOrSpace :: Char -> Bool
isNullOrSpace :: Char -> Bool
isNullOrSpace Char
x = Char -> Bool
isSpace Char
x Bool -> Bool -> Bool
|| Char -> Bool
isNull Char
x
readUtf8Text :: FilePath -> IO Text
readUtf8Text :: FilePath -> IO Text
readUtf8Text = forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ByteString -> Text
decodeUtf8 forall b c a. (b -> c) -> (a -> b) -> a -> c
. FilePath -> IO ByteString
BS.readFile