Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- type (|->) a b = HashMap a b
- firstMaybe :: (a -> Maybe b) -> [a] -> Maybe b
- asyncMapM :: (a -> IO b) -> [a] -> IO [b]
- traceShow :: Show a => String -> a -> a
- hashMapToAscList :: Ord a => HashMap a b -> [(a, b)]
- findNearest :: (Ord i, Num i) => i -> [(i, a)] -> Maybe a
- argMin :: Ord k => [(k, v)] -> Maybe v
- headMb :: [a] -> Maybe a
- getUniqueInt :: IO Int
- editDistance :: Eq a => [a] -> [a] -> Int
- data Moods
- moodColor :: Moods -> Color
- wrapStars :: String -> String
- withColor :: Color -> IO () -> IO ()
- colorStrLn :: Moods -> String -> IO ()
- colorPhaseLn :: Moods -> String -> String -> IO ()
- startPhase :: Moods -> String -> IO ()
- doneLine :: Moods -> String -> IO ()
- donePhase :: Moods -> String -> IO ()
- putBlankLn :: IO ()
- wrap :: [a] -> [a] -> [a] -> [a]
- repeats :: Int -> [a] -> [a]
- errorP :: String -> String -> a
- errorstar :: (?callStack :: CallStack) => String -> a
- fst3 :: (a, b, c) -> a
- snd3 :: (a, b, c) -> b
- thd3 :: (a, b, c) -> c
- secondM :: Functor f => (b -> f c) -> (a, b) -> f (a, c)
- mlookup :: (?callStack :: CallStack, Eq k, Show k, Hashable k) => HashMap k v -> k -> v
- safeLookup :: (?callStack :: CallStack, Eq k, Hashable k) => String -> k -> HashMap k v -> v
- mfromJust :: (?callStack :: CallStack) => String -> Maybe a -> a
- inserts :: (Eq k, Hashable k) => k -> v -> HashMap k [v] -> HashMap k [v]
- removes :: (Eq k, Hashable k, Eq v) => k -> v -> HashMap k [v] -> HashMap k [v]
- count :: (Eq k, Hashable k) => [k] -> [(k, Int)]
- group :: (Eq k, Hashable k) => [(k, v)] -> HashMap k [v]
- groupBase :: (Eq k, Hashable k) => HashMap k [v] -> [(k, v)] -> HashMap k [v]
- groupList :: (Eq k, Hashable k) => [(k, v)] -> [(k, [v])]
- groupMap :: (Eq k, Hashable k) => (a -> k) -> [a] -> HashMap k [a]
- allMap :: (Eq k, Hashable k) => (v -> Bool) -> HashMap k v -> Bool
- setNub :: Ord k => [k] -> [k]
- sortNub :: Ord a => [a] -> [a]
- sortNubBy :: Eq a => (a -> a -> Ordering) -> [a] -> [a]
- nubOrd :: Eq a => [a] -> [a]
- hashNubWith :: Ord b => (a -> b) -> [a] -> [a]
- mFromList :: (Eq k, Hashable k) => [(k, v)] -> HashMap k v
- duplicates :: (Eq k, Hashable k) => [k] -> [k]
- safeZip :: (?callStack :: CallStack) => String -> [a] -> [b] -> [(a, b)]
- safeZipWith :: (?callStack :: CallStack) => String -> (a -> b -> c) -> [a] -> [b] -> [c]
- type ListNE a = [a]
- safeHead :: (?callStack :: CallStack) => String -> ListNE a -> a
- safeLast :: (?callStack :: CallStack) => String -> ListNE a -> a
- safeInit :: (?callStack :: CallStack) => String -> ListNE a -> [a]
- safeUncons :: (?callStack :: CallStack) => String -> ListNE a -> (a, [a])
- safeUnsnoc :: (?callStack :: CallStack) => String -> ListNE a -> ([a], a)
- safeFromList :: (?callStack :: CallStack, Eq k, Hashable k, Show k) => String -> [(k, v)] -> HashMap k v
- executeShellCommand :: String -> String -> IO ExitCode
- applyNonNull :: b -> ([a] -> b) -> [a] -> b
- arrow :: Doc
- dcolon :: Doc
- intersperse :: Doc -> [Doc] -> Doc
- tshow :: Show a => a -> Doc
- writeLoud :: String -> IO ()
- ensurePath :: FilePath -> IO ()
- fM :: Monad m => (a -> b) -> a -> m b
- whenM :: Monad m => m Bool -> m () -> m ()
- ifM :: Monad m => m Bool -> m a -> m a -> m a
- mapEither :: (a -> Either b c) -> [a] -> ([b], [c])
- isRight :: Either a b -> Bool
- componentsWith :: Ord c => (a -> [(b, c, [c])]) -> a -> [[b]]
- topoSortWith :: Ord v => (a -> (v, [v])) -> [a] -> [a]
- sccsWith :: Ord v => (a -> (v, [v])) -> [a] -> [[a]]
- exTopo :: [Int]
- type EqHash a = (Eq a, Ord a, Hashable a)
- coalesce :: EqHash v => [ListNE v] -> [ListNE v]
- coalesceEdges :: EqHash v => [ListNE v] -> [(v, v, [v])]
- mapFst :: (a -> c) -> (a, b) -> (c, b)
- mapSnd :: (b -> c) -> (a, b) -> (a, c)
- allCombinations :: [[a]] -> [[a]]
- powerset :: [a] -> [[a]]
- (=>>) :: Monad m => m b -> (b -> m a) -> m b
- (<<=) :: Monad m => (b -> m a) -> m b -> m b
- nubDiff :: (Eq a, Hashable a) => [a] -> [a] -> HashSet a
- fold1M :: Monad m => (a -> a -> m a) -> [a] -> m a
Documentation
firstMaybe :: (a -> Maybe b) -> [a] -> Maybe b Source #
hashMapToAscList :: Ord a => HashMap a b -> [(a, b)] Source #
getUniqueInt :: IO Int Source #
Unique Int -----------------------------------------------
editDistance :: Eq a => [a] -> [a] -> Int Source #
Edit Distance --------------------------------------------
putBlankLn :: IO () Source #
safeLookup :: (?callStack :: CallStack, Eq k, Hashable k) => String -> k -> HashMap k v -> v Source #
hashNubWith :: Ord b => (a -> b) -> [a] -> [a] Source #
duplicates :: (Eq k, Hashable k) => [k] -> [k] Source #
safeZipWith :: (?callStack :: CallStack) => String -> (a -> b -> c) -> [a] -> [b] -> [c] Source #
safeFromList :: (?callStack :: CallStack, Eq k, Hashable k, Show k) => String -> [(k, v)] -> HashMap k v Source #
applyNonNull :: b -> ([a] -> b) -> [a] -> b Source #
ensurePath :: FilePath -> IO () Source #
componentsWith :: Ord c => (a -> [(b, c, [c])]) -> a -> [[b]] Source #
topoSortWith :: Ord v => (a -> (v, [v])) -> [a] -> [a] Source #
sccsWith :: Ord v => (a -> (v, [v])) -> [a] -> [[a]] Source #
>>>
let em = M.fromList [ (1, [2, 3]), (2, [1, 3]), (3, [] ) ]
>>>
let ef = \v -> (v, M.lookupDefault [] v em)
>>>
sccsWith ef [1,2,3]
[[3],[1,2]]
coalesceEdges :: EqHash v => [ListNE v] -> [(v, v, [v])] Source #
allCombinations :: [[a]] -> [[a]] Source #