{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE MonoLocalBinds #-}
module Data.Registry.Dot
( module D,
makeDot,
makeDotEither,
)
where
import Data.Registry.Internal.Dot as D
import Data.Registry.Registry
import Data.Registry.Statistics
import Protolude
makeDot :: forall a ins out. (Typeable a) => Registry ins out -> Dot
makeDot :: forall {k} (a :: k) (ins :: [*]) (out :: [*]).
Typeable a =>
Registry ins out -> Dot
makeDot = Operations -> Dot
toDot (Operations -> Dot)
-> (Registry ins out -> Operations) -> Registry ins out -> Dot
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Statistics -> Operations
operations (Statistics -> Operations)
-> (Registry ins out -> Statistics)
-> Registry ins out
-> Operations
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (a :: k) (ins :: [*]) (out :: [*]).
Typeable a =>
Registry ins out -> Statistics
forall {k} (a :: k) (ins :: [*]) (out :: [*]).
Typeable a =>
Registry ins out -> Statistics
makeStatistics @a
makeDotEither :: forall a ins out. (Typeable a) => Registry ins out -> Either Text Dot
makeDotEither :: forall {k} (a :: k) (ins :: [*]) (out :: [*]).
Typeable a =>
Registry ins out -> Either Text Dot
makeDotEither Registry ins out
r = Operations -> Dot
toDot (Operations -> Dot)
-> (Statistics -> Operations) -> Statistics -> Dot
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Statistics -> Operations
operations (Statistics -> Dot) -> Either Text Statistics -> Either Text Dot
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall (a :: k) (ins :: [*]) (out :: [*]).
Typeable a =>
Registry ins out -> Either Text Statistics
forall {k} (a :: k) (ins :: [*]) (out :: [*]).
Typeable a =>
Registry ins out -> Either Text Statistics
makeStatisticsEither @a Registry ins out
r