From a7e2920591901b646b5c8a32c553e9621df38c32 Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Wed, 14 Feb 2024 13:03:22 +0300 Subject: [PATCH] fix: formatting --- .../src/Language/EO/Phi/Metrics/Collect.hs | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/eo-phi-normalizer/src/Language/EO/Phi/Metrics/Collect.hs b/eo-phi-normalizer/src/Language/EO/Phi/Metrics/Collect.hs index ea424efc0..a7ce907f6 100644 --- a/eo-phi-normalizer/src/Language/EO/Phi/Metrics/Collect.hs +++ b/eo-phi-normalizer/src/Language/EO/Phi/Metrics/Collect.hs @@ -16,68 +16,68 @@ import Language.EO.Phi.Rules.Common () import Language.EO.Phi.Syntax.Abs data Metrics = Metrics - { dataless :: Int - , applications :: Int - , formations :: Int - , dispatches :: Int - } - deriving (Generic, Show, FromJSON, Eq) + { dataless :: Int + , applications :: Int + , formations :: Int + , dispatches :: Int + } + deriving (Generic, Show, FromJSON, Eq) defaultMetrics :: Metrics defaultMetrics = - Metrics - { dataless = 0 - , applications = 0 - , formations = 0 - , dispatches = 0 - } + Metrics + { dataless = 0 + , applications = 0 + , formations = 0 + , dispatches = 0 + } collectMetrics :: (Inspectable a) => a -> Metrics collectMetrics a = execState (inspect a) defaultMetrics class Inspectable a where - inspect :: a -> State Metrics () + inspect :: a -> State Metrics () instance Inspectable Program where - inspect (Program binding) = forM_ binding inspect + inspect (Program binding) = forM_ binding inspect instance Inspectable Binding where - inspect = \case - AlphaBinding attr obj -> do - inspect attr - inspect obj - EmptyBinding attr -> do - #dataless += 1 - inspect attr - DeltaBinding _ -> pure () - LambdaBinding _ -> #dataless += 1 - MetaBindings _ -> pure () + inspect = \case + AlphaBinding attr obj -> do + inspect attr + inspect obj + EmptyBinding attr -> do + #dataless += 1 + inspect attr + DeltaBinding _ -> pure () + LambdaBinding _ -> #dataless += 1 + MetaBindings _ -> pure () instance Inspectable Attribute where - inspect = \case - Phi -> pure () - Rho -> pure () - Sigma -> pure () - VTX -> pure () - Label _ -> pure () - Alpha _ -> pure () - MetaAttr _ -> pure () + inspect = \case + Phi -> pure () + Rho -> pure () + Sigma -> pure () + VTX -> pure () + Label _ -> pure () + Alpha _ -> pure () + MetaAttr _ -> pure () instance Inspectable Object where - inspect = \case - Formation bindings -> do - #formations += 1 - forM_ bindings inspect - Application obj bindings -> do - #applications += 1 - inspect obj - forM_ bindings inspect - ObjectDispatch obj attr -> do - #dispatches += 1 - inspect obj - inspect attr - GlobalObject -> pure () - ThisObject -> pure () - Termination -> pure () - MetaObject _ -> pure () - MetaFunction _ _ -> pure () + inspect = \case + Formation bindings -> do + #formations += 1 + forM_ bindings inspect + Application obj bindings -> do + #applications += 1 + inspect obj + forM_ bindings inspect + ObjectDispatch obj attr -> do + #dispatches += 1 + inspect obj + inspect attr + GlobalObject -> pure () + ThisObject -> pure () + Termination -> pure () + MetaObject _ -> pure () + MetaFunction _ _ -> pure ()