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.

  1. Position :: Word -> Word -> Position

    text-rope Data.Text.Utf16.Rope

    No documentation available.

  2. data Position

    text-rope Data.Text.Utf8.Lines

    Represent a position in a text.

  3. Position :: Word -> Word -> Position

    text-rope Data.Text.Utf8.Lines

    No documentation available.

  4. data Position

    text-rope Data.Text.Utf8.Rope

    Represent a position in a text.

  5. Position :: Word -> Word -> Position

    text-rope Data.Text.Utf8.Rope

    No documentation available.

  6. module Data.Thyme.Clock.POSIX

    POSIX time

  7. type POSIXTime = NominalDiffTime

    thyme Data.Thyme.Clock.POSIX

    The nominal (ignoring leap seconds) time difference since midnight 1970-01-01, the Unix epoch. Equvialent to a normalised struct timeval.

  8. class ParseTime t

    thyme Data.Thyme.Format

    All instances of this class may be parsed by parseTime, readTime, and readsTime.

  9. class Parse a

    ttc Data.TTC

    Parse a data type from a textual data type Unlike Read, Parse allows you to specify meaningful error messages. When defining an instance, first convert the textual data type to the textual data type that is most natural for the data type. The as functions (such as asS) provide a convenient way to do this. Note that error is also a textual data type. The withError and prefixError functions can be used to reduce boilerplate. Example:

    newtype Username = Username { usernameText :: Text }
    
    instance TTC.Parse Username where
    parse = TTC.asT $ t -> TTC.prefixErrorS "invalid username: " $ do
    unless (T.all isAsciiLower t) $ Left "not only lowercase ASCII letters"
    let len = T.length t
    when (len < 3) $ Left "fewer than 3 characters"
    when (len > 12) $ Left "more than 12 characters"
    pure $ Username t
    
    To use parse in a context where the types are ambiguous, use the TypeApplications GHC extension to specify one or more types. Example:
    -- Parse from Text
    parse _ Text foo
    
    -- Parse using String errors
    parse _ _ String foo
    
    -- Parse from Text using String errors
    parse _ Text String foo
    
    Alternatively, use one of the functions that parse from a specific textual data type (such as renderS). Using these functions may make code easier to understand even in cases where the types are not ambiguous. See the uname and prompt example programs in the ttc-examples directory of the source repository. For more details, see the following article: https://www.extrema.is/articles/ttc-textual-type-classes/render-and-parse Since a type may have at most one instance of a given type class, special care must be taken when defining type class instances in a shared library. In particular, orphan instances should generally not be used in shared libraries since they prevent users of the libraries from writing their own instances. Use newtype wrappers instead. There are no default instances for the Parse type class, so that all instances can be customized per project when desired. Instances for some basic data types are defined for the ParseDefault type class, however, and the Template Haskell functions documented below can be used to load these definitions with minimal boilerplate.

  10. class ParseDefault a

    ttc Data.TTC

    The ParseDefault type class provides some default Parse instances.

    • The Bool instance parses using the Read instance. This instance was added in version 1.5.0.0.
    • The Char instance parses single-character strings.
    • Numeric type instances all parse using the Read instance.
    • Textual data type instances all convert from the source textual data type.

Page 744 of many | Previous | Next