#        !" # $ % &' ( ) *+,-./01234 56789:; < = > ?@AB C DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                      !"#$%&'()*+,-./01234567 8 9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                         !"#$%&'()*+,-. / 0 1 2 3 4 5 6789:; < =>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc d e fghij k l m nopqrstuvwxyz{|}~                        !     """"""""""""##### #!#"###$#%#&#'#(#)#*#+#,#-#.#/#0#1#2#3#4#5$6$7$8$9%:%;%<%=%>%?%@%A%B%C%D%E%F%G%H%I%J%K%L&M&N&O&P&Q&R'S'T'U'V'W'X'Y'Z'['\(](^(_(`(a(b)c)d)e)f)g)h)i)j*k*l+m+n+o+p+q+r+s+t+u+v+w+x+y+z+{+|,}-~-----..////7 \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk5;reludeShorter alias for pure ().pass :: Maybe ()Just ()<reludeNamed version of the  operator, which is 'P but flipped. For chaining applicative operations in forward applications using 0.Just (+ 1) & appliedTo (Just 2)Just 32Just (+) & appliedTo (Just 1) & appliedTo (Just 2)Just 3Nothing & appliedTo (Just 2)Nothing<(');<<(');<\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortable Trustworthy/Xk9QQ *+ ,389?@AEPhijSZ[\]^_k !#"ACBEDLKJIHQE,3PhijACBSkLKJIH ^Z[ED9*+ ?8@\] !#"A_\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk>h Dae Dae\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortable Trustworthy/XkAk !   ! (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkCr<=><=>\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkI=reludeRenamed version of 12. identity 1010fmap identity [1,2,3][1,2,3] FG= FG=Z(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkL&1lmnopqrutsxwv{zy~}|&1lmnopqrutsxwv{zy~}|Z(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkT>relude Alias for  fmap . fmap%. Convenient to work with two nested 1s.negate <<$>> Just [1,2,3]Just [-1,-2,-3]?reludeTakes a function in a 1* context and applies it to a normal value.flap (++) "relude" "P" "Prelude"@reludeOperator version of the ? function.[(+2), (*3)] ?? 5[7,15]Just (+3) ?? 5Just 8>?@>?@>4@43Z(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkW*1lmnopqrutsxwv{zy~}|>?@\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk`lAreludeLifted version of 45.exitWith (ExitFailure 3)*** Exception: ExitFailure 3exitWith ExitSuccess*** Exception: ExitSuccessBreludeLifted version of 46. exitFailure*** Exception: ExitFailure 1CreludeLifted version of 47. exitSuccess*** Exception: ExitSuccessDreludeLifted version of 48.die "Goodbye!"Goodbye!*** Exception: ExitFailure 1ABCDABCD\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xky EreludeLifted version of .ref <- newIORef False:t refref :: IORef BoolFreludeLifted version of .ref <- newIORef 42 readIORef ref42GreludeLifted version of .ref <- newIORef 42writeIORef ref 43 readIORef ref43HreludeLifted version of .ref <- newIORef 42modifyIORef ref (\a -> a + 6) readIORef ref48To avoid space-leaks, see I for stricter updatesFor atomic updates, see JIreludeLifted version of .ref <- newIORef 42modifyIORef' ref (\a -> a + 3) readIORef ref45For lazier updates, see HFor atomic updates, see KJreludeLifted version of .ref <- newIORef 42(atomicModifyIORef ref (\a -> (a, a + 3))45 readIORef ref42To avoid space-leaks, see K for stricter updates3If you are not interested in the return value, see LKreludeLifted version of .ref <- newIORef 42)atomicModifyIORef' ref (\a -> (a, a + 3))45 readIORef ref42For lazier updates, see J3If you are not interested in the return value, see MLrelude Version of J< that discards return value. Useful when you want to update , but not interested in the returning result.ref <- newIORef 42 atomicModifyIORef_ ref (`div` 2) readIORef ref21Mrelude Version of K< that discards return value. Useful when you want to update , but not interested in the returning result.ref <- newIORef 42!atomicModifyIORef'_ ref (`div` 2) readIORef ref21NreludeLifted version of .ref <- newIORef 42atomicWriteIORef ref 45 readIORef ref45 EFGHIJKLMN JKLMNHIEFG\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortable Trustworthy/XkxOrelude~Creates an infinite list from a finite list by appending the list to itself infinite times (i.e. by cycling the list). Unlike cycle from  Data.List\, this implementation doesn't throw error on empty lists, but returns an empty list instead.cycle [][]take 10 $ cycle [1,2,3][1,2,3,1,2,3,1,2,3,1],$%&'()*+,-./012345O,$%&'()*+,-./012345O\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkgU&0:OcdYfg;<=>?@     67:98U     67:98&0:OcdYfg;<=>?@\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkPrelude Similar to  but with flipped arguments.readMaybe "True" ?: FalseTruereadMaybe "Tru" ?: FalseFalseQreludeSpecialized version of 9: for O!. It's used for code readability.!Also helps to avoid space leaks:  Ohttp://www.snoyman.com/blog/2017/01/foldable-mapm-maybe-and-recursive-functionsFoldable.mapM_ space leak.&whenJust Nothing $ \b -> print (not b)*whenJust (Just True) $ \b -> print (not b)FalseRreludeMonadic version of Q..whenJustM (pure Nothing) $ \b -> print (not b)2whenJustM (pure $ Just True) $ \b -> print (not b)FalseSreludePerforms default < action if c( is given. Otherwise returns content of d pured to <.!whenNothing Nothing [True, False] [True,False]%whenNothing (Just True) [True, False][True]TreludePerforms default < action if c is given. Do nothing for d. Convenient for discarding d content.+whenNothing_ Nothing $ putTextLn "Nothing!"Nothing!/whenNothing_ (Just True) $ putTextLn "Nothing!"UreludeMonadic version of U.>whenNothingM (pure $ Just True) $ True <$ putTextLn "Is Just!"True>whenNothingM (pure Nothing) $ False <$ putTextLn "Is Nothing!" Is Nothing!FalseVreludeMonadic version of V.7whenNothingM_ (pure $ Just True) $ putTextLn "Is Just!"6whenNothingM_ (pure Nothing) $ putTextLn "Is Nothing!" Is Nothing!WreludeThe monadic version of the ;< function.:{#evenInHalf :: Int -> IO (Maybe Int) evenInHalf n& | even n = pure $ Just $ n `div` 2 | otherwise = pure Nothing:}mapMaybeM evenInHalf [1..10] [1,2,3,4,5]PQRSTUVWPQRSTUVWP0\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortable Trustworthy/Xk_ Xrelude$Shorter and more readable alias for flip runReaderT.usingReaderT 42 $ asks (+5)47Yrelude$Shorter and more readable alias for flip runReader.usingReader 42 $ asks (+5)47ZreludeFThis function helps with optimizing performance when working with the C transformer. If you have code like below, that is called in a loop step :: Instruction -> % Config IO Result step instruction = case instruction of Add -> do stuff ... Del -> do stuff ... Byou can improve performance of your Haskell applications by using Z in the following way: step :: Instruction -> % Config IO Result step instruction = Z $ case instruction of Add -> do stuff ... Del -> do stuff ... =For a detailed explanation, refer to the following blog post: Ohttps://www.joachim-breitner.de/blog/763-Faster_Winter_5__Eta-Expanding_ReaderT=Faster Winter 5: Eta-Expanding ReaderT (by Joachim Breitners)[relude$Shorter and more readable alias for flip runStateT.$usingStateT 0 $ put 42 >> pure False (False,42)\relude$Shorter and more readable alias for  flip runState.]relude Alias for flip evalStateTE. It's not shorter but sometimes more readable. Done by analogy with using* functions family.^relude Alias for flip evalStateE. It's not shorter but sometimes more readable. Done by analogy with using* functions family._relude Alias for flip execStateTE. It's not shorter but sometimes more readable. Done by analogy with using* functions family.`relude Alias for flip execStateE. It's not shorter but sometimes more readable. Done by analogy with using* functions family.areludeLift a O to the : monadbreludeLift a Y to the   monad XYZ[\]^_`ab YXZ^]`_\[ab \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/7Xkcrelude Extracts C value from O returning # if 9=.+maybeToMonoid (Just [1,2,3] :: Maybe [Int])[1,2,3]&maybeToMonoid (Nothing :: Maybe [Int])[]dreludeHReturns the given value in case of the given predicate is satisfied (is e). Otherwise, it returns #.!memptyIfFalse True (Just "Hello") Just "Hello"$memptyIfFalse False "Doesn't matter"""ereludeJReturns the given value in case of the given predicate is unsatisfied (is a). Otherwise, it returns #. memptyIfTrue True (Just "Hello")Nothing memptyIfTrue False "Does matter" "Does matter"2B"C#$%     cde5C#$%   B"  cde\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk֯freludeLike 1> but runs in  O(n \log n)  time and requires 3.ordNub [3, 3, 3, 2, 2, -1, 1] [3,2,-1,1]greludeLike 1> but runs in  O(n \log_{16} n)  time and requires .hashNub [3, 3, 3, 2, 2, -1, 1] [3,2,-1,1]hreludeLike f runs in  O(n \log n)  but also sorts a list.sortNub [3, 3, 3, 2, 2, -1, 1] [-1,1,2,3]ireludeLike g runs in  O(n \log_{16} n) 7 but has better performance; it doesn't save the order."unstableNub [3, 3, 3, 2, 2, -1, 1] [1,2,3,-1]fghigfhi \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe ,./HUVXkrelude,For tracking usage of Text instead of Stringjreludej takes 0& and splits it into the list by lines..Actual type of this function is the following:  lines :: 0 -> [0] Obut it was given a more complex type to provide friendlier compile time errors.lines ""[]lines "one line" ["one line"]lines "line 1\nline 2"["line 1","line 2"]lines ("string line" :: String)...,... 'lines' works with 'Text', not 'String'. Possible fixes:> 1. Make sure OverloadedStrings extension is enabled.. 2. Apply 'toText' to a single value.2 3. Apply 'map toText' to the list value.... lines True...... 'lines' works with 'Text' But given: 'Bool'...kreludek takes list of 0+ values and joins them with line separator..Actual type of this function is the following:  unlines :: [0] -> 0 Obut it was given a more complex type to provide friendlier compile time errors. unlines []""unlines ["line 1"] "line 1\n"%unlines ["first line", "second line"]"first line\nsecond line\n"*unlines (["line 1", "line 2"] :: [String])....... 'unlines' works with 'Text', not 'String'. Possible fixes:> 1. Make sure OverloadedStrings extension is enabled.. 2. Apply 'toText' to a single value.2 3. Apply 'map toText' to the list value....unlines [True, False]...... 'unlines' works with 'Text' But given: 'Bool'...lreludel takes 0& and splits it into the list by words..Actual type of this function is the following:  words :: 0 -> [0] Obut it was given a more complex type to provide friendlier compile time errors.words ""[]words "one line"["one","line"]words " >_< "[">_<"] words ("string words" :: String)...,... 'words' works with 'Text', not 'String'. Possible fixes:> 1. Make sure OverloadedStrings extension is enabled.. 2. Apply 'toText' to a single value.2 3. Apply 'map toText' to the list value.... words True...... 'words' works with 'Text' But given: 'Bool'...mreludem takes list of 0, values and joins them with space character..Actual type of this function is the following:  unwords :: [0] -> 0 Obut it was given a more complex type to provide friendlier compile time errors. unwords []""unwords ["singleWord"] "singleWord"unwords ["word", "another"]"word another")unwords (["word", "another"] :: [String])....... 'unwords' works with 'Text', not 'String'. Possible fixes:> 1. Make sure OverloadedStrings extension is enabled.. 2. Apply 'toText' to a single value.2 3. Apply 'map toText' to the list value....unwords [True, False]...... 'unwords' works with 'Text' But given: 'Bool'...4;78./012345jklm;4780jklm./12345\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe./=?@ACHUVXkinrelude'Type class for lazy-strict conversions.relude,Helper type family to produce error messagesqrelude+Type class for converting other strings to .srelude+Type class for converting other strings to .urelude+Type class for converting other strings to 0.wrelude9Type class for conversion to utf8 representation of text.xreludeEncode as utf8 string (usually ?@).$encodeUtf8 @Text @ByteString "?0B0:"*"\208\191\208\176\209\130\208\176\208\186"yreludeDecode from utf8 string.GdecodeUtf8 @Text @ByteString "\208\191\208\176\209\130\208\176\208\186""\1087\1072\1090\1072\1082"SputTextLn $ decodeUtf8 @Text @ByteString "\208\191\208\176\209\130\208\176\208\186"?0B0:zreludeLDecode as utf8 string but returning execption if byte sequence is malformed.CdecodeUtf8 @Text @ByteString "\208\208\176\209\130\208\176\208\186""\65533\1072\1090\1072\1082"IdecodeUtf8Strict @Text @ByteString "\208\208\176\209\130\208\176\208\186"\Left Cannot decode byte '\xd0': Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream{reludeType synonym for A@.|reludeType synonym for BC.}relude Version of  that returns 0 in case of the parse error.readEither @Int "123" Right 123readEither @Int "aa"Left "Prelude.read: no parse"~reludeGeneralized version of 1D . Unlike 1Dm this function is polymorphic in its result type. This makes it more convenient to work with data types like 0 or %. However, if you pass the result of ~X to a function that expects polymorphic argument, this can break type inference, so use -XTypeApplications( to specify the textual type explicitly.show (42 :: Int)"42"show (42 :: Double)"42.0"print (show @Text True)"True"relude Alias for p function.relude Alias for o function.reludereludereluderelude Converting  to J might be a slow operation. Consider using lazy bytestring at first place.relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:+toString ("some string" :: ShortByteString)...?... Type 'ShortByteString' doesn't have instance of 'ToString'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:7 decodeUtf8 :: ShortByteString -> StringO decodeUtf8Strict :: ShortByteString -> Either UnicodeException String...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:'toString ("some string" :: LByteString)...;... Type 'LByteString' doesn't have instance of 'ToString'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:3 decodeUtf8 :: LByteString -> StringK decodeUtf8Strict :: LByteString -> Either UnicodeException String...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:&toString ("some string" :: ByteString)...:... Type 'ByteString' doesn't have instance of 'ToString'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:2 decodeUtf8 :: ByteString -> StringJ decodeUtf8Strict :: ByteString -> Either UnicodeException String...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:*toLText ("some string" :: ShortByteString)...>... Type 'ShortByteString' doesn't have instance of 'ToLText'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:6 decodeUtf8 :: ShortByteString -> LTextN decodeUtf8Strict :: ShortByteString -> Either UnicodeException LText...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:&toLText ("some string" :: LByteString)...:... Type 'LByteString' doesn't have instance of 'ToLText'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:2 decodeUtf8 :: LByteString -> LTextJ decodeUtf8Strict :: LByteString -> Either UnicodeException LText...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:%toLText ("some string" :: ByteString)...9... Type 'ByteString' doesn't have instance of 'ToLText'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:1 decodeUtf8 :: ByteString -> LTextI decodeUtf8Strict :: ByteString -> Either UnicodeException LText...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:)toText ("some string" :: ShortByteString)...=... Type 'ShortByteString' doesn't have instance of 'ToText'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:5 decodeUtf8 :: ShortByteString -> TextM decodeUtf8Strict :: ShortByteString -> Either UnicodeException Text...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:%toText ("some string" :: LByteString)...9... Type 'LByteString' doesn't have instance of 'ToText'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:1 decodeUtf8 :: LByteString -> TextI decodeUtf8Strict :: LByteString -> Either UnicodeException Text...relude&CAUTION2& This instance is for custom error display only.7You should always specify encoding of bytes explicitly.?In case it is used by mistake, the user will see the following:$toText ("some string" :: ByteString)...8... Type 'ByteString' doesn't have instance of 'ToText'.C Use 'decodeUtf8' or 'decodeUtf8Strict' to convert from UTF-8:0 decodeUtf8 :: ByteString -> TextH decodeUtf8Strict :: ByteString -> Either UnicodeException Text...npoqrstuvwyxz{|}~|{wyxzuvstqrnpo}~E\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xkl)4;78./012345jklmnpoqrstuvwyxz{|}~\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/=>?Xkz$reludeLifted version of .putText "Hello, world!" Hello, world!reludeLifted version of .putTextLn "Hello, world!" Hello, world!reludeLifted version of .putLText "Hello, world!" Hello, world!reludeLifted version of .putLTextLn "Hello, world!" Hello, world!reludeLifted version of .%putBS ("Hello, world!" :: ByteString) Hello, world!reludeLifted version of .'putBSLn ("Hello, world!" :: ByteString) Hello, world!reludeLifted version of .'putLBS ("Hello, world!" :: LByteString) Hello, world!reludeLifted version of .)putLBSLn ("Hello, world!" :: LByteString) Hello, world!\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk~[reludeLifted version of .reludeLifted version of .reludeLifted version of .(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .reludeLifted version of .  \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortable Trustworthy,-./27;HSUVXk relude Similar to  but data type.relude Version of FG that leaves warning.increment l = map (+1) lincrement [2, 3, 4][3,4,5]Kincrement l = trace ("incrementing each value of: " ++ show l) (map (+1) l)increment [2, 3, 4]#incrementing each value of: [2,3,4][3,4,5]relude Version of FH that leaves warning.increment l = map (+1) lincrement [2, 3, 4][3,4,5]&increment l = traceShow l (map (+1) l)increment [2, 3, 4][2,3,4][3,4,5]relude Version of FI that leaves warning.'traceShowId (1+2+3, "hello" ++ "world")(6,"helloworld")(6,"helloworld")relude Version of FJ that leaves warning.:{ let action :: Maybe Int action = do x <- Just 3 traceM ("x: " ++ show x) y <- pure 12 traceM ("y: " ++ show y) pure (x*2 + y) in action:}x: 3y: 12Just 18reludeLike  , but uses 9D$ on the argument to convert it to a .:{ let action :: Maybe Int action = do x <- Just 3 traceShowM x y <- pure 12 traceShowM y pure (x*2 + y) in action:}312Just 18relude Version of FK that leaves warning.traceId "hello""hellohello"reludetThrow pure errors. Use this function only to when you are sure that this branch of code execution is not possible.  DO NOT USE & as a normal error handling mechanism. error "oops"*** Exception: oopsCallStack (from HasCallStack):4 error, called at src/Relude/Debug.hs:218:11 in ......&CAUTION & Unlike Prelude version,  takes 9CM as an argument. In case it used by mistake, the user will see the following:error ("oops" :: String)...2... 'error' expects 'Text' but was given 'String'. Possible fixes:< * Make sure OverloadedStrings extension is enabled; * Use 'error (toText msg)' instead of 'error msg'... error False...... 'error' works with 'Text' But given: Bool...relude, that leaves warning in code on every usage.  \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xkǹ reludeMaps left part of Y to O.leftToMaybe (Left True) Just TrueleftToMaybe (Right "aba")NothingreludeMaps right part of Y to O.rightToMaybe (Left True)NothingrightToMaybe (Right "aba") Just "aba"reludeMaps O to Y wrapping default value into f.maybeToRight True (Just "aba") Right "aba"maybeToRight True Nothing Left TruereludeMaps O to Y wrapping default value into g.maybeToLeft True (Just "aba") Left "aba"maybeToLeft True Nothing Right TruereludeApplies given action to Y content if f- is given and returns the result. In case of g$ the default value will be returned.6whenLeft "bar" (Left 42) (\a -> "success!" <$ print a)42 "success!"7whenLeft "bar" (Right 42) (\a -> "success!" <$ print a)"bar"reludeApplies given action to Y content if f is given.whenLeft_ (Right 42) putTextLn whenLeft_ (Left "foo") putTextLnfooreludeMonadic version of .>whenLeftM "bar" (pure $ Left 42) (\a -> "success!" <$ print a)42 "success!"?whenLeftM "bar" (pure $ Right 42) (\a -> "success!" <$ print a)"bar"reludeMonadic version of .&whenLeftM_ (pure $ Right 42) putTextLn(whenLeftM_ (pure $ Left "foo") putTextLnfooreludeApplies given action to Y content if g- is given and returns the result. In case of f$ the default value will be returned.:whenRight "bar" (Left "foo") (\a -> "success!" <$ print a)"bar"8whenRight "bar" (Right 42) (\a -> "success!" <$ print a)42 "success!"reludeApplies given action to Y content if g is given.whenRight_ (Left "foo") printwhenRight_ (Right 42) print42reludeMonadic version of .BwhenRightM "bar" (pure $ Left "foo") (\a -> "success!" <$ print a)"bar"@whenRightM "bar" (pure $ Right 42) (\a -> "success!" <$ print a)42 "success!"reludeMonadic version of .%whenRightM_ (pure $ Left "foo") print#whenRightM_ (pure $ Right 42) print42reludeFor convenient work with :.9::9\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xkrelude>For chaining monadic operations in forward applications using (&) Named version of .0Just [ 1 :: Int ] & chainedTo (viaNonEmpty head)Just 1&Nothing & chainedTo (viaNonEmpty head)Nothingw&0:OcdYfg9:;<=>?@     67:98PQRSTUVWXYZ[\]^_`ab \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe ,./HUVXkrelude)For tracking usage of ordinary list with head-like functions.relude-For safe work with lists using functions for .viaNonEmpty head [1]Just 1viaNonEmpty head []NothingreludePerforms given action over ! list if given list is non empty.+whenNotNull [] $ \(b :| _) -> print (not b)5whenNotNull [False,True] $ \(b :| _) -> print (not b)TruereludeMonadic version of .reludeO(1)". Extracts the first element of a  list..Actual type of this function is the following: head ::  a -> a Obut it was given a more complex type to provide friendlier compile time errors.head ('a' :| "bcde")'a'head [0..5 :: Int] ...5... 'head' works with 'NonEmpty', not ordinary lists. Possible fix: Replace: [Int] With: NonEmpty Int...: However, you can use 'head' with the ordinary lists./ Apply 'viaNonEmpty' function from relude:% viaNonEmpty head (yourList)- Note, that this will return 'Maybe Int'M therefore it is a safe function unlike 'head' from the standard Prelude...head (Just 'a')...+... 'head' works with 'NonEmpty Char' lists But given: Maybe Char...reludeO(n). Return all the elements of a " list except the last one element..Actual type of this function is the following: init ::  a -> [a] Obut it was given a more complex type to provide friendlier compile time errors.init ('a' :| "bcde")"abcd"init [0..5 :: Int] ...5... 'init' works with 'NonEmpty', not ordinary lists. Possible fix: Replace: [Int] With: NonEmpty Int...: However, you can use 'init' with the ordinary lists./ Apply 'viaNonEmpty' function from relude:% viaNonEmpty init (yourList)/ Note, that this will return 'Maybe [Int]'M therefore it is a safe function unlike 'init' from the standard Prelude...init (Just 'a')...+... 'init' works with 'NonEmpty Char' lists But given: Maybe Char...reludeO(n)!. Extracts the last element of a  list..Actual type of this function is the following: last ::  a -> a Obut it was given a more complex type to provide friendlier compile time errors.last ('a' :| "bcde")'e'last [0..5 :: Int] ...5... 'last' works with 'NonEmpty', not ordinary lists. Possible fix: Replace: [Int] With: NonEmpty Int...: However, you can use 'last' with the ordinary lists./ Apply 'viaNonEmpty' function from relude:% viaNonEmpty last (yourList)- Note, that this will return 'Maybe Int'M therefore it is a safe function unlike 'last' from the standard Prelude...last (Just 'a')...+... 'last' works with 'NonEmpty Char' lists But given: Maybe Char...reludeO(1). Return all the elements of a  list after the head element..Actual type of this function is the following: tail ::  a -> [a] Obut it was given a more complex type to provide friendlier compile time errors.tail ('a' :| "bcde")"bcde"tail [0..5 :: Int] ...5... 'tail' works with 'NonEmpty', not ordinary lists. Possible fix: Replace: [Int] With: NonEmpty Int...: However, you can use 'tail' with the ordinary lists./ Apply 'viaNonEmpty' function from relude:% viaNonEmpty tail (yourList)/ Note, that this will return 'Maybe [Int]'M therefore it is a safe function unlike 'tail' from the standard Prelude...tail (Just 'a')...+... 'tail' works with 'NonEmpty Char' lists But given: Maybe Char...  \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe %/;@AXgkPreludeType that represents exceptions used in cases when a particular codepath is not meant to be ever executed, but happens to be executed anyway.reludebPattern synonym to easy pattern matching on exceptions. So instead of writing something like this: isNonCriticalExc :: SomeException -> Bool isNonCriticalExc e | Just (_ :: NodeAttackedError) <- fromException e = True | Just DialogUnexpected{} <- fromException e = True | otherwise = False  you can use  pattern synonym: isNonCriticalExc :: SomeException -> Bool isNonCriticalExc = case Exc (_ :: NodeAttackedError) -> True -- matching all exceptions of type NodeAttackedError Exc DialogUnexpected{} -> True _ -> False +This pattern is bidirectional. You can use Exc e instead of  toException e.reludeHGenerate a pure value which, when forced, will throw the given exceptionrelude^Generate a pure value which, when forced, will synchronously throw the exception wrapped into  data type.  \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk&reludeLifted alias for  with clearer name.let list = [1..5] :: [Int] :sprint listlist = _() <$ evaluateWHNF list :sprint list list = 1 : _reludeLike  but discards value.let list = [1..5] :: [Int] :sprint listlist = _evaluateWHNF_ list :sprint list list = 1 : _relude Alias for evaluateWHNF . force with clearer name.let list = [1..5] :: [Int] :sprint listlist = _() <$ evaluateNF list :sprint listlist = [1,2,3,4,5]relude Alias for evaluateWHNF . rnf . Similar to ! -- but discards resulting value.let list = [1..5] :: [Int] :sprint listlist = _evaluateNF_ list :sprint listlist = [1,2,3,4,5]  \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkDreludeMonadic version of .+whenM (pure False) $ putTextLn "No text :(",whenM (pure True) $ putTextLn "Yes text :)" Yes text :)whenM (Just True) (pure ())Just ()whenM (Just False) (pure ())Just ()whenM Nothing (pure ())NothingreludeMonadic version of .-unlessM (pure False) $ putTextLn "No text :(" No text :(-unlessM (pure True) $ putTextLn "Yes text :)"reludeMonadic version of  if-then-else.@ifM (pure True) (putTextLn "True text") (putTextLn "False text") True textreludeMonadic version of ?. Occasionally useful. Here some complex but real-life example: findSomePath :: IO (Maybe FilePath) somePath :: MaybeT IO FilePath somePath = do path <- MaybeT findSomePath guardM $ liftIO $ doesDirectoryExist path return path reludecEither lifts a value into an alternative context or gives a minimal value depending on a predicate.guarded even 3 :: [Int][]guarded even 2 :: [Int][2],guarded (const True) "hello" :: Maybe String Just "hello"-guarded (const False) "world" :: Maybe StringNothingBYou can use this function to implement smart constructors simpler: newtypey HttpHost = HttpHost { unHttpHost :: Text } mkHttpHost :: Text -> Maybe HttpHost mkHttpHost host = HttpHost <$>  (not . Text.null) host relude-Monadic version of 'Data.Bool.(&&)' operator.Just False &&^ Just True Just FalseJust True &&^ Just True Just TrueJust True &&^ NothingNothingJust False &&^ Nothing Just False-Just False &&^ error "Shouldn't be evaluated" Just Falserelude-Monadic version of 'Data.Bool.(||)' operator.Just False ||^ Just True Just TrueJust False ||^ Just False Just FalseJust False ||^ NothingNothingJust True ||^ Nothing Just True,Just True ||^ error "Shouldn't be evaluated" Just TrueL\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkGDae(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortable Trustworthy/XkPrelude?Transforms an integer number to a bounded integral. It returns c3 for integers outside the bound of the return type.integerToBounded @Int 42Just 42integerToBounded @Int8 1024NothingreludezTransforms an integer number to a natural. Only non-negative integers are considered natural, everything else will return c.integerToNatural (-1)NothingintegerToNatural 0Just 0integerToNatural 10Just 10`-]\[ZYXWVUTSRQPONM. }|/{zyxwv2  56hgfedcba`_^7~F`GbHIJKLMNQRTUVWXijklmnopqrstu`lmHIJKLTUVWXijk-]\[ZYXWVUTSRQPONM6hgfedcba`_^F`Gb2  M. }|/{zyxwv57~QRnopqrstuN \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe /=>?HVXksrelude>Typeclass for data types that can be created from one element.one True :: [Bool][True]one 'a' :: Text"a"&one (3, "hello") :: HashMap Int StringfromList [(3,"hello")]Laws: single-size: " x . size (one x) "a 1(where sizeS is a specific function for each container that returns the size of this container)relude(Type of single element of the structure.reludeCreate a list, map, 0, etc from a single element.reludeCreate singleton .one 42 :: IntSet fromList [42] law> MN ( x) "a 1 reludeCreate singleton .one 42 :: HashSet Int fromList [42] law> 9O ( @( a) x) "a 1 reludeCreate singleton .one 42 :: Set Int fromList [42] law> 9O ( @( a) x) "a 1 reludeCreate singleton  from key-value pair.one (3, "foo") :: IntMap TextfromList [(3,"foo")] law> 9O ( @( a) x) "a 1 reludeCreate singleton   from key-value pair."one (3, "foo") :: HashMap Int TextfromList [(3,"foo")] law> 9O ( @(  k v) (k, v)) "a 1 reludeCreate singleton  from key-value pair.one (3, "foo") :: Map Int TextfromList [(3,"foo")] law> 9O ( @( k v) (k, v)) "a 1 reludeCreate singleton .one 97 :: ShortByteString"a" law>  ( x) "a 1 reludeCreate singleton lazy .one 97 :: LByteString"a" law>  ( x) "a 1 reludeCreate singleton strict .one 97 :: ByteString"a" law>  ( x) "a 1 reludeCreate singleton lazy .one 'a' :: LText"a" law> BO ( x) "a 1 reludeCreate singleton strict 0.one 'a' :: Text"a" law> PO ( x) "a 1 reludeCreate singleton .one 42 :: Seq Int fromList [42] law> 9O ( @( a) x) "a 1 reludeAllows to create singleton + list. You might prefer function with name  instead of 9Q or (:|[]).one 42 :: NonEmpty Int42 :| [] law> 9O ( @( a) x) "a 1 reludeGAllows to create a singleton list. You might prefer function with name  instead of 9Q or (:[]).one 42 :: [Int][42] law> 9O ( @[a] x) "a 1 R\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xkv ! !\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk|reludeSafer version of SM, returns a Maybe. get element from list using index value starting from `0`.[] !!? 0Nothing["a", "b", "c"] !!? 3Nothing[1, 2, 3] !!? (-1)Nothing["a", "b", "c"] !!? 2Just "c"7$%&'()*+,-./012345O9 \(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkMrelude Lifted to  version of .relude Lifted to  version of .relude Lifted to  version of .relude Lifted to  version of .relude Lifted to  version of .relude Lifted to  version of .relude Lifted to  version of .relude Lifted to  version of . relude Lifted to  version of . relude Lifted to  version of . relude Lifted to  version of . relude Lifted to  version of . relude Lifted to  version of .relude Lifted to  version of .#!"#$%&'()*+,-     #    !-,+ *(&%$)'#""\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe -./HUVXk* relude3Type family that produces compile-time errors when  and  functions are used with  and .relude Similar to 1 but takes a function with its arguments flipped."flipfoldl' (/) 5 [2,3] :: Rational15 % 2CThis function can be useful for constructing containers from lists.reludeAlternative version of asum.8asumMap (\x -> if x > 2 then Just x else Nothing) [1..4]Just 3reludePolymorphic version of  concatMapA function.+foldMapA @[Int] (Just . replicate 3) [1..3]Just [1,1,1,2,2,2,3,3,3]reludePolymorphic version of  concatMapM function.+foldMapM @[Int] (Just . replicate 3) [1..3]Just [1,1,1,2,2,2,3,3,3]reludeStricter version of . sum [1..10]55reludeStricter version of .product [1..10]3628800reludeLike  but doesn't work on  and  for performance reasons.elem 'x' ("abc" :: String)False!elem False (one True :: Set Bool) ...B... Do not use 'elem' and 'notElem' methods from 'Foldable' on Set Suggestions: Instead of< elem :: (Foldable t, Eq a) => a -> t a -> Bool use3 member :: Ord a => a -> Set a -> Bool... Instead of? notElem :: (Foldable t, Eq a) => a -> t a -> Bool use not . member...reludeLike  but doesn't work on  and  for performance reasons.notElem 'x' ("abc" :: String)True$notElem False (one True :: Set Bool) ...B... Do not use 'elem' and 'notElem' methods from 'Foldable' on Set Suggestions: Instead of< elem :: (Foldable t, Eq a) => a -> t a -> Bool use3 member :: Ord a => a -> Set a -> Bool... Instead of? notElem :: (Foldable t, Eq a) => a -> t a -> Bool use not . member...reludeMonadic version of .andM [Just True, Just False] Just FalseandM [Just True] Just True%andM [Just True, Just False, Nothing] Just FalseandM [Just True, Nothing]NothingZandM [putTextLn "1" >> pure True, putTextLn "2" >> pure False, putTextLn "3" >> pure True]12FalsereludeMonadic version of .orM [Just True, Just False] Just TrueorM [Just True, Nothing] Just TrueorM [Nothing, Just True]NothingreludeMonadic version of .,allM (readMaybe >=> pure . even) ["6", "10"] Just True-allM (readMaybe >=> pure . even) ["5", "aba"] Just False.allM (readMaybe >=> pure . even) ["aba", "10"]NothingreludeMonadic version of .,anyM (readMaybe >=> pure . even) ["5", "10"] Just True.anyM (readMaybe >=> pure . even) ["10", "aba"] Just True.anyM (readMaybe >=> pure . even) ["aba", "10"]Nothing  T(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/XkH=>#(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortable Trustworthy /HVXkreludeModifiable Map. reludeWRead-only map or set. Contains polymorphic functions which work for both sets and maps.&reludeOperator version of $ function.=let myHashMap = HashMap.fromList [('a', "xxx"), ('b', "yyy")]myHashMap !? 'b' Just "yyy"myHashMap !? 'd'Nothing'relude Inverse of % function.=let myHashMap = HashMap.fromList [('a', "xxx"), ('b', "yyy")]notMember 'b' myHashMapFalsenotMember 'c' myHashMapTrue(reludexReturn the value to which the specified key is mapped, or the default value if this map contains no mapping for the key.=let myHashMap = HashMap.fromList [('a', "xxx"), ('b', "yyy")]!lookupDefault "zzz" 'b' myHashMap"yyy"!lookupDefault "zzz" 'c' myHashMap"zzz")relude:Converts the structure to the list of the key-value pairs.7toPairs (HashMap.fromList [('a', "xxx"), ('b', "yyy")])[('a',"xxx"),('b',"yyy")]*relude/Converts the structure to the list of the keys.4keys (HashMap.fromList [('a', "xxx"), ('b', "yyy")])"ab"+relude1Converts the structure to the list of the values.5elems (HashMap.fromList [('a', "xxx"), ('b', "yyy")]) ["xxx","yyy"],relude-relude.relude/relude0relude1relude2relude3relude4relude(reludeDefault value to return.relude Key to searchreludeContainer to search !"$#%&'()*+ !"$#%&'()*+&9 $(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk5reludeLifted version of PU.6reludeLifted version of 1V.7reludeLifted version of .8reludeLifted version of .56785678W\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xkԗ9!"#$%&'()*+,-ABCDEFGHIJKLMN     56789\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableSafe/Xk   !&*+ ,-]\[ZYXWVUTSRQPONM. }|/{zyxwv012  3456hgfedcba`_^7~89:;<(')=>?@AB"C#$%DaeEF`GbHIJKLMNOcdPhijQRSTUVWXYfgZ[\]^_klmnopqrutsxwv{zy~}|      !#"$%&'()*+,-./012345789:;<=>?@ACBEDFGLKJIHijklmnopqrstu      !"#$%&'()*+,-./01234567:98;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnpoqrstuvwyxz{|}~     5678%E(c) 2014 Chris Allen, Edward Kmett (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe,./;HUVX_k~ relude,Helper type family to produce error messages9relude9 is Y with a f that is a B.<relude Transform a 9 into an Y.$validationToEither (Success "whoop") Right "whoop"#validationToEither (Failure "nahh") Left "nahh"=relude Transform an Y into a 9."eitherToValidation (Right "whoop")Success "whoop" eitherToValidation (Left "nahh")Failure "nahh"CreludeHThis instance implements the following behavior for the binary operator: Both :: combine values inside : using ". At least is ;: return the left ; (the earliest ;). is : #.Examples2success1 = Success [42] :: Validation [Text] [Int]2success2 = Success [69] :: Validation [Text] [Int]7failure1 = Failure ["WRONG"] :: Validation [Text] [Int]7failure2 = Failure ["FAIL"] :: Validation [Text] [Int]success1 <|> success2 Success [42]failure1 <|> failure2Failure ["WRONG","FAIL"]failure2 <|> success2 Success [69]Drelude5This instance is the most important instance for the 9 data type. It's responsible for the many implementations. And it allows to accumulate errors while performing validation or combining the results in the applicative style.Examples.success1 = Success 42 :: Validation [Text] Int.success2 = Success 69 :: Validation [Text] Int:successF = Success (* 2) :: Validation [Text] (Int -> Int)5failure1 = Failure ["WRONG"] :: Validation [Text] Int5failure2 = Failure ["FAIL"] :: Validation [Text] IntsuccessF <*> success1 Success 84successF <*> failure1Failure ["WRONG"](+) <$> success1 <*> success2 Success 111(+) <$> failure1 <*> failure2Failure ["WRONG","FAIL"]liftA2 (+) success1 failure1Failure ["WRONG"]&liftA3 (,,) failure1 success1 failure2Failure ["WRONG","FAIL"]lImplementations of all functions are lazy and they correctly work if some arguments are not fully evaluated.:{#isFailure :: Validation e a -> BoolisFailure (Failure _) = TrueisFailure (Success _) = False:}failure1 *> failure2Failure ["WRONG","FAIL"] isFailure $ failure1 *> failure2TrueAepicFail = error "Impossible validation" :: Validation [Text] Int isFailure $ failure1 *> epicFailTrueErelude# is ; #.Frelude*This instances covers the following cases: Both ;: combine values inside ; with ".Both :: combine values inside : with ".One ;, one : : return :.Examples2success1 = Success [42] :: Validation [Text] [Int]2success2 = Success [69] :: Validation [Text] [Int]7failure1 = Failure ["WRONG"] :: Validation [Text] [Int]7failure2 = Failure ["FAIL"] :: Validation [Text] [Int]success1 <> success2Success [42,69]failure1 <> failure2Failure ["WRONG","FAIL"]success1 <> failure1Failure ["WRONG"]Hrelude&CAUTION2& This instance is for custom error display only.&It's not possible to implement lawful 0 instance for 9.?In case it is used by mistake, the user will see the following:GSuccess 42 >>= \n -> if even n then Success n else Failure ["Not even"]...:... Type 'Validation' doesn't have lawful 'Monad' instanceG which means that you can't use 'Monad' methods with 'Validation'....9;:<=9;:<=&(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe-./HUVXk3sLrelude*Check that a type is an element of a list::kind! Elem String '[]Elem String '[] :: Bool= 'False!:kind! Elem String '[Int, String]"Elem String '[Int, String] :: Bool= 'True:kind! Elem String '[Int, Bool] Elem String '[Int, Bool] :: Bool= 'FalseMrelude0Returns second element of tuple type (with kind *!) or type-level tuple (with kind (k1, k2), marked by prefix quote).:kind! Maybe (Snd '(Int, Text))Maybe (Snd '(Int, Text)) :: * = Maybe Text:kind! Maybe (Snd (Int, Text))Maybe (Snd (Int, Text)) :: * = Maybe TextNrelude/Returns first element of tuple type (with kind *!) or type-level tuple (with kind (k1, k2), marked by prefix quote).:kind! Maybe (Fst '(Int, Text))Maybe (Fst '(Int, Text)) :: * = Maybe Int:kind! Maybe (Fst (Int, Text))Maybe (Fst (Int, Text)) :: * = Maybe IntOreludeBuilds combined [G by applying Constraint constructor to all elements of type-level list.(:kind! AllHave Show '[Int, Text, Double]/AllHave Show '[Int, Text, Double] :: Constraint:= (Show Int, (Show Text, (Show Double, () :: Constraint)))which is equivalent to: 1(Show Int, Show Text, Show Double) :: Constraint PreludeConcatenates type-level lists.>:kind! '[ 'Just 5, 'Nothing] ++ '[ 'Just 3, 'Nothing, 'Just 1]A'[ 'Just 5, 'Nothing] ++ '[ 'Just 3, 'Nothing, 'Just 1] :: [MaybeB Nat]3= '[ 'Just 5, 'Nothing, 'Just 3, 'Nothing, 'Just 1],:kind! '[] ++ '[ 'Just 3, 'Nothing, 'Just 1]4'[] ++ '[ 'Just 3, 'Nothing, 'Just 1] :: [Maybe Nat] = '[ 'Just 3, 'Nothing, 'Just 1]Qrelude'Gets a string representation of a type.NOTE: This must be used with TypeApplications language extension. typeName @()"()" typeName @Int"Int"typeName @String"[Char]"typeName @(Maybe Int) "Maybe Int"LMNOPQQPOLNMP5'(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/PXkR Rrelude1Creates a tuple by pairing something with itself. dup "foo" ("foo","foo")dup ()((),())SreludeNApply a function, with the result in the fst slot, and the value in the other. A dual to T.toFst length [3, 1, 0, 2] (4,[3,1,0,2]) toFst (+5) 10(15,10)TreludeNApply a function, with the result in the snd slot, and the value in the other. A dual to S.toSnd length [3, 1, 0, 2] ([3,1,0,2],4) toSnd (+5) 10(10,15)UreludeLike 7, but also keep the original value in the snd position. A dual to V.fmapToFst show [3, 10, 2][("3",3),("10",10),("2",2)]VreludeLike 7, but also keep the original value in the fst position. A dual to U.fmapToSnd show [3, 10, 2][(3,"3"),(10,"10"),(2,"2")]WreludeNApply a function, with the result in the fst slot, and the value in the other. A dual to XmapToFst (+1) 10(11,10)XreludeQApply a function, with the result in the second slot, and the value in the other. A dual to W.mapToSnd (+1) 10(10,11)YreludeApply a function that returns a value inside of a functor, with the output in the first slot, the input in the second, and the entire tuple inside the functor. A dual to ZtraverseToFst (Just . (+1)) 10 Just (11,10) traverseToFst (const Nothing) 10NothingZreludeApply a function that returns a value inside of a functor, with the output in the second slot, the input in the first, and the entire tuple inside the functor. A dual to Y.traverseToSnd (Just . (+1)) 10 Just (10,11) traverseToSnd (const Nothing) 10Nothing[reludeMaps a function that returns a value inside of an applicative functor over both elements of a tuple, with the entire tuple inside the applicative functor.4traverseBoth (Just . ("Hello " <>)) ("Alice", "Bob") Just ("Hello Alice","Hello Bob")-traverseBoth (const Nothing) ("Alice", "Bob")Nothing RSTUVWXYZ[ RSTUVWXYZ[((c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/XkfL\reludeUnwraps value from newtype.%newtype Size = Size Int deriving Showun @Int (Size 5)5%un (Size 5) == length ['a', 'x', 'b']False]reludeWraps value to newtype. Behaves exactly as \H but has more meaningful name in case you need to convert some value to newtype.,newtype Flag = Flag Bool deriving (Show, Eq)wrap False == Flag TrueFalse^relude#Applies function to the content of newtype.. This function is not supposed to be used on newtype7s that are created with the help of smart constructors.$newtype Foo = Foo Bool deriving Showunder not (Foo True) Foo False&newtype Bar = Bar String deriving Show'under (filter (== 'a')) (Bar "abacaba") Bar "aaaa"_reludeLift binary function for newtypes to work over underlying newtype representation.#under2 @(Sum Int) (<>) (3 :: Int) 47under2 @All (<>) True FalseFalse`relude Version of _ that works on newtypeAs parametrized by their representation. Provided for convenience.underF2 @Sum (<>) (3 :: Int) 47underF2 @Max (<>) 'p' 't''t'areluderCoercible composition. This function allows to write more efficient implementations of function compositions over newtypes.\]^_`a\]^_`a)=(c) 2013-2016 Edward Kmett (c) 2019-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/SXksbreludegThe monomorphic lenses which don't change the type of the container (or of the value inside). It has a 1 constraint, and since both  and F are functors, it can be used whenever a getter or a setter is needed.a- is the type of the value inside of structures# is the type of the whole structurecreludeCreates b from the getter and setter.drelude/Gets a value out of a structure using a getter.erelude5Sets the given value to the structure using a setter.frelude)Applies the given function to the target.greludeThe operator form of d with the arguments flipped.hreludeThe operator form of e.ireludeThe operator form of f.bcdefghibcdefghig8h4i4*(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe /HVXkzjrelude<Groups elements using results of the given function as keys.2groupBy even [1..6] :: HashMap Bool (NonEmpty Int)/fromList [(False,5 :| [3,1]),(True,6 :| [4,2])]krelude Similar to j% but keeps only one element as value.,groupOneBy even [1 .. 6] :: HashMap Bool IntfromList [(False,1),(True,2)]jkjk+=(c) 2011-2015 Edward Kmett (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe ./HUVXkrelude)For tracking usage of ordinary list with l functions.lrelude;The class of foldable data structures that cannot be empty.mreludeTMap each element of the non-empty structure to a semigroup, and combine the results. foldMap1 SG.Sum (1 :| [2, 3, 4])Sum {getSum = 10}$foldMap1 show (123 :| [456, 789, 0]) "1234567890"nrelude@Combine the elements of a non-empty structure using a semigroup.$fold1 (1 :| [2, 3, 4 :: SG.Sum Int])Sum {getSum = 10}&fold1 (4 :| [5, 10 :: SG.Product Int])Product {getProduct = 200}orelude6Convert a non-empty data structure to a NonEmpty list.toNonEmpty (Identity 2)2 :| []prelude0The first element of a non-empty data structure.head1 (1 :| [2, 3, 4])1qrelude/The last element of a non-empty data structure.last1 (1 :| [2, 3, 4])4rrelude2The largest element of a non-empty data structure.!maximum1 (32 :| [64, 8, 128, 16])128srelude3The smallest element of a non-empty data structure.!minimum1 (32 :| [64, 8, 128, 16])8trelude7Strictly folds non-empty structure with given function f: 0foldl1' f [x0, x1, x2 ...] = f (f x0 x1) x2 ... &foldl1' (++) ([1,2] :| [[3,4], [5,6]]) [1,2,3,4,5,6]ureludevreludewreludexreludeyreludezrelude{relude&CAUTION2& This instance is for custom error display only.l+ is not supposed to be used with the lists.?In case it is used by mistake, the user will see the following:head1 [1, 2, 3] ...M... The methods of the 'Foldable1' type class work with non-empty containers.G However, one of the 'Foldable1' functions is applied to the List.... Possible fixes: * Replace []b with one of the: 'NonEmpty', 'Identity', '(c,)', 'Compose f g', 'Product f g', 'Sum f g'4 * Or use 'Foldable' class for your own risk.... lrsqnmopt lrsqnmopt,(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/Xk|reludeWA left-associative fold that's tail-recursive but can still short-circuit. Returning a fF short-circuits and immediately returns the value inside. Returning a g3 continues the fold as usual with the value inside.HfoldlSC (\acc x -> if x == 0 then Left 0 else Right $! acc * x) 1 [1..6]720~foldlSC (\acc x -> if x == 0 then Left 0 else Right $! acc * x) 1 (0:error "Short-circuiting should keep this from happening")0||-(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/Xkʶ}reludeReturns all values of some * + in ascending order.universe :: [Bool] [False,True]universe @Ordering [LT,EQ,GT]Edata TrafficLight = Red | Blue | Green deriving (Show, Enum, Bounded)universe :: [TrafficLight][Red,Blue,Green]9data Singleton = Singleton deriving (Show, Enum, Bounded)universe @Singleton [Singleton]~reludeLike }, but returns  list of some enumeration!universeNonEmpty :: NonEmpty BoolFalse :| [True]universeNonEmpty @Ordering LT :| [EQ,GT]Idata TrafficLight = Red | Blue | Green deriving (Show, Eq, Enum, Bounded))universeNonEmpty :: NonEmpty TrafficLightRed :| [Blue,Green]=data Singleton = Singleton deriving (Show, Eq, Enum, Bounded)universeNonEmpty @SingletonSingleton :| []relude inverseMap f< creates a function that is the inverse of a given function f. It does so by constructing  internally for each value f a). The implementation makes sure that the 9 is constructed only once and then shared for every call.Memory usage note:. don't inverse functions that have types like H+ as their result. In this case the created  will have huge size.&The complexity of reversed mapping is \mathcal{O}(\log n).Performance note:E make sure to specialize monomorphic type of your functions that use  to avoid  reconstruction.One of the common  use-case is inverting the ~ or a ~-like function.>data Color = Red | Green | Blue deriving (Show, Enum, Bounded)0parse = inverseMap show :: String -> Maybe Color parse "Red"Just Red parse "Black"NothingCorrectness note:  expects injective functionS as its argument, i.e. the function must map distinct arguments to distinct values./Typical usage of this function looks like this: dataM GhcVer = Ghc802 | Ghc822 | Ghc844 | Ghc865 | Ghc881 deriving (,, 3, 8, +, *) showGhcVer :: GhcVer -> 0 showGhcVer = \case Ghc802 -> "8.0.2" Ghc822 -> "8.2.2" Ghc844 -> "8.4.4" Ghc865 -> "8.6.5" Ghc881 -> "8.8.1" parseGhcVer :: 0 -> O GhcVer parseGhcVer =  showGhcVer reludeLike , but doesn't fail on . Instead it returns . next FalseTrue next TrueFalse succ True3*** Exception: Prelude.Enum.Bool.succ: bad argumentreludeLike , but doesn't fail on . Instead it returns . prev FalseTrue prev TrueFalse pred False3*** Exception: Prelude.Enum.Bool.pred: bad argumentreludeReturns c if given H outside range.safeToEnum @Bool 0 Just FalsesafeToEnum @Bool 1 Just TruesafeToEnum @Bool 2NothingsafeToEnum @Bool (-1)Nothing}~}~.(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/Xk$reludedThis function returns the name of its caller function, but it requires that the caller function has # constraint. Otherwise, it returns " unknown".,foo :: HasCallStack => String; foo = ownNamefoo"foo"(bar :: HasCallStack => String; bar = foobar"foo"reludeThis function returns the name of its caller of the caller function, but it requires that the caller function and caller of the caller function have # constraint. Otherwise, it returns " unknown". It's useful for logging:Qlog :: HasCallStack => String -> IO (); log s = putStrLn $ callerName ++ ":" ++ sggreeting :: HasCallStack => IO (); greeting = log "Starting..." >> putStrLn "Hello!" >> log "Ending..."greetinggreeting:Starting...Hello!greeting:Ending.../(c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/Xkrelude2Maps a function over both elements of a bifunctor.(bimapBoth length ([True], [False, True])(1,2),map (bimapBoth not) [Left True, Right False][Left False,Right True]relude0Fmaps functions for nested bifunctor. Short for fmap (bimap f g).,bimapF not length $ Just (False, ['a', 'b']) Just (True,2)relude Short for  fmap . first.%firstF not $ Just (False, ['a', 'b'])Just (True,"ab")relude Short for  fmap . second.*secondF length $ Just (False, ['a', 'b'])Just (False,2)X(c) 2019-2020 KowainikMITKowainik <xrom.xkov@gmail.com> ExperimentalPortableSafe/XkvN !"$#%!"&'()*+9;:<=LMNOPQRSTUVWXYZ[\]^_`abcdefghijklrsqnmopt|}~\(c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2020 KowainikMITKowainik <xrom.xkov@gmail.com>StablePortableUnsafe/Xk}relude Similar to W but with flipped arguments. get element from list using index value starting from `0`.at 2 ["a", "b", "c"]"c"Ait is also useful when used in a partially applied position like:8map (at 1) [["a","b","c"], ["a","b","c"], ["a","b","c"]] ["b","b","b"]66YZ[\]^Y_`Y_aYbcYbdYZeYZfYZg\]hYijYikYlmYnoYnpYnqYnr\st\suYivYZwYZxYZyYZzY{|Y}~YlYlYlYlYYYYYZYZYZYZYZYZYZQYZYnYn\sYYlYlYZYZYi\sYYlYYlYYY{Y}YZYYYYYYZYZ\\\\\YYYYYY\YlYl\\YYYYY\\\Y\Y\\\Y=Y\YY\\\YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYY Y Y Y  Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y  Y !Y "Y#$Y#%Y#&Y#'Y()Y*+Y*,Y-.Y-/Y0Y1Y2Y3Y4Y5Y6Y7Y8Y9Y:Y;Y<Y=Y>Y?Y@YAYBYCYDEYDFYDGYDGYHIYJKYJLYJLYMNYOPYOQYRSYRTYUVYUWYUXYUYYUZYU[YU\YO]Y^_Y`aYbcYbdYefYegYehYeiYejYklYkmYkmYnYoYpYqYrYsYtYuYvYwYxYyY:YzY{YOY|Y}Y~YYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYYlYlYlYlYlYlYlYlYlYlYlYlYlYlYlYlYlYlYlYlYlYnYnYnYnYnYnYnYn Y  Y_ Y_ Y_Y_Y_SY_Y_Y_Y_Y_Y_Y_Y_Y_Y_Y_Y_Y_Y_Y_Y_Y_ Y_!Y_"Y_#Y;<Y;$Y;%Y;&Y;'Y;(Y;)Y;*Y;+Y,-Y.0Y./Y.0Y12Y13Y14Y15Yb6Yb7Yb8Y9:Yi;Yi<Yi=Yi>Yi?Y@AYZBYZCYZDYZEYZFYZ2YZGYZHYZIYZJYZKYZLYZMYZNYZOYZPYZQYZRYZSYZTYZUYZVYZWYZXYZYYZZYZ[YZ\YZ]Y^Y_Y`Yef\sa\sb\sc\sd\se\sf\sg\sh\si\sjklmklnko@klpqrsqtuqvwqxyqz{|}~|}|}|}|}C  5678            D !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKKGHIJLKMNOPQRSTUVWXYZ[\]^_`abcd e f g #   !hhijklmnopqrstuvwxy z { | } ~            !""""""""""""#########N#################$U$V$$%%%%%%%%%%%%%%%%%%%&&&&&[&''''''''''(((((())))))))**++++++++++++++++,------ . . / / //Y^Y^Y^YYYY^Y CYk@kkkAkYM<YM=YM><=><=>k<k=k>kA<kA=kA>YN Y`klOkAOkOY9Y9Y9Y9YY9Y9Y9Y9YUYUYU" YYYYYMYM%!+"#relude-0.7.0.0-inplaceRelude.List.Reexport Relude.BaseRelude.Container.ReexportRelude.Bool.ReexportRelude.FunctionRelude.NumericRelude.Monad.ReexportRelude.Functor.ReexportRelude.String.Reexport Relude.MonoidRelude.ApplicativeRelude.Foldable.ReexportRelude.List.NonEmptyRelude.Lifted.ConcurrentRelude.Lifted.IORefRelude.Exception Relude.UnsafeRelude.Monad.EitherRelude.Functor.FmapRelude.DeepSeqRelude.Lifted.ExitRelude.Monad.MaybeRelude.Monad.Trans Relude.NubRelude.String.Conversion Relude.PrintRelude.Lifted.File Relude.File Relude.Debug Relude.MonadRelude.Bool.GuardRelude.Container.One Relude.ListRelude.Foldable.FoldRelude.Extra.MapRelude.Lifted.TerminalRelude.Extra.ValidationRelude.Extra.TypeRelude.Extra.TupleRelude.Extra.NewtypeRelude.Extra.LensRelude.Extra.GroupRelude.Extra.Foldable1Relude.Extra.FoldableRelude.Extra.EnumRelude.Extra.CallStackRelude.Extra.Bifunctor&PreludeidRelude.Functor System.ExitexitWith exitFailure exitSuccessdieReludefor_ Data.MaybemapMaybeNothingnubB ByteStringData.ByteString.LazyData.Text.LazyTextshow Relude.String Debug.Tracetrace traceShow traceShowIdtraceMtraceId Relude.Bool Data.IntSetsizelength Data.TextpureRelude.Container!!Relude.FoldablegetLineprint Relude.Lifted Relude.ExtrabaseGHC.Base++ghc-primGHC.PrimseqGHC.Listfilterzip Data.Tuplefstsnd otherwisemap$coerceGHC.Num fromInteger-GHC.Real fromRationalGHC.EnumenumFrom enumFromThen enumFromToenumFromThenTo GHC.Classes==>=negate>>=>>fmapreturnControl.Monad.Failfail Data.String fromString fromIntegral realToFrac toInteger toRational Control.MonadguardGHC.ExtsIsListfromList fromListN<>memptymappendmconcatjoin<*>*>BoundedEnumEq GHC.FloatFloating FractionalIntegralMonadFunctorNumOrdGHC.ReadReadReal RealFloatRealFracGHC.ShowShowData.Typeable.InternalTypeable MonadFailIsString Applicative Data.FoldableFoldableData.Traversable Traversable GHC.GenericsGeneric GHC.TypeNatsKnownNatGHC.OverloadedLabelsIsLabel SemigroupMonoid GHC.TypesBoolCharDoubleFloatIntGHC.IntInt8Int16Int32Int64integer-wired-inGHC.Integer.TypeInteger GHC.NaturalNatural GHC.MaybeMaybeOrderingRatioRationalIOWordGHC.WordWord8Word16Word32Word64 Data.EitherEitherType ConstraintNatCmpNat CoercibleGHC.Stack.Types CallStackD#FalseF#JustTrueLeftRightLTEQGTGHC.IO.Handle.TypesHandleData.Functor.ContravariantcomparisonEquivalencedefaultEquivalencedefaultComparison>$$<>$<$<phantom>$ contramap Contravariant getPredicate Predicate getComparison ComparisongetEquivalence EquivalencegetOpOpData.Functor.Compose getComposeCompose Data.VoidvacuousabsurdVoidData.Semigroup mtimesDefaultcycle1 WrappedMonoid getOptionOptionsortWithData.BitraversablebifoldMapDefault bimapDefaultbifor bisequence bitraverse BitraversableData.BifoldablebifindbiallbianybiorbiandbielembilengthbinullbiListbiasum bisequence_bifor_ bitraverse_bifoldlMbifoldl'bifoldrMbifoldr'bifoldlbifoldr bifoldMapbifold BifoldableData.Bifunctorsecondfirstbimap BifunctorData.List.NonEmptynonEmptyGHC.ExecutionStackshowStackTrace getStackTraceControl.Monad.IO.ClassliftIOMonadIO fromLabelmfilter<$!>unless replicateM_ replicateM zipWithM_zipWithM mapAndUnzipMforever<=<>=>filterM mapAccumR mapAccumLforMsequencemapM sequenceAtraverseControl.Applicativeoptional getZipListZipList Control.Arrow&&&Data.Functor.Identity runIdentityIdentity System.IOwithFileGHC.IO.Handle.FDstderrstdin GHC.StackwithFrozenCallStack callStack GHC.Conc.Sync writeTVarreadTVarnewTVarcatchSTMthrowSTMSTMTVarstdout GHC.IORefIORefGHC.IOFilePath GHC.ExceptionprettyCallStack prettySrcLocGHC.Exception.Type SomeExceptiondisplayException fromException toException ExceptionData.Functor.ConstgetConstConstfindallanyorand concatMapconcatasum sequence_ sequenceA_forM_mapM_ traverse_foldlMnulltoListfoldl'foldrfoldMap'foldMapfold Data.MonoidgetFirstFirstgetLastLastgetApApData.Semigroup.Internal stimesMonoidstimesIdempotentgetDualDualappEndoEndogetAllAllgetAnyAnygetSumSum getProductProductgetAltAlt someNatValnatValSomeNat Data.OldListunfoldrsortOnsortBysort permutations subsequencestailsinitsgroupgenericReplicategenericSplitAt genericDrop genericTake genericLength transpose intercalate intersperse isPrefixOf Text.Readread readMaybereads fromRightfromLeftisRightisLeftpartitionEithersrightsleftseitherData.Ord comparingDown Data.ProxyProxyControl.Category>>><<< GHC.IO.IOMode ReadWriteMode AppendMode WriteModeReadModeIOModeatanhacoshasinhtanhcoshsinhatanacosasintancossinlogBase**sqrtexppiatan2isIEEEisNegativeZeroisDenormalized isInfiniteisNaN encodeFloat decodeFloat floatRange floatDigits floatRadix byteSwap64 byteSwap32 byteSwap16 Data.BitstoIntegralSizedxorlcmgcd^^^oddeven denominator numeratordivModquotRemmoddivremquotrecip/floorceilingroundtruncateproperFractionboundedEnumFromThenboundedEnumFrommaxBoundminBoundfromEnumtoEnumpredsuccGHC.Charchrunzip3unzipzipWithzip3reversebreaksplitAtdroptake dropWhile takeWhile replicaterepeatiteratescanr1scanrscanl'scanl1scanlinitlasttailunconshead catMaybes listToMaybe maybeToList fromMaybefromJust isNothingisJustmaybe Data.Boolbool Data.Functiononfix Data.Functorvoid$><&><$>swapuncurrycurryGHC.MVarMVarsubtractsignumabs*+ GHC.Stack.CCScurrentCallStackasTypeOf$!flip.constmaxIntminIntordwhen=<<liftA3<**>stimessconcat<$<*liftA2manysome<|>empty Alternativemplusmzero MonadPlus:|NonEmptyString getCallStack HasCallStackstimesIdempotentMonoidcompare<<=>maxmin/=&&||notbytestring-0.10.10.0Data.ByteString.Short.Internal fromShortShortByteStringData.ByteString.InternaltoShortcontainers-0.6.2.1Data.IntMap.InternalIntMapData.IntSet.InternalIntSetData.Map.InternalMapData.Sequence.InternalSeqData.Set.InternalSetdeepseq-1.4.4.0Control.DeepSeqforce$!!deepseqrnfNFDatahshbl-1.3.0.0-e070d8d2Data.Hashable.Class hashWithSaltHashabletransformers-0.5.6.2Control.Monad.Trans.Classlift MonadTransControl.Monad.Trans.Identity runIdentityT IdentityT mtl-2.2.2Control.Monad.State.Classgetsmodify'modifystateputget MonadStateControl.Monad.Reader.Classasksreaderlocalask MonadReaderControl.Monad.Trans.ExceptExceptT runExceptTControl.Monad.Trans.ReaderReaderT runReaderTReader runReader withReader withReaderT Control.Monad.Trans.State.StrictStateT runStateTStaterunState evalState execState withState evalStateT execStateTnrdrd-cntnrs-0.2.10.0-fcbd0979Data.HashSet.BaseHashSetData.HashMap.BaseHashMap stm-2.5.0.0Control.Concurrent.STM.TVar modifyTVar'Control.Concurrent.STM.TMVar mkWeakTMVar isEmptyTMVar swapTMVar tryReadTMVar readTMVar tryPutTMVarputTMVar tryTakeTMVar takeTMVar newEmptyTMVarnewTMVarTMVar text-1.2.4.0Data.Text.Encoding decodeUtf8'decodeUtf8WithData.Text.InternalData.Text.Encoding.Error lenientDecode strictDecodeOnError OnDecodeErrorUnicodeExceptionControl.Monad.Trans.MaybeexceptToMaybeTmaybeToExceptT runMaybeTMaybeTpass appliedToidentity<<$>>flap??newIORef readIORef writeIORef modifyIORef modifyIORef'atomicModifyIORefatomicModifyIORef'atomicModifyIORef_atomicModifyIORef'_atomicWriteIORefcycle?:whenJust whenJustM whenNothing whenNothing_ whenNothingM whenNothingM_ mapMaybeM usingReaderT usingReader etaReaderT usingStateT usingStateevaluatingStateTevaluatingStateexecutingStateTexecutingState hoistMaybe hoistEither maybeToMonoid memptyIfFalse memptyIfTrueordNubhashNubsortNub unstableNublinesunlineswordsunwords LazyStricttoLazytoStrictToStringtoStringToLTexttoLTextToTexttoText ConvertUtf8 encodeUtf8 decodeUtf8decodeUtf8Strict LByteStringLText readEitherfromLazy fromStrict $fConvertUtf8TextShortByteString!$fConvertUtf8TextShortByteString0$fConvertUtf8[]ShortByteString$fConvertUtf8TextByteString$fConvertUtf8TextByteString0$fConvertUtf8[]ByteString$fConvertUtf8TextByteString1$fConvertUtf8TextByteString2$fConvertUtf8[]ByteString0 $fToTextText $fToTextText0 $fToText[] $fToLTextText$fToLTextText0 $fToLText[]$fToStringText$fToStringText0 $fToString[]$fToStringShortByteString$fToStringByteString$fToStringByteString0$fToLTextShortByteString$fToLTextByteString$fToLTextByteString0$fToTextShortByteString$fToTextByteString$fToTextByteString0$fLazyStrictTextText $fLazyStrictByteStringByteStringputText putTextLnputLText putLTextLnputBSputBSLnputLBSputLBSLnreadFile writeFile appendFile readFileText writeFileTextappendFileText readFileLTextwriteFileLTextappendFileLText readFileBS writeFileBS appendFileBS readFileLBS writeFileLBS appendFileLBS Undefined traceShowMerror undefined $fEqUndefined$fOrdUndefined$fShowUndefined$fReadUndefined$fEnumUndefined$fBoundedUndefined$fDataUndefined$fGenericUndefined leftToMaybe rightToMaybe maybeToRight maybeToLeftwhenLeft whenLeft_ whenLeftM whenLeftM_ whenRight whenRight_ whenRightM whenRightM_$fMonadFailEither chainedTo viaNonEmpty whenNotNull whenNotNullMBugExcbug$fExceptionBug $fShowBug evaluateWHNF evaluateWHNF_ evaluateNF evaluateNF_whenMunlessMifMguardMguarded&&^||^integerToBoundedintegerToNaturalOneOneItemone $fOneIntSet $fOneHashSet$fOneSet $fOneIntMap $fOneHashMap$fOneMap$fOneShortByteString$fOneByteString$fOneByteString0 $fOneText $fOneText0$fOneSeq $fOneNonEmpty$fOne[]!!? newEmptyMVarnewMVarputMVarreadMVarswapMVartakeMVar tryPutMVar tryReadMVar tryTakeMVar atomically newTVarIO readTVarIO newTMVarIOnewEmptyTMVarIO flipfoldl'asumMapfoldMapAfoldMapMsumproductelemnotElemandMorMallManyM DynamicMapinsert insertWithdeletealter StaticMapKeyVallookupmember!? notMember lookupDefaulttoPairskeyselems$fStaticMapIntSet$fStaticMapHashSet$fStaticMapSet$fStaticMapIntMap$fStaticMapHashMap$fStaticMapMap$fDynamicMapIntMap$fDynamicMapHashMap$fDynamicMapMapputStrputStrLn ValidationFailureSuccessvalidationToEithereitherToValidation$fBitraversableValidation$fBifoldableValidation$fBifunctorValidation$fTraversableValidation$fFoldableValidation$fAlternativeValidation$fApplicativeValidation$fMonoidValidation$fSemigroupValidation$fFunctorValidation$fMonadValidation$fEqValidation$fOrdValidation$fShowValidationElemSndFstAllHavetypeNameduptoFsttoSnd fmapToFst fmapToSndmapToFstmapToSnd traverseToFst traverseToSnd traverseBothunwrapunderunder2underF2#.Lens'lensviewsetover^..~%~groupBy groupOneBy Foldable1foldMap1fold1 toNonEmptyhead1last1maximum1minimum1foldl1'$fFoldable1Sum$fFoldable1Product$fFoldable1Compose$fFoldable1(,)$fFoldable1Identity$fFoldable1NonEmpty $fFoldable1[]foldlSCuniverseuniverseNonEmpty inverseMapnextprev safeToEnumownName callerName bimapBothbimapFfirstFsecondFat Data.IORefIsText EncodingErrorData.Text.Internal.LazyData.ByteString.Lazy.Internal Data.Text.IOData.Text.Lazy.IOData.ByteStringData.ByteString.Char8Data.ByteString.Lazy.Char8GHC.Err IsNonEmpty impureThrowevaluateControl.Concurrent.MVar DisallowElemNoValidationMonadError IsListError