classy-prelude-0.4.1: A typeclass-based Prelude.

Safe HaskellNone

ClassyPrelude

Contents

Synopsis

CorePrelude

Standard

Monoid

concat :: Monoid m => [m] -> mSource

append :: Monoid m => m -> m -> mSource

(++) :: Monoid m => m -> m -> mSource

Monad

Non-standard

List-like classes

map :: CanMap f i o => (i -> o) -> fSource

concatMap :: CanConcatMap f i o => (i -> o) -> fSource

filter :: CanFilter f i => (i -> Bool) -> fSource

length :: CanLength c len => c -> lenSource

singleton :: CanSingleton c i => i -> cSource

null :: CanNull c => c -> BoolSource

pack :: CanPack c i => [i] -> cSource

unpack :: CanPack c i => c -> [i]Source

repack :: (CanPack a i, CanPack b i) => a -> bSource

Repack from one type to another, dropping to a list in the middle.

repack = pack . unpack.

fromList :: CanPack c i => [i] -> cSource

toList :: CanPack c i => c -> [i]Source

mapM :: CanMapM f m i o => (i -> m o) -> fSource

mapM_ :: CanMapM_ f m i => (i -> m o) -> fSource

forM :: CanMapMFunc ci mco m i o => ci -> (i -> m o) -> mcoSource

forM_ :: (Monad m, CanMapM_Func ci i) => ci -> (i -> m o) -> m ()Source

replicateM :: (CanReplicateM c i len, Monad m) => len -> m i -> m cSource

break :: CanBreak c i => (i -> Bool) -> c -> (c, c)Source

span :: CanBreak c i => (i -> Bool) -> c -> (c, c)Source

dropWhile :: CanBreak c i => (i -> Bool) -> c -> cSource

takeWhile :: CanBreak c i => (i -> Bool) -> c -> cSource

any :: CanAny c i => (i -> Bool) -> c -> BoolSource

all :: CanAny c i => (i -> Bool) -> c -> BoolSource

splitAt :: CanSplitAt c i => i -> c -> (c, c)Source

take :: CanSplitAt c i => i -> c -> cSource

drop :: CanSplitAt c i => i -> c -> cSource

fold :: CanFold f i accum => (accum -> i -> accum) -> accum -> fSource

Strict left fold.

words :: CanWords t => t -> [t]Source

unwords :: CanWords t => [t] -> tSource

unlines :: CanUnlines t => [t] -> tSource

split :: CanSplit c i => (i -> Bool) -> c -> [c]Source

reverse :: CanReverse a => a -> aSource

readMay :: (Read b, CanPack a Char) => a -> Maybe bSource

replicate :: CanReplicate a i len => len -> i -> aSource

Map-like

lookup :: CanLookup c k v => k -> c -> Maybe vSource

delete :: CanDelete c k => k -> c -> cSource

Set-like

member :: CanMember c k => k -> c -> BoolSource

elem :: CanMember c k => k -> c -> BoolSource

Text-like

show :: (Show a, CanPack c Char) => a -> cSource

Files

Chunking

toChunks :: CanToChunks c i => c -> [i]Source

fromChunks :: CanToChunks c i => [i] -> cSource

Force types

asList :: [a] -> [a]Source

asMap :: Map k v -> Map k vSource

asSet :: Set a -> Set aSource