P.S. You should replace your use of ( == ) in S.map by S.equal otherwise you'll get potentially incorrect results (too many updates) with imperative dependent signals if your map function also returns constant signals --- unless you think that two constant signals with the same value should not be thought as equal.

Thanks, I had overlooked the existence of S.equal.