Hoogle Search
Within LTS Haskell 24.41 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
utf8MakeValid :: (HasCallStack, MonadIO m) => Text -> Int64 -> m Textgi-glib GI.GLib.Functions If the provided string is valid UTF-8, return a copy of it. If not, return a copy in which bytes that could not be interpreted as valid Unicode are replaced with the Unicode replacement character (U+FFFD). For example, this is an appropriate function to use if you have received a string that was incorrectly declared to be UTF-8, and you need a valid UTF-8 version of it that can be logged or displayed to the user, with the assumption that it is close enough to ASCII or UTF-8 to be mostly readable as-is. Since: 2.52
utf8TruncateMiddle :: (HasCallStack, MonadIO m) => Text -> CSize -> m Textgi-glib GI.GLib.Functions Cuts off the middle of the string, preserving half of truncateLength characters at the beginning and half at the end. If string is already short enough, this returns a copy of string. If truncateLength is 0, an empty string is returned. Since: 2.78
utf8Validate :: (HasCallStack, MonadIO m) => ByteString -> m (Bool, Text)gi-glib GI.GLib.Functions Validates UTF-8 encoded text. str is the text to validate; if str is nul-terminated, then maxLen can be -1, otherwise maxLen should be the number of bytes to validate. If end is non-Nothing, then the end of the valid range will be stored there (i.e. the start of the first invalid character if some bytes were invalid, or the end of the text being validated otherwise). Note that utf8Validate returns False if maxLen is positive and any of the maxLen bytes are nul. Returns True if all of str was valid. Many GLib and GTK routines require valid UTF-8 as input; so data read from a file or the network should be checked with utf8Validate before doing anything else with it.
utf8ValidateLen :: (HasCallStack, MonadIO m) => ByteString -> m (Bool, Text)gi-glib GI.GLib.Functions Validates UTF-8 encoded text. As with utf8Validate, but maxLen must be set, and hence this function will always return False if any of the bytes of str are nul. Since: 2.60
uuidStringIsValid :: (HasCallStack, MonadIO m) => Text -> m Boolgi-glib GI.GLib.Functions Parses the string str and verify if it is a UUID. The function accepts the following syntax:
- simple forms (e.g. f81d4fae-7dec-11d0-a765-00a0c91e6bf6)
uuidStringRandom :: (HasCallStack, MonadIO m) => m Textgi-glib GI.GLib.Functions Generates a random UUID (RFC 4122 version 4) as a string. It has the same randomness guarantees as Rand, so must not be used for cryptographic purposes such as key generation, nonces, salts or one-time pads. Since: 2.52
dateValid :: (HasCallStack, MonadIO m) => Date -> m Boolgi-glib GI.GLib.Structs.Date Returns True if the Date represents an existing day. The date must not contain garbage; it should have been initialized with dateClear if it wasn't allocated by one of the dateNew variants.
dateValidDay :: (HasCallStack, MonadIO m) => Word8 -> m Boolgi-glib GI.GLib.Structs.Date Returns True if the day of the month is valid (a day is valid if it's between 1 and 31 inclusive).
dateValidDmy :: (HasCallStack, MonadIO m) => Word8 -> DateMonth -> Word16 -> m Boolgi-glib GI.GLib.Structs.Date Returns True if the day-month-year triplet forms a valid, existing day in the range of days Date understands (Year 1 or later, no more than a few thousand years in the future).
dateValidJulian :: (HasCallStack, MonadIO m) => Word32 -> m Boolgi-glib GI.GLib.Structs.Date Returns True if the Julian day is valid. Anything greater than zero is basically a valid Julian, though there is a 32-bit limit.