mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
Unpack a few fields.
This commit is contained in:
parent
7e05cec95f
commit
b5cb522d62
@ -42,13 +42,13 @@ type FeatureVector = UArray Int Double
|
||||
|
||||
-- | A term which has not yet been mapped by `rws`, along with its feature vector summary & index.
|
||||
data UnmappedTerm f fields = UnmappedTerm {
|
||||
termIndex :: Int -- ^ The index of the term within its root term.
|
||||
, feature :: FeatureVector -- ^ Feature vector
|
||||
termIndex :: {-# UNPACK #-} !Int -- ^ The index of the term within its root term.
|
||||
, feature :: {-# UNPACK #-} !FeatureVector -- ^ Feature vector
|
||||
, term :: Term f (Record fields) -- ^ The unmapped term
|
||||
}
|
||||
|
||||
-- | Either a `term`, an index of a matched term, or nil.
|
||||
data TermOrIndexOrNone term = Term term | Index Int | None
|
||||
data TermOrIndexOrNone term = Term term | Index {-# UNPACK #-} !Int | None
|
||||
|
||||
rws :: (HasField fields (Maybe FeatureVector), Functor f, Eq1 f)
|
||||
=> (Diff f fields -> Int)
|
||||
|
Loading…
Reference in New Issue
Block a user