{-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE UndecidableInstances #-} module Utils where import Data.Tree import Network.URI.Slug import Relude import Symantic.Classes (IsoFunctor, ProductFunctor, SumFunctor) import Webc usedRoutes :: Layouter a -> [a] usedRoutes repr = f <$> foldMap flatten (layout repr) where f = \case LayoutNodeSlug a _s -> a usedSlugs :: Layouter a -> [[Slug]] usedSlugs repr = f <$> foldMap flatten (layout repr) where f = \case LayoutNodeSlug _a s -> s {- | Gather symantics used for those tests to instantiate multiple interpreters on the same quantified 'repr'. -} class (IsoFunctor repr, ProductFunctor repr, SumFunctor repr, Slugable repr) => Testable repr instance (IsoFunctor repr, ProductFunctor repr, SumFunctor repr, Slugable repr) => Testable repr