F# Immutable variable sized window data structure -
I have the details of the data structure below which I want and I want to implement it using irreversible data structures. I am trying to determine ... is there an existing data structure presenting what I am trying to do or whether I need to make one - and if I need to make it Would be good (building blocks) to start?
I have a constant flow of incoming values of a certain type. I want to add them to a permanent / irreversible data structure to keep a history, and on each addition, this will review the history and determine whether one or more of the oldest items will be removed (for example, if there is history > A is a certain property of some length or value).
Without knowing more about your needs, I want to just set a vanilla ' A - & Gt; unit, remove callback: 'a -> unit) = member it Add (x) = insert callback (x) AwesomeSet (internalSet.AddX, insert, delete) member. Remove (x) = removeCallback (X) AwesomeSet (internalSet.Remove x, insertCallback, removeCallback) Member it.Count = InternalSet.Count Member ThisMin = InternalSetMedualAllement MemberImax = InternalSet.Medium Element Lt; 'A & gt; Tell me more than enough job I like a 'set' on 'list' so that you can always reach the largest and smallest items, which will allow you to put the latest and oldest items for efficient use. Get permission to order your set for date / time.
Type AwesomeSet (internalSet: set & lt; 'a & gt; insert callback:
Comments
Post a Comment