Sha256: f590c916046cc830a088246a61605d7dd188ddcacbf8623668451cb63158832f

Contents?: true

Size: 379 Bytes

Versions: 12

Compression:

Stored size: 379 Bytes

Contents

require "tsort"

# @type var g: Hash[Integer, Array[Integer]]
g = {1=>[2, 3], 2=>[4], 3=>[2, 4], 4=>[]}

# @type var each_node: ^() { (Integer) -> void } -> void
each_node = -> (&b) { g.each_key(&b) }
# @type var each_child: ^(Integer) { (Integer) -> void } -> void
each_child = -> (n, &b) { g[n].each(&b) }

# @type var xs: Array[String]
xs = TSort.tsort(each_node, each_child)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
steep-0.48.0 smoke/tsort/a.rb
steep-0.47.1 smoke/tsort/a.rb
steep-0.47.0 smoke/tsort/a.rb
steep-0.46.0 smoke/tsort/a.rb
steep-0.45.0 smoke/tsort/a.rb
steep-0.44.1 smoke/tsort/a.rb
steep-0.44.0 smoke/tsort/a.rb
steep-0.43.1 smoke/tsort/a.rb
steep-0.43.0 smoke/tsort/a.rb
steep-0.42.0 smoke/tsort/a.rb
steep-0.41.0 smoke/tsort/a.rb
steep-0.40.0 smoke/tsort/a.rb