1
1
mirror of https://github.com/github/semantic.git synced 2025-01-05 05:58:34 +03:00

Reformat Mapping across multiple lines.

This commit is contained in:
Rob Rix 2017-09-14 11:11:00 -04:00
parent 6a2afd8114
commit 5d8bc38e4b

View File

@ -223,7 +223,14 @@ genFeaturizedTermsAndDiffs sesDiffs = let Mapping _ _ a b c d = foldl' combine (
That term -> Mapping counterA (succ counterB) as (featurize counterB term : bs) mappedDiffs (RWS.Term (featurize counterB term) : allDiffs)
These a b -> Mapping (succ counterA) (succ counterB) as bs ((These counterA counterB, These a b) : mappedDiffs) (Index counterA : allDiffs)
data Mapping syntax fields = Mapping {-# UNPACK #-} !Int {-# UNPACK #-} !Int ![UnmappedTerm syntax (Record fields)] ![UnmappedTerm syntax (Record fields)] ![MappedDiff syntax (Record fields) (Record fields)] ![TermOrIndexOrNone (UnmappedTerm syntax (Record fields))]
data Mapping syntax fields
= Mapping
{-# UNPACK #-} !Int
{-# UNPACK #-} !Int
![UnmappedTerm syntax (Record fields)]
![UnmappedTerm syntax (Record fields)]
![MappedDiff syntax (Record fields) (Record fields)]
![TermOrIndexOrNone (UnmappedTerm syntax (Record fields))]
featurize :: (HasField fields FeatureVector, Functor syntax) => Int -> Term syntax (Record fields) -> UnmappedTerm syntax (Record fields)
featurize index term = UnmappedTerm index (getField (extract term)) (eraseFeatureVector term)