Safe Haskell | None |
---|---|
Language | Haskell2010 |
A collection of small utility functions.
- type HasCallStack = ?callStack :: CallStack
- data UnknownType
- pretty :: Value -> Text
- myGroupBy :: Ord a => [(a, b)] -> Map a [b]
- myGroupBy' :: Ord b => (a -> b) -> [a] -> [(b, [a])]
- missing :: HasCallStack => Text -> a
- failure :: HasCallStack => Text -> a
- failure' :: HasCallStack => Format Text (a -> Text) -> a -> c
- forceRight :: (HasCallStack, Show a) => Either a b -> b
- show' :: Show a => a -> Text
- encodeDeterministicPretty :: Value -> ByteString
- withContext :: Text -> Either Text a -> Either Text a
- strictList :: Show a => [a] -> [a]
- traceHint :: Show a => Text -> a -> a
- sh :: Show a => Format r (a -> r)
- (<&>) :: Functor f => f a -> (a -> b) -> f b
- (<>) :: Monoid m => m -> m -> m
Documentation
type HasCallStack = ?callStack :: CallStack #
Request a CallStack.
NOTE: The implicit parameter ?callStack :: CallStack
is an
implementation detail and should not be considered part of the
CallStack
API, we may decide to change the implementation in the
future.
Since: 4.9.0.0
data UnknownType Source #
A type that is is not known and that is not meant to be exposed to the user.
myGroupBy' :: Ord b => (a -> b) -> [a] -> [(b, [a])] Source #
group by TODO: have a non-empty list instead
missing :: HasCallStack => Text -> a Source #
Missing implementations in the code base.
failure :: HasCallStack => Text -> a Source #
The function that is used to trigger exception due to internal programming errors.
Currently, all programming errors simply trigger an exception. All these impure functions are tagged with an implicit call stack argument.
forceRight :: (HasCallStack, Show a) => Either a b -> b Source #
Given a DataFrame or a LocalFrame, attempts to get the value, or throws the error.
This function is not total.
encodeDeterministicPretty :: Value -> ByteString Source #
Produces a bytestring output of a JSON value that is deterministic and that is invariant to the insertion order of the keys. (i.e the keys are stored in alphabetic order) This is to ensure that all id computations are stable and reproducible on the server part. TODO(kps) use everywhere JSON is converted
strictList :: Show a => [a] -> [a] Source #
Force the complete evaluation of a list to WNF.