From 32e084971a26bddc83971b4e8b8b90d4b31ae35e Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 4 Aug 2016 15:37:49 -0400 Subject: [PATCH] Define decorateTermWithLabel inline. --- src/Data/RandomWalkSimilarity.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Data/RandomWalkSimilarity.hs b/src/Data/RandomWalkSimilarity.hs index f75beac8a..72b6a1f07 100644 --- a/src/Data/RandomWalkSimilarity.hs +++ b/src/Data/RandomWalkSimilarity.hs @@ -112,8 +112,7 @@ featureVectorDecorator :: (Prologue.Foldable f, Functor f) => (forall b. CofreeF featureVectorDecorator getLabel p q d (a :< s) = Vector.replicate d 0 decorateTermWithLabel :: (Typeable label, Functor f) => (forall b. CofreeF f (Record fields) b -> label) -> Cofree f (Record fields) -> Cofree f (Record (label ': fields)) -decorateTermWithLabel getLabel = cata $ \ c@(h :< t) -> - cofree ((getLabel c .: h) :< t) +decorateTermWithLabel getLabel = cata $ \ c -> cofree ((getLabel c .: headF c) :< tailF c) decorateTermWithPQGram :: (Typeable label, Functor f) => (forall b. CofreeF f (Record (label ': fields)) b -> label) -> Int -> Int -> Cofree f (Record (label ': fields)) -> Cofree f (Record (Gram label ': fields)) decorateTermWithPQGram getLabel p q = futu coalgebra . (,) []