From fa520d60899b68777795f9d3dd2c80e027118511 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 24 Apr 2017 15:41:17 -0400 Subject: [PATCH] Move the definition of FAlgebra up. --- src/Language/Ruby/Syntax.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Language/Ruby/Syntax.hs b/src/Language/Ruby/Syntax.hs index 27243731b..aaff50620 100644 --- a/src/Language/Ruby/Syntax.hs +++ b/src/Language/Ruby/Syntax.hs @@ -109,6 +109,10 @@ optional :: Assignment (Node Grammar) (Term Syntax Location) -> Assignment (Node optional a = a <|> term <*> pure Syntax.Empty +-- | An F-algebra on some carrier functor 'f'. +type FAlgebra f a = f a -> a + + -- | Produce a list of identifiable subterms of a given term. -- -- By “identifiable” we mean terms which have a user-assigned identifier associated with them, & which serve as a declaration rather than a reference; i.e. the declaration of a class or method or binding of a variable are all identifiable terms, but calling a named function or referencing a parameter is not. @@ -127,9 +131,6 @@ cyclomaticComplexityAlg (_ :< union) = case union of _ | Just Statement.Yield{} <- prj union -> succ (sum union) _ -> sum union --- | An F-algebra on some carrier functor 'f'. -type FAlgebra f a = f a -> a - -- | Lift an algebra into a decorator for terms annotated with records. decoratorWithAlgebra :: Functor f => FAlgebra (Base (Term f (Record fs))) a -- ^ An F-algebra on terms.