diff --git a/src/Syntax.hs b/src/Syntax.hs index 866632d4a..9e2a1af2b 100644 --- a/src/Syntax.hs +++ b/src/Syntax.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DeriveAnyClass #-} +{-# LANGUAGE DeriveAnyClass, ScopedTypeVariables #-} module Syntax where import Data.Aeson @@ -109,26 +109,26 @@ data Syntax a f deriving (Eq, Foldable, Functor, Generic, Generic1, Mergeable, Ord, Show, Traversable, ToJSON, NFData) -extractLeafValue :: forall b leaf. S.Syntax leaf b -> Maybe leaf +extractLeafValue :: forall b leaf. Syntax leaf b -> Maybe leaf extractLeafValue syntax = case syntax of - S.Leaf a -> Just a + Leaf a -> Just a _ -> Nothing -maybeIdentifier :: forall leaf identifier. S.Syntax leaf identifier -> Maybe identifier +maybeIdentifier :: forall leaf identifier. Syntax leaf identifier -> Maybe identifier maybeIdentifier syntax = case syntax of - S.Assignment f _ -> Just f - S.Class f _ _ -> Just f - S.Export f _ -> f - S.Function f _ _ _ -> Just f - S.FunctionCall f _ -> Just f - S.Import f _ -> Just f - S.Method f _ _ _ _ -> Just f - S.MethodCall _ f _ -> Just f - S.Module f _ -> Just f - S.OperatorAssignment f _ -> Just f - S.SubscriptAccess f _ -> Just f - S.TypeDecl f _ -> Just f - S.VarAssignment f _ -> Just f + Assignment f _ -> Just f + Class f _ _ -> Just f + Export f _ -> f + Function f _ _ _ -> Just f + FunctionCall f _ -> Just f + Import f _ -> Just f + Method f _ _ _ _ -> Just f + MethodCall _ f _ -> Just f + Module f _ -> Just f + OperatorAssignment f _ -> Just f + SubscriptAccess f _ -> Just f + TypeDecl f _ -> Just f + VarAssignment f _ -> Just f _ -> Nothing -- Instances