2-- Module : Streamly.Internal.BaseCompat
4-- Maintainer : streamly@composewell.com
5-- Stability : experimental
8-- Compatibility functions for "base" package.
10module Streamly.Internal.BaseCompat
13 , errorWithoutStackTrace
16 , unsafeWithForeignPtr
21import Data.Coerce (Coercible, coerce)
22#if MIN_VERSION_base(4,10,0)
23import Data.Either (fromRight, fromLeft)
24import qualified GHC.Exts as GHCExt
26import GHC.ForeignPtr (ForeignPtr(..))
27import GHC.Ptr (Ptr(..))
28#if MIN_VERSION_base(4,15,0)
29import qualified GHC.ForeignPtr as GHCForeignPtr
31import Foreign.ForeignPtr (withForeignPtr)
35(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)
38#if !(MIN_VERSION_base(4,9,0))
39{-# NOINLINE errorWithoutStackTrace #-}
40errorWithoutStackTrace :: String -> a
41errorWithoutStackTrace = error
44#if !(MIN_VERSION_base(4,10,0))
45fromLeft :: a -> Either a b -> a
46fromLeft _ (Left a) = a
49fromRight :: b -> Either a b -> b
50fromRight _ (Right b) = b
54unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
55#if MIN_VERSION_base(4,15,0)
56unsafeWithForeignPtr = GHCForeignPtr.unsafeWithForeignPtr
58unsafeWithForeignPtr = withForeignPtr
61oneShot :: (a -> b) -> a -> b
62#if MIN_VERSION_base(4,10,0)
63oneShot = GHCExt.oneShot
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list