namespace ShroedingersCat
using System.Collections.Generic;
using static System.Console;
using var container = Container.Create().Using<Glue>();
var box = container.Resolve<IBox<ICat>>();
interface IBox<out T> { T Content { get; } }
interface ICat { State State { get; } }
enum State { Alive, Dead }
class CardboardBox<T> : IBox<T>
public CardboardBox(T content) => Content = content;
public T Content { get; }
class ShroedingersCat : ICat
private readonly Lazy<State> _superposition;
public ShroedingersCat(Lazy<State> superposition) => _superposition = superposition;
public State State => _superposition.Value;
public override string ToString() => $"{State} cat";
class Glue : IConfiguration
public IEnumerable<IToken> Apply(IMutableContainer container)
.Bind<IBox<TT>>().To<CardboardBox<TT>>()
.Bind<ICat>().To<ShroedingersCat>();
var indeterminacy = new Random();
yield return container.Bind<State>().To(ctx => (State)indeterminacy.Next(2));