Hoogle Search

Within LTS Haskell 24.50 (ghc-9.10.3)

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

  1. mallocForeignPtrBytes :: Int -> IO (ForeignPtr a)

    base GHC.ForeignPtr

    This function is similar to mallocForeignPtr, except that the size of the memory required is given explicitly as a number of bytes.

  2. mallocPlainForeignPtr :: Storable a => IO (ForeignPtr a)

    base GHC.ForeignPtr

    Allocate some memory and return a ForeignPtr to it. The memory will be released automatically when the ForeignPtr is discarded. GHC notes: mallocPlainForeignPtr has a heavily optimised implementation in GHC. It uses pinned memory in the garbage collected heap, as for mallocForeignPtr. Unlike mallocForeignPtr, a ForeignPtr created with mallocPlainForeignPtr carries no finalizers. It is not possible to add a finalizer to a ForeignPtr created with mallocPlainForeignPtr. This is useful for ForeignPtrs that will live only inside Haskell (such as those created for packed strings). Attempts to add a finalizer to a ForeignPtr created this way, or to finalize such a pointer, will throw an exception.

  3. mallocPlainForeignPtrAlignedBytes :: Int -> Int -> IO (ForeignPtr a)

    base GHC.ForeignPtr

    This function is similar to mallocForeignPtrAlignedBytes, except that the internally an optimised ForeignPtr representation with no finalizer is used. Attempts to add a finalizer will cause an exception to be thrown.

  4. mallocPlainForeignPtrBytes :: Int -> IO (ForeignPtr a)

    base GHC.ForeignPtr

    This function is similar to mallocForeignPtrBytes, except that the internally an optimised ForeignPtr representation with no finalizer is used. Attempts to add a finalizer will cause an exception to be thrown.

  5. flushAll :: IO ()

    base GHC.GHCi.Helpers

    No documentation available.

  6. newtype Generically a

    base GHC.Generics

    A datatype whose instances are defined generically, using the Generic representation. Generically1 is a higher-kinded version of Generically that uses Generic1. Generic instances can be derived via Generically A using -XDerivingVia.

    {-# LANGUAGE DeriveGeneric      #-}
    {-# LANGUAGE DerivingStrategies #-}
    {-# LANGUAGE DerivingVia        #-}
    
    import GHC.Generics (Generic)
    
    data V4 a = V4 a a a a
    deriving stock Generic
    
    deriving (Semigroup, Monoid)
    via Generically (V4 a)
    
    This corresponds to Semigroup and Monoid instances defined by pointwise lifting:
    instance Semigroup a => Semigroup (V4 a) where
    (<>) :: V4 a -> V4 a -> V4 a
    V4 a1 b1 c1 d1 <> V4 a2 b2 c2 d2 =
    V4 (a1 <> a2) (b1 <> b2) (c1 <> c2) (d1 <> d2)
    
    instance Monoid a => Monoid (V4 a) where
    mempty :: V4 a
    mempty = V4 mempty mempty mempty mempty
    
    Historically this required modifying the type class to include generic method definitions (-XDefaultSignatures) and deriving it with the anyclass strategy (-XDeriveAnyClass). Having a /via type/ like Generically decouples the instance from the type class.

  7. Generically :: a -> Generically a

    base GHC.Generics

    No documentation available.

  8. newtype Generically1 (f :: k -> Type) (a :: k)

    base GHC.Generics

    A type whose instances are defined generically, using the Generic1 representation. Generically1 is a higher-kinded version of Generically that uses Generic. Generic instances can be derived for type constructors via Generically1 F using -XDerivingVia.

    {-# LANGUAGE DeriveGeneric      #-}
    {-# LANGUAGE DerivingStrategies #-}
    {-# LANGUAGE DerivingVia        #-}
    
    import GHC.Generics (Generic)
    
    data V4 a = V4 a a a a
    deriving stock (Functor, Generic1)
    
    deriving Applicative
    via Generically1 V4
    
    This corresponds to Applicative instances defined by pointwise lifting:
    instance Applicative V4 where
    pure :: a -> V4 a
    pure a = V4 a a a a
    
    liftA2 :: (a -> b -> c) -> (V4 a -> V4 b -> V4 c)
    liftA2 (·) (V4 a1 b1 c1 d1) (V4 a2 b2 c2 d2) =
    V4 (a1 · a2) (b1 · b2) (c1 · c2) (d1 · d2)
    
    Historically this required modifying the type class to include generic method definitions (-XDefaultSignatures) and deriving it with the anyclass strategy (-XDeriveAnyClass). Having a /via type/ like Generically1 decouples the instance from the type class.

  9. finally :: IO a -> IO b -> IO a

    base GHC.IO

    No documentation available.

  10. hFlushAll :: Handle -> IO ()

    base GHC.IO.Handle

    The action hFlushAll hdl flushes all buffered data in hdl, including any buffered read data. Buffered read data is flushed by seeking the file position back to the point before the buffered data was read, and hence only works if hdl is seekable (see hIsSeekable). This operation may fail with:

    • isFullError if the device is full;
    • isPermissionError if a system resource limit would be exceeded. It is unspecified whether the characters in the buffer are discarded or retained under these circumstances;
    • isIllegalOperation if hdl has buffered read data, and is not seekable.

Page 188 of many | Previous | Next