mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-04-26 13:08:02 +00:00
14 lines
338 B
Haskell
14 lines
338 B
Haskell
module Simplex.Chat.Util where
|
|
|
|
import Data.ByteString.Char8 (ByteString)
|
|
import Data.Text (Text)
|
|
import Data.Text.Encoding (decodeUtf8With)
|
|
|
|
safeDecodeUtf8 :: ByteString -> Text
|
|
safeDecodeUtf8 = decodeUtf8With onError
|
|
where
|
|
onError _ _ = Just '?'
|
|
|
|
uncurry3 :: (a -> b -> c -> d) -> ((a, b, c) -> d)
|
|
uncurry3 f ~(a, b, c) = f a b c
|