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])]
- class CanRename a txt where
- 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
- 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
class CanRename a txt where Source #
The class of types that can be renamed. It is made generic because it covers 2 notions: - the name of a compute node that will eventually determine its compute path - the name of field (which may become an object path) This syntax tries to be convenient and will fail immediately for basic errors such as illegal characters.
This could be revisited in the future, but it is a compromise on readability.
CanRename (ComputeNode loc a) String Source # | |
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.