How do you handle C# aliases?

Hi everyone,

I keep finding myself in types like this:

Task<ImmutableDictionary<SomeType, ImmutableList<SomeOtherType<ThisType, AndThisType>>>>

Maybe a bit over-exaggerated 😅. I understand C# is verbose and prioritizes explicitness, but sometimes these nested types feel like overkill especially when typing it over and over again. Sometimes I wish C# had something like F# has:

type MyType = Task<ImmutableDictionary<SomeType, ImmutableList<SomeOtherType<ThisType, AndThisType>>>>

type MyType<'a, 'b> = Task<ImmutableDictionary<_, _>>

In C#, the closest thing we have is an using alias:

using MyType = Task<ImmutableDictionary<SomeType, ImmutableList<SomeOtherType<ThisType, AndThisType>>>>;

But it has limitations: file-scoped and can't be generic. The only alternative is to build a wrapper type, but then it doesn't function as an alias, and you would have to overload operators or write conversion helpers.

I am curious how others handle this without either letting types explode everywhere or introducing wrapper types just for naming.

Posted Jan 27, 2026, 11:39 AM UTC

4864
Loading comments…