mirror of
https://github.com/github/semantic.git
synced 2024-12-22 14:21:31 +03:00
Reformat pqGramDecorator’s type signature for 📝s.
This commit is contained in:
parent
db75159a63
commit
98f54cabd2
@ -60,7 +60,12 @@ data Gram label = Gram { stem :: [Maybe label], base :: [Maybe label] }
|
|||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
-- | Annotates a term with the corresponding p,q-gram at each node.
|
-- | 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
|
pqGramDecorator getLabel p q = cata algebra
|
||||||
where algebra term = let label = getLabel term in
|
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)))
|
cofree ((Gram (padToSize p []) (padToSize q (pure (Just label))) .: headF term) :< (`evalState` (siblingLabels (tailF term))) (for (tailF term) (assignLabels label)))
|
||||||
|
Loading…
Reference in New Issue
Block a user