Hoogle Search

Within LTS Haskell 24.33 (ghc-9.10.3)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. readGS :: (MonadLBState m, LBState m ~ GlobalPrivate g p) => m g

    lambdabot-core Lambdabot.State

    Reads global state.

  2. readGlobalState :: Module st -> String -> LB (Maybe st)

    lambdabot-core Lambdabot.State

    Read it in

  3. readMS :: MonadLBState m => m (LBState m)

    lambdabot-core Lambdabot.State

    Read the module's private state.

  4. readPS :: (MonadLBState m, LBState m ~ GlobalPrivate g p) => Nick -> m (Maybe p)

    lambdabot-core Lambdabot.State

    Reads private state.

  5. readWithImports :: FilePath -> FilePath -> IO (Either Text Protocol)

    language-avro Language.Avro.Parser

    Reads and parses a whole file and its imports, recursively.

  6. readonly_ :: Text -> Attributes

    lucid2 Lucid.Html5

    The readonly attribute.

  7. readArray :: (Readable f arr, MonadIO m) => f -> FilePath -> m arr

    massiv-io Data.Massiv.Array.IO

    Read an array from one of the supported Readable file formats. For example readImage assumes all images to be in sRGB color space, but if you know that the image is actually encoded in some other color space, for example AdobeRGB, then you can read it in manually into a matching color model and then cast into a color space you know it is encoded in:

    >>> :set -XDataKinds
    
    >>> import qualified Graphics.ColorModel as CM
    
    >>> frogRGB <- readArray JPG "files/_frog.jpg" :: IO (Image S CM.RGB Word8)
    
    >>> let frogAdobeRGB = (fromImageBaseModel frogRGB :: Image S (AdobeRGB 'NonLinear) Word8)
    

  8. readArrayWithMetadata :: (Readable f arr, MonadIO m) => f -> FilePath -> m (arr, Metadata f)

    massiv-io Data.Massiv.Array.IO

    Read an array from one of the supported file formats. Some formats are capable of preducing format specific metadata.

  9. readImage :: (ColorModel cs e, MonadIO m) => FilePath -> m (Image S cs e)

    massiv-io Data.Massiv.Array.IO

    Tries to guess an image format from file's extension, then attempts to decode it as such. It also assumes an image is encoded in sRGB color space or its alternate representation. In order to supply the format manually or choose a different color space, eg. AdobeRGB, use readArray instead. Color space and precision of the result image must match exactly that of the actual image. May throw ConvertError, DecodeError and other standard errors related to file IO. Resulting image will be read as specified by the type signature:

    >>> :set -XDataKinds
    
    >>> frog <- readImage "files/frog.jpg" :: IO (Image S (Y'CbCr SRGB) Word8)
    
    >>> size frog
    Sz (200 :. 320)
    
    >>> displayImage frog
    
    In case when the result image type does not match the color space or precision of the actual image file, ConvertError will be thrown.
    >>> frog <- readImage "files/frog.jpg" :: IO (Image S (SRGB 'NonLinear) Word8)
    *** Exception: ConvertError "Cannot decode JPG image <Image S YCbCr Word8> as <Image S SRGB 'NonLinear Word8>"
    
    Whenever image is not in the color space or precision that we need, either use readImageAuto or manually convert to the desired one by using the appropriate conversion functions:
    >>> frogYCbCr <- readImage "files/frog.jpg" :: IO (Image S (Y'CbCr SRGB) Word8)
    
    >>> let frogSRGB = convertImage frogYCbCr :: Image D (SRGB 'NonLinear) Word8
    
    A simpler approach to achieve the same effect would be to use readImageAuto:
    >>> frogSRGB' <- readImageAuto "files/frog.jpg" :: IO (Image S (SRGB 'NonLinear) Word8)
    
    >>> compute frogSRGB == frogSRGB'
    True
    

  10. readImageAuto :: (Manifest r (Pixel cs e), ColorSpace cs i e, MonadIO m) => FilePath -> m (Image r cs e)

    massiv-io Data.Massiv.Array.IO

    Similar to readImage, but will perform all necessary color space conversion and precision adjustment in order to match the result image type. Very useful whenever image format isn't known ahead of time.

    >>> frogCMYK <- readImageAuto "files/frog.jpg" :: IO (Image S (CMYK (SRGB 'NonLinear)) Double)
    
    >>> size frogCMYK
    Sz (200 :. 320)
    

Page 317 of many | Previous | Next