hdirect-0.21.0: An IDL compiler for Haskell

Utils

Synopsis

# Documentation

mapFromMb :: b -> (a -> b) -> Maybe a -> bSource

mapMb :: (a -> b) -> Maybe a -> Maybe bSource

mapMbM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b)Source

toMaybe :: (a -> Bool) -> a -> Maybe aSource

split :: Eq a => a -> [a] -> [[a]]Source

splitLast :: Eq a => [a] -> [a] -> ([a], [a])Source

splitLastBy :: ([a] -> Bool) -> ([a] -> [a]) -> [a] -> ([a], [a])Source

prefix :: Eq a => [a] -> [a] -> Maybe [a]Source

traceIf :: Bool -> String -> a -> aSource

elemBy :: (a -> Bool) -> [a] -> BoolSource

mapUnzip :: (a -> (b, c)) -> [a] -> ([b], [c])Source

diff :: Num a => [a] -> [a]Source

(#) :: a -> (a -> b) -> bSource

trace :: String -> a -> a

When called, `trace` outputs the string in its first argument, before returning the second argument as its result. The `trace` function is not referentially transparent, and should only be used for debugging, or for monitoring execution. Some implementations of `trace` may decorate the string that's output to indicate that you're tracing. The function is implemented on top of `putTraceMsg`.

bailIf :: Bool -> a -> a -> aSource

decons :: [a] -> ([a], a)Source

safe_init :: [a] -> [a]Source

snoc :: [a] -> a -> [a]Source

mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])Source
{"ft_lang_label":"__label__en","ft_lang_prob":0.75940055,"math_prob":0.9311611,"size":1861,"snap":"2020-45-2020-50","text_gpt3_token_len":614,"char_repetition_ratio":0.21647818,"word_repetition_ratio":0.23441397,"special_character_ratio":0.44922084,"punctuation_ratio":0.25513196,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9694105,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-12-04T08:41:07Z\",\"WARC-Record-ID\":\"<urn:uuid:305bfdba-2012-4c80-b7d5-5788187b54b3>\",\"Content-Length\":\"18475\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:89d4c4c4-7f8b-4482-a139-13fc2bd8a0f7>\",\"WARC-Concurrent-To\":\"<urn:uuid:95c1b63a-1e36-429c-a6e8-9e50157eaa7b>\",\"WARC-IP-Address\":\"151.101.200.68\",\"WARC-Target-URI\":\"http://hackage.haskell.org/package/hdirect-0.21.0/docs/Utils.html\",\"WARC-Payload-Digest\":\"sha1:FCOZMP6NTX47OA7T6WD3GYTNUA7AITQ6\",\"WARC-Block-Digest\":\"sha1:JJO5TG3ENZFJIPGYY4J2TIIB4EIKMBKV\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141735395.99_warc_CC-MAIN-20201204071014-20201204101014-00583.warc.gz\"}"}