{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Strict #-}
module VtUtils.Prelude
( Bool(True, False), Either(Left, Right), Eq, Int, IO, Maybe(Just, Nothing), Read, Show, String
, (+), (-), (*), (/), (>), (.), ($), (<)
, (>=), (<=), (==), (/=), ($!), (>>)
, (>>=), (&&), (||), (<$>), (<*>)
, abs, ceiling, div, error, flip, floor, fmap, fromIntegral, fst, id, length, mapM, mapM_, mod
, not, otherwise, pure, read, return, seq, sequence, sequence_, show, snd, take, undefined
, SomeException
, bracket, bracket_, catch, throw, try
, forM, forM_, mfilter, unless, when
, liftIO
, runST
, lift
, FromJSON, ToJSON, Value
, (.=)
, genericParseJSON, genericToJSON, object, parseJSON, toJSON
, encodePretty
, (.&.), (.|.)
, ByteString
, packCString, packCStringLen, useAsCString, useAsCStringLen
, foldl', foldr'
, HashMap
, lookup
, Int64
, fromJust, isJust
, (<>)
, mconcat
, Text
, pack, unpack
, decodeUtf8, encodeUtf8
, peekCStringLen, withCStringLen
, appendFile, getLine, putStrLn, readFile, writeFile
, toStrict
, Builder, fromText, fromLazyText, fromString, toLazyText
, UTCTime
, getCurrentTime
, POSIXTime
, posixSecondsToUTCTime, utcTimeToPOSIXSeconds
, Typeable
, cast
, Vector
, (!)
, fromList, ifoldl', toList
, Word, Word8, Word16, Word32, Word64
, trace
, Ptr
, castPtr, newForeignPtr_, nullPtr, peek, poke, plusPtr, ptrToIntPtr
, CString, CStringLen
, CChar(..), CInt(..), CLong(..), CShort(..), CSize(..), CUChar(..), CUInt(..), CULong(..), CUShort(..)
, copyBytes
, Storable
, alignment, peekByteOff, pokeByteOff, sizeOf
, Generic
, Manager, newManager, parseRequest_, withResponse
, Application, Request, RequestBodyLength(..)
, lazyRequestBody, queryString, rawPathInfo, requestBodyLength, requestHeaders, requestMethod, responseLBS
, (<|>), (<?>)
, dateFormat, dateFormatISO8601, dateParseISO8601
, ffiWithPtr, ffiWithPtrPtr, ffiWithUTF8, ffiWithUTF16
, fsCopyDirectory
, httpContentTypeJSON, httpRequestBodyJSON, httpRequestBodyText, httpRequestPath
, httpRequestHeaders, httpRequestHeadersMap, httpResponseBody, httpResponseBodyJSON, httpResponseBodyText
, httpResponseHeaders, httpResponseHeadersMap
, ioWithFileBytes, ioWithFileText
, jsonDecodeFile,jsonDecodeText, jsonEncodeText, jsonGet, jsonUnwrapUnaryOptions
, mapGet
, Parser
, parsecLineContains, parsecLinePrefix, parsecLineNoPrefix, parsecSkipLines, parsecSkipManyTill
, parsecTry, parsecWhitespace, parsecErrorToText, parsecParseFile, parsecParseText
, pathIsAbsolute, pathConcat, pathPrepend
, processSpawnAndWait
, textShow, textFormat, textFormatParts, textSplit
) where
import Prelude
( Bool(True, False), Either(Left, Right), Eq, Int, IO, Maybe(Just, Nothing), Read, Show, String
, (+), (-), (*), (/), (>), (.), ($), (<)
, (>=), (<=), (==), (/=), ($!), (>>)
, (>>=), (&&), (||), (<$>), (<*>)
, abs, ceiling, div, error, flip, floor, fmap, fromIntegral, fst, id, length, mapM, mapM_, mod
, not, otherwise, pure, read, return, seq, sequence, sequence_, snd, show, take, undefined
)
import Control.Exception (SomeException, bracket, bracket_, catch, throw, try)
import Control.Monad (forM, forM_, mfilter, unless, when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.ST (runST)
import Control.Monad.Trans.Class (lift)
import Data.Aeson (FromJSON, ToJSON, Value, (.=), genericParseJSON, genericToJSON, object, parseJSON, toJSON)
import Data.Aeson.Encode.Pretty (encodePretty)
import Data.Bits ((.&.), (.|.))
import Data.ByteString (ByteString, packCString, packCStringLen, useAsCString, useAsCStringLen)
import Data.Foldable (foldl', foldr')
import Data.HashMap.Strict (HashMap, lookup)
import Data.Int (Int64)
import Data.Maybe (fromJust, isJust)
import Data.Monoid ((<>), mconcat)
import Data.Text (Text, pack, unpack)
import Data.Text.Encoding (decodeUtf8, encodeUtf8)
import Data.Text.Foreign (peekCStringLen, withCStringLen)
import Data.Text.IO (appendFile, getLine, putStrLn, readFile, writeFile)
import Data.Text.Lazy (toStrict)
import Data.Text.Lazy.Builder (Builder, fromText, fromLazyText, fromString, toLazyText)
import Data.Time.Clock (UTCTime, getCurrentTime)
import Data.Time.Clock.POSIX (POSIXTime, posixSecondsToUTCTime, utcTimeToPOSIXSeconds)
import Data.Typeable (Typeable, cast)
import Data.Vector (Vector, (!), fromList, ifoldl', toList)
import Data.Word (Word, Word8, Word16, Word32, Word64)
import Debug.Trace (trace)
import Foreign (Ptr, castPtr, newForeignPtr_, nullPtr, peek, poke, plusPtr, ptrToIntPtr)
import Foreign.C.String (CString, CStringLen)
import Foreign.C.Types (CChar(..), CInt(..), CLong(..), CShort(..), CSize(..), CUChar(..), CUInt(..), CULong(..), CUShort(..))
import Foreign.Marshal.Utils (copyBytes)
import Foreign.Storable (Storable, alignment, peekByteOff, pokeByteOff, sizeOf)
import GHC.Generics (Generic)
import Network.HTTP.Client (Manager, newManager, parseRequest_, withResponse)
import Network.Wai (Application, Request, RequestBodyLength(..)
, lazyRequestBody, queryString, rawPathInfo, requestBodyLength, requestHeaders, requestMethod, responseLBS)
import Text.Parsec ((<|>), (<?>))
import VtUtils.Date (dateFormat, dateFormatISO8601, dateParseISO8601)
import VtUtils.FFI (ffiWithPtr, ffiWithPtrPtr, ffiWithUTF8, ffiWithUTF16)
import VtUtils.FS (fsCopyDirectory)
import VtUtils.HTTP (httpContentTypeJSON, httpRequestBodyJSON, httpRequestBodyText, httpRequestPath
, httpRequestHeaders, httpRequestHeadersMap, httpResponseBody, httpResponseBodyJSON, httpResponseBodyText
, httpResponseHeaders, httpResponseHeadersMap)
import VtUtils.IO (ioWithFileBytes, ioWithFileText)
import VtUtils.JSON (jsonDecodeFile,jsonDecodeText, jsonEncodeText, jsonGet, jsonUnwrapUnaryOptions)
import VtUtils.Map (mapGet)
import VtUtils.Parsec (Parser, parsecLineContains, parsecLinePrefix, parsecLineNoPrefix, parsecSkipLines
, parsecSkipManyTill, parsecTry, parsecWhitespace, parsecErrorToText, parsecParseFile, parsecParseText )
import VtUtils.Path (pathIsAbsolute, pathConcat, pathPrepend)
import VtUtils.Process (processSpawnAndWait)
import VtUtils.Text (textShow, textFormat, textFormatParts, textSplit)