module BasicPrelude
(
module CorePrelude
, module Data.List
, module Control.Monad
, Foldable
(
foldMap
, foldr
, foldr'
, foldl
, foldl'
, foldr1
, foldl1
)
, elem
, maximum
, minimum
, Traversable
(
traverse
, sequenceA
, mapM
, sequence
)
, map
, empty
, (++)
, concat
, intercalate
, BasicPrelude.sum
, BasicPrelude.product
, tshow
, fromShow
, read
, readIO
, readFile
, writeFile
, appendFile
, Text.lines
, Text.words
, Text.unlines
, Text.unwords
, textToString
, ltextToString
, fpToText
, fpFromText
, fpToString
, encodeUtf8
, decodeUtf8
, Text.getLine
, LText.getContents
, LText.interact
, Prelude.gcd
, Prelude.lcm
, Prelude.Show (..)
, Prelude.ShowS
, Prelude.shows
, Prelude.showChar
, Prelude.showString
, Prelude.showParen
, Prelude.ReadS
, Prelude.readsPrec
, Prelude.readList
, Prelude.reads
, Prelude.readParen
, Prelude.lex
, readMay
, Prelude.putChar
, Prelude.getChar
, Prelude.readLn
) where
import CorePrelude
import Data.List hiding
(
(++)
, concat
, intercalate
, lines
, words
, unlines
, unwords
, map
, sum
, product
, elem
, foldl
, foldl'
, foldl1
, foldr
, foldr'
, foldr1
, maximum
, minimum
)
import Control.Monad hiding
(
mapM
, sequence
)
import Data.Foldable (Foldable(..), elem, maximum, minimum)
import Data.Traversable (Traversable(..))
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import qualified Data.Text.Lazy as LText
import qualified Data.Text.Lazy.IO as LText
import qualified Prelude
import Data.Text.Encoding (encodeUtf8, decodeUtf8With)
import Data.Text.Encoding.Error (lenientDecode)
import qualified Safe
map :: (Functor f) => (a -> b) -> f a -> f b
map = fmap
empty :: Monoid w => w
empty = mempty
infixr 5 ++
(++) :: Monoid w => w -> w -> w
(++) = mappend
concat :: Monoid w => [w] -> w
concat = mconcat
intercalate :: Monoid w => w -> [w] -> w
intercalate xs xss = mconcat (Data.List.intersperse xs xss)
sum :: (Foldable f, Num a) => f a -> a
sum = Data.Foldable.foldl' (+) 0
product :: (Foldable f, Num a) => f a -> a
product = Data.Foldable.foldl' (*) 1
tshow :: Show a => a -> Text
tshow = Text.pack . Prelude.show
fromShow :: (Show a, IsString b) => a -> b
fromShow = fromString . Prelude.show
read :: Read a => Text -> a
read = Prelude.read . Text.unpack
readIO :: Read a => Text -> IO a
readIO = Prelude.readIO . Text.unpack
readFile :: FilePath -> IO Text
readFile = Text.readFile
writeFile :: FilePath -> Text -> IO ()
writeFile = Text.writeFile
appendFile :: FilePath -> Text -> IO ()
appendFile = Text.appendFile
textToString :: Text -> Prelude.String
textToString = Text.unpack
ltextToString :: LText -> Prelude.String
ltextToString = LText.unpack
fpToText :: FilePath -> Text
fpToText = Text.pack
fpFromText :: Text -> FilePath
fpFromText = Text.unpack
fpToString :: FilePath -> Prelude.String
fpToString = id
decodeUtf8 :: ByteString -> Text
decodeUtf8 = decodeUtf8With lenientDecode
readMay :: Read a => Text -> Maybe a
readMay = Safe.readMay . Text.unpack