{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ExistentialQuantification #-}
module System.Metrics.Prometheus.Ridley.Types.Internal
  ( RidleyMetricHandler(..)
  ) where

import           GHC.Stack
import qualified Data.Text as T

--------------------------------------------------------------------------------
data RidleyMetricHandler = forall c. RidleyMetricHandler {
  -- | An opaque metric
    ()
metric       :: c
  -- | An IO action used to update the metric
  , ()
updateMetric :: c -> Bool -> IO ()
  -- | Whether or not to flush this Metric
  , RidleyMetricHandler -> Bool
flush        :: !Bool
  -- | A user-friendly label, used to report errors
  , RidleyMetricHandler -> Text
label        :: !T.Text
  -- | A CallStack, for precise error reporting
  , RidleyMetricHandler -> CallStack
_cs          :: CallStack
  }