Two things. First of all, Maybe is a concept and thus resolved at compile time.
The correct way to check whether your argument is of type Some[T] or not is by:
proc either[T](m: Maybe, alternative: T): T =
when m is Some[T]:
return m.value
else:
return alternative
And second, it looks like some sort of bug with concepts. If you replace m:
Maybe by m: tuple or object it works now
[https://glot.io/snippets/epais84qfv](https://glot.io/snippets/epais84qfv).
But if you want to make it work at runtime you should have a look at how
options work
[https://nim-lang.org/docs/options.html](https://nim-lang.org/docs/options.html).