| Copyright | (c) Ian Duncan 2021 |
|---|---|
| License | BSD-3 |
| Maintainer | Ian Duncan |
| Stability | experimental |
| Portability | non-portable (GHC extensions) |
| Safe Haskell | None |
| Language | Haskell2010 |
OpenTelemetry.Util
Contents
Description
Synopsis
- constructorName :: (HasConstructor (Rep a), Generic a) => a -> String
- class HasConstructor (f :: Type -> Type)
- getThreadId :: ThreadId -> Int
- bracketError :: MonadUnliftIO m => m a -> (Maybe SomeException -> a -> m b) -> (a -> m c) -> m c
- data AppendOnlyBoundedCollection a
- emptyAppendOnlyBoundedCollection :: Int -> AppendOnlyBoundedCollection a
- appendToBoundedCollection :: AppendOnlyBoundedCollection a -> a -> AppendOnlyBoundedCollection a
- appendOnlyBoundedCollectionSize :: AppendOnlyBoundedCollection a -> Int
- appendOnlyBoundedCollectionValues :: AppendOnlyBoundedCollection a -> Vector a
- appendOnlyBoundedCollectionDroppedElementCount :: AppendOnlyBoundedCollection a -> Int
Documentation
constructorName :: (HasConstructor (Rep a), Generic a) => a -> String Source #
Useful for annotating which constructor in an ADT was chosen
Since: 0.1.0.0
class HasConstructor (f :: Type -> Type) Source #
Detect a constructor from any datatype which derives Generic
Minimal complete definition
genericConstrName
Instances
| (HasConstructor x, HasConstructor y) => HasConstructor (x :+: y) Source # | |
Defined in OpenTelemetry.Util Methods genericConstrName :: (x :+: y) x0 -> String | |
| Constructor c => HasConstructor (C1 c f) Source # | |
Defined in OpenTelemetry.Util Methods genericConstrName :: C1 c f x -> String | |
| HasConstructor f => HasConstructor (D1 c f) Source # | |
Defined in OpenTelemetry.Util Methods genericConstrName :: D1 c f x -> String | |
getThreadId :: ThreadId -> Int Source #
Get an int representation of a thread id
bracketError :: MonadUnliftIO m => m a -> (Maybe SomeException -> a -> m b) -> (a -> m c) -> m c Source #
Like bracket, but provides the after function with information about
uncaught exceptions.
Since: 0.1.0.0
Data structures
data AppendOnlyBoundedCollection a Source #
Instances
| Show a => Show (AppendOnlyBoundedCollection a) Source # | |
Defined in OpenTelemetry.Util Methods showsPrec :: Int -> AppendOnlyBoundedCollection a -> ShowS # show :: AppendOnlyBoundedCollection a -> String # showList :: [AppendOnlyBoundedCollection a] -> ShowS # | |
emptyAppendOnlyBoundedCollection Source #
Arguments
| :: Int | Maximum size |
| -> AppendOnlyBoundedCollection a |
Initialize a bounded collection that admits a maximum size
appendToBoundedCollection :: AppendOnlyBoundedCollection a -> a -> AppendOnlyBoundedCollection a Source #
appendOnlyBoundedCollectionValues :: AppendOnlyBoundedCollection a -> Vector a Source #