{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE MonoLocalBinds #-}
module Data.Registry.Dot (
module D
, makeDot
, makeDotEither
, makeDotFast
, makeDotUnsafe
) where
import Data.Registry.Internal.Dot as D
import Data.Registry.Statistics
import Data.Registry.Registry
import Data.Registry.Solver
import Protolude
makeDot :: forall a ins out . (Typeable a, Contains a out, Solvable ins out)
=> Registry ins out
-> Dot
makeDot = makeDotUnsafe @a
makeDotFast :: forall a ins out . (Typeable a, Contains a out)
=> Registry ins out
-> Dot
makeDotFast = makeDotUnsafe @a
makeDotEither :: forall a ins out . (Typeable a) => Registry ins out -> Either Text Dot
makeDotEither r = toDot . operations <$> makeStatisticsEither @a r
makeDotUnsafe :: forall a ins out . (Typeable a) => Registry ins out -> Dot
makeDotUnsafe = toDot . operations . makeStatisticsUnsafe @a