From 98f54cabd251ffe455adb0640e50310ce4effffa Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 10 Aug 2016 15:51:24 -0400 Subject: [PATCH] =?UTF-8?q?Reformat=20pqGramDecorator=E2=80=99s=20type=20s?= =?UTF-8?q?ignature=20for=20:memo:s.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Data/RandomWalkSimilarity.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Data/RandomWalkSimilarity.hs b/src/Data/RandomWalkSimilarity.hs index 35c61ebd6..8ab699376 100644 --- a/src/Data/RandomWalkSimilarity.hs +++ b/src/Data/RandomWalkSimilarity.hs @@ -60,7 +60,12 @@ data Gram label = Gram { stem :: [Maybe label], base :: [Maybe label] } deriving (Eq, Show) -- | Annotates a term with the corresponding p,q-gram at each node. -pqGramDecorator :: Traversable f => (forall b. CofreeF f (Record fields) b -> label) -> Int -> Int -> Cofree f (Record fields) -> Cofree f (Record (Gram label ': fields)) +pqGramDecorator :: Traversable f + => (forall b. CofreeF f (Record fields) b -> label) + -> Int + -> Int + -> Cofree f (Record fields) + -> Cofree f (Record (Gram label ': fields)) pqGramDecorator getLabel p q = cata algebra where algebra term = let label = getLabel term in cofree ((Gram (padToSize p []) (padToSize q (pure (Just label))) .: headF term) :< (`evalState` (siblingLabels (tailF term))) (for (tailF term) (assignLabels label)))