diff --git a/semantic-tags/src/Language/Python.hs b/semantic-tags/src/Language/Python.hs index 52a9f18cb..ed619cdae 100644 --- a/semantic-tags/src/Language/Python.hs +++ b/semantic-tags/src/Language/Python.hs @@ -1,2 +1,12 @@ module Language.Python -() where +( Term(..) +) where + +import qualified Language.Python.Tags as PyTags +import qualified Tags.Tagging.Precise as Tags +import qualified TreeSitter.Python.AST as Py + +newtype Term a = Term { getTerm :: Py.Module a } + +instance Tags.ToTags Term where + tags src = Tags.runTagging src . PyTags.tags . getTerm diff --git a/semantic-tags/src/Language/Python/Tags.hs b/semantic-tags/src/Language/Python/Tags.hs index 66aeee9bf..7aea8809c 100644 --- a/semantic-tags/src/Language/Python/Tags.hs +++ b/semantic-tags/src/Language/Python/Tags.hs @@ -1,6 +1,6 @@ {-# LANGUAGE AllowAmbiguousTypes, DataKinds, DisambiguateRecordFields, FlexibleContexts, FlexibleInstances, MultiParamTypeClasses, NamedFieldPuns, ScopedTypeVariables, TypeApplications, TypeFamilies, TypeOperators, UndecidableInstances #-} module Language.Python.Tags -( Term(..) +( ToTags(..) ) where import Control.Effect.Reader @@ -18,12 +18,6 @@ import Tags.Tag import qualified Tags.Tagging.Precise as Tags import qualified TreeSitter.Python.AST as Py -newtype Term a = Term { getTerm :: Py.Module a } - -instance Tags.ToTags Term where - tags src = Tags.runTagging src . tags . getTerm - - class ToTags t where tags :: ( Carrier sig m