struct Generic[T] {
	ch chan T
}

struct Concrete {
	msg string
}

fn main() {
	g := create_generic_t[Concrete]()
	g.ch <- Concrete{
		msg: 'hello'
	}
}

fn create_generic_t[T]() Generic[T] {
	g := Generic[T]{
		ch: chan T{}
	}

	go g_worker(g)

	return g
}

fn g_worker(g Generic[T]) {
	t := <-g.ch
	handle(t)
	// println("${t.msg}")
}

fn handle(t T) {
	println('hi')
}

struct None {}

type MayBe[T] = None | T

fn (m MayBe[T]) is_some() bool {
	return m is T
}
