haskell - How do I merge signals in Helm? -
i working on project using helm, based on elm language.
i need trigger event based on signal out of pair of signals arrives first. in elm, use merge function, cannot find equivalent in helm. closest see combine (in signal library), doesn't appear want. seems combine takes list of signals , makes them directly signal of lists, not quite i'm looking for.
edit: looking function signature signal -> signal -> signal a
takes first signal fire , discards second.
what's best way accomplish in helm?
i think best way finding out how helm's signal
s implemented in terms of elerea's stuff, , implementing merge
in more primitive terms. i'm afraid can't there, because don't know helm , don't know elerea @ all.
i can hacky solution based solely on helm. can use timestamp
distinguish different events zipped signals:
merge sigl sigr = let tsmerge (t1,v1) (t2,v2) = if t1 >= t2 v1 else v2 in tsmerge <~ timestamp sigl ~~ timestamp sigr
Comments
Post a Comment