Skip to content

Instantly share code, notes, and snippets.

@djspiewak
Created July 27, 2018 22:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djspiewak/47b2988457ca63a27135e80ab7580032 to your computer and use it in GitHub Desktop.
Save djspiewak/47b2988457ca63a27135e80ab7580032 to your computer and use it in GitHub Desktop.

Better leftShift

This all happens after resplitting. We almost certainly need better implementations of Slice#take/drop/takeRange

  1. Partition columns by focus/unfocus
  2. (Lazily?) inflate unfocused columns and build eager definedness bitsets
  3. Build eager definedness bitsets for all focused paths
  4. Remove shifted component of focused column paths
  5. Group focused column paths by type
  6. ModUnion ((CType, Array[(Int, Column)]) => Column) same-type columns ([1, 2, "foo", 3, "bar", true, 4, false]). The Int here represents the offset into the mod ring, since we can't just use the array index due to the example I gave.
  7. (Lazily?) inflate non-union focused columns
  8. Reassemble focused columns into map
  9. Apply definedness bitsets
  10. If OnUndefined.Omit, then union all definedness bitsets and use to mask unfocused columns
  11. Otherwise, don't
  12. Place unfocused columns under .0 and focused under .1

Definedness Bitsets

  1. Assign every path (ignoring type) a position around the mod ring
  2. For each definedness bitset, sparsen by mod offset (Bitset#sparsen(Int, Int): Bitset)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment