License | BSD3 |
---|---|
Maintainer | streamly@composewell.com |
Stability | experimental |
Portability | GHC |
Safe Haskell | None |
Language | Haskell2010 |
Compatibility functions for "base" package.
Synopsis
- (#.) :: Coercible b c => (b -> c) -> (a -> b) -> a -> c
- errorWithoutStackTrace :: forall (r :: RuntimeRep) (a :: TYPE r). [Char] -> a
- fromLeft :: a -> Either a b -> a
- fromRight :: b -> Either a b -> b
- unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b
- oneShot :: (a -> b) -> a -> b
Documentation
errorWithoutStackTrace :: forall (r :: RuntimeRep) (a :: TYPE r). [Char] -> a #
A variant of error
that does not produce a stack trace.
Since: base-4.9.0.0
fromLeft :: a -> Either a b -> a #
Return the contents of a Left
-value or a default value otherwise.
Examples
Basic usage:
>>>
fromLeft 1 (Left 3)
3>>>
fromLeft 1 (Right "foo")
1
Since: base-4.10.0.0
fromRight :: b -> Either a b -> b #
Return the contents of a Right
-value or a default value otherwise.
Examples
Basic usage:
>>>
fromRight 1 (Right 3)
3>>>
fromRight 1 (Left "foo")
1
Since: base-4.10.0.0
unsafeWithForeignPtr :: ForeignPtr a -> (Ptr a -> IO b) -> IO b Source #