module Language.Haskell.LSP.Utility where
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import qualified Data.ByteString.Lazy.Char8 as B
import qualified Data.Text as T
import qualified Data.Text.Encoding as TE
import qualified Data.Text.Lazy as TL
import qualified Data.Text.Lazy.Encoding as TLE
import Language.Haskell.LSP.Constant
import System.Log.Logger
{-# ANN module ("HLint: ignore Eta reduce" :: String) #-}
{-# ANN module ("HLint: ignore Redundant do" :: String) #-}
{-# ANN module ("HLint: ignore Reduce duplication" :: String) #-}
str2bs :: String -> BS.ByteString
str2bs :: String -> ByteString
str2bs = Text -> ByteString
TE.encodeUtf8 (Text -> ByteString) -> (String -> Text) -> String -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
T.pack
bs2str :: BS.ByteString -> String
bs2str :: ByteString -> String
bs2str = Text -> String
T.unpack(Text -> String) -> (ByteString -> Text) -> ByteString -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> Text
TE.decodeUtf8
str2lbs :: String -> LBS.ByteString
str2lbs :: String -> ByteString
str2lbs = Text -> ByteString
TLE.encodeUtf8 (Text -> ByteString) -> (String -> Text) -> String -> ByteString
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Text
TL.pack
lbs2str :: LBS.ByteString -> String
lbs2str :: ByteString -> String
lbs2str = Text -> String
TL.unpack(Text -> String) -> (ByteString -> Text) -> ByteString -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ByteString -> Text
TLE.decodeUtf8
logs :: String -> IO ()
logs :: String -> IO ()
logs String
s = String -> String -> IO ()
debugM String
_LOG_NAME String
s
logm :: B.ByteString -> IO ()
logm :: ByteString -> IO ()
logm ByteString
str = String -> IO ()
logs (ByteString -> String
lbs2str ByteString
str)