package DX::OrderedSet;

use DX::ArrayStream;
use Moo;

has values => (is => 'ro', default => sub { [] });

sub all { @{$_[0]->values} }

sub to_stream { DX::ArrayStream->from_array($_[0]->all) }

sub key_list { 0..$#{$_[0]->values} }

sub get { $_[0]->values->[$_[1]] }

1;
