module ClassyPrelude
(
module CorePrelude
, empty
, append
, (++)
, module Control.Monad
, module Control.Concurrent.MVar.Lifted
, module Data.IORef.Lifted
, map
, concat
, concatMap
, filter
, find
, length
, singleton
, null
, pack
, unpack
, repack
, fromList
, toList
, mapM
, mapM_
, forM
, forM_
, replicateM
, stripPrefix
, isPrefixOf
, stripSuffix
, isSuffixOf
, isInfixOf
, break
, span
, dropWhile
, takeWhile
, any
, all
, splitAt, take, drop
, fold
, words
, unwords
, lines
, unlines
, split
, reverse
, readMay
, replicate
, intercalate
, intersperse
, encodeUtf8
, decodeUtf8
, subsequences
, permutations
, partition
, nub
, nubBy
, sort
, sortBy
, sortWith
, cons
, uncons
, lookup
, insert
, delete
, member
, notMember
, elem
, notElem
, union
, difference
, (\\)
, intersection
, intersect
, unions
, show
, toLower
, toUpper
, toCaseFold
, toStrict
, fromStrict
, readFile
, writeFile
, getLine
, print
, toChunks
, fromChunks
, asByteString
, asLByteString
, asHashMap
, asHashSet
, asText
, asLText
, asList
, asMap
, asMaybe
, asSet
, asVector
) where
import qualified Prelude
import Control.Monad (when, unless, void, liftM, ap, forever, join, sequence, sequence_)
import Control.Concurrent.MVar.Lifted
import Data.IORef.Lifted
import Data.Monoid (Monoid)
import qualified Data.Monoid as Monoid
import Data.Foldable (Foldable)
import qualified Data.Foldable as Foldable
import CorePrelude hiding (print)
import ClassyPrelude.Classes
import ClassyPrelude.ByteString ()
import ClassyPrelude.Char ()
import ClassyPrelude.Classes ()
import ClassyPrelude.FilePath ()
import ClassyPrelude.HashMap ()
import ClassyPrelude.HashSet ()
import ClassyPrelude.LByteString ()
import ClassyPrelude.LText ()
import ClassyPrelude.List ()
import ClassyPrelude.Map ()
import ClassyPrelude.Maybe ()
import ClassyPrelude.Set ()
import ClassyPrelude.Text ()
import ClassyPrelude.Vector ()
show :: (Show a, CanPack c Char) => a -> c
show = pack . Prelude.show
fromList :: CanPack c i => [i] -> c
fromList = pack
toList :: CanPack c i => c -> [i]
toList = unpack
readMay :: (Read b, CanPack a Char) => a -> Maybe b
readMay a =
case [x | (x, t) <- Prelude.reads (unpack a), null t] of
[x] -> Just x
_ -> Nothing
repack :: (CanPack a i, CanPack b i) => a -> b
repack = pack . unpack
append :: Monoid m => m -> m -> m
append = mappend
empty :: Monoid m => m
empty = mempty
infixr 5 ++
(++) :: Monoid m => m -> m -> m
(++) = mappend
infixl 9 \\
(\\) :: CanDifference c => c -> c -> c
(\\) = difference
intersect :: CanIntersection c => c -> c -> c
intersect = intersection
unions :: (Foldable cc, Monoid c, CanUnion c) => cc c -> c
unions = Foldable.foldl' union Monoid.mempty
intercalate :: (CanConcat c i, CanIntersperse c i) => i -> c -> i
intercalate xs xss = concat (intersperse xs xss)
asByteString :: ByteString -> ByteString
asByteString = id
asLByteString :: LByteString -> LByteString
asLByteString = id
asHashMap :: HashMap k v -> HashMap k v
asHashMap = id
asHashSet :: HashSet a -> HashSet a
asHashSet = id
asText :: Text -> Text
asText = id
asLText :: LText -> LText
asLText = id
asList :: [a] -> [a]
asList = id
asMap :: Map k v -> Map k v
asMap = id
asMaybe :: Maybe a -> Maybe a
asMaybe = id
asSet :: Set a -> Set a
asSet = id
asVector :: Vector a -> Vector a
asVector = id
forM :: CanMapM ci mco m i o => ci -> (i -> m o) -> mco
forM = flip mapM
forM_ :: (Monad m, CanMapM_ ci i) => ci -> (i -> m o) -> m ()
forM_ = flip mapM_
elem :: CanMember c k => k -> c -> Bool
elem = member
notElem :: CanMember c k => k -> c -> Bool
notElem = notMember
print :: (Show a, MonadIO m) => a -> m ()
print = liftIO . Prelude.print
take :: CanSplitAt c i => i -> c -> c
take i c = Prelude.fst (splitAt i c)
drop :: CanSplitAt c i => i -> c -> c
drop i c = Prelude.snd (splitAt i c)
sortWith :: (CanSortBy c a, Ord b) => (a -> b) -> c a -> c a
sortWith f = sortBy $ comparing f