Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
- module Base
- class Buildable p
- evaluateNF :: (NFData a, MonadIO m) => a -> m a
- evaluateNF_ :: (NFData a, MonadIO m) => a -> m ()
- evaluateWHNF :: MonadIO m => a -> m a
- evaluateWHNF_ :: MonadIO m => a -> m ()
- identity :: a -> a
- map :: Functor f => (a -> b) -> f a -> f b
- pretty :: Buildable a => a -> Text
- prettyL :: Buildable a => a -> LText
- print :: (MonadIO m, Show a) => a -> m ()
- readEither :: (ToString a, Read b) => a -> Either Text b
- show :: (Show a, IsString b) => a -> b
- uncons :: [a] -> Maybe (a, [a])
- unsnoc :: [x] -> Maybe ([x], x)
- type LText = Text
- type LByteString = ByteString
Reexports from base and from modules in this repo
module Base
Useful classes
The class of types that can be rendered to a Builder
.
Useful standard unclassifed functions
evaluateNF :: (NFData a, MonadIO m) => a -> m a Source #
Alias for evaluateWHNF . force
with clearer name.
evaluateNF_ :: (NFData a, MonadIO m) => a -> m () Source #
Alias for evaluateWHNF . rnf
. Similar to evaluateNF
but discards resulting value.
evaluateWHNF :: MonadIO m => a -> m a Source #
Lifted alias for evaluate
with clearer name.
evaluateWHNF_ :: MonadIO m => a -> m () Source #
Like evaluateWNHF
but discards value.
pretty :: Buildable a => a -> Text Source #
Functions to show pretty output for buildable data types.
readEither :: (ToString a, Read b) => a -> Either Text b Source #
Polymorhpic version of readEither
.
>>>
readEither @Text @Int "123"
Right 123>>>
readEither @Text @Int "aa"
Left "Prelude.read: no parse"
uncons :: [a] -> Maybe (a, [a]) Source #
Destructuring list into its head and tail if possible. This function is total.
>>>
uncons []
Nothing>>>
uncons [1..5]
Just (1,[2,3,4,5])>>>
uncons (5 : [1..5]) >>= \(f, l) -> pure $ f == length l
Just True
unsnoc :: [x] -> Maybe ([x], x) Source #
Similar to uncons
but destructuring list into its last element and
everything before it.
Convenient type aliases
type LByteString = ByteString Source #
Type synonym for ByteString
.