LanguageExt.HashSet<A> clashes with System.Collections.Generic.HashSet<T> #1408
-
Let me first thank you for your awesome library, which I wanted to start using just now. And I thought it would be a good idea to use the latest beta of v5. However, unfortunately The somewhat ironic part is that my very first use case would be the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
The difference between
Calling To solve it:
global using G = System.Collections.Generic;
global using L = LanguageExt;
var xs = new G.HashSet<int>(); Another approach -- the one I take -- is to never use the If you take this more fundamentalist approach then you can global using System;
global using LanguageExt;
global using LanguageExt.Traits;
global using LanguageExt.Effects;
global using LanguageExt.Common;
global using static LanguageExt.Prelude;
global using G = System.Collections.Generic;
global using L = LanguageExt; This stops the |
Beta Was this translation helpful? Give feedback.
The difference between
Fin
andHashSet
is thatHashSet
is part of four types that are related:HashMap
andMap
HashSet
andSet
Calling
HashSet
something else to avoid the name clash would lead to inconsistent naming across the library, so it's a special case.To solve it:
HashSet
(and you have both namespaces included), just prefix withL.
orG.
:Another approach -- the one I take -- is to never use the
System
collection types as they're all mutable types and against the principles of pure functional programming. The only type I …