static IEnumerable <AssemblyName> GetAssemblies()
        {
            var asmNames = EnumerableOptimal.ConcatFast(
                Assembly.GetEntryAssembly()?.GetReferencedAssemblies() ?? new AssemblyName[0],
                EnumerableOptimal.ConcatFast(
                    Assembly.GetCallingAssembly()?.GetReferencedAssemblies() ?? new AssemblyName[0],
                    Assembly.GetExecutingAssembly()?.GetReferencedAssemblies() ?? new AssemblyName[0]))
                           .Distinct();

            var init = new[] {
                Assembly.GetEntryAssembly()?.GetName(),
                Assembly.GetCallingAssembly()?.GetName(),
                Assembly.GetExecutingAssembly()?.GetName()
            }
            .Filter(n => n != null);

            var set = Set <OrdString, string>();

            foreach (var asm in init.Append(asmNames))
            {
                if (!set.Contains(asm.FullName))
                {
                    set = set.Add(asm.FullName);
                    yield return(asm);
                }
            }
        }
Exemplo n.º 2
0
 static Seq <B> BindLazy <B>(Seq <A> ma, Func <A, Seq <B> > f) =>
 Seq(EnumerableOptimal.BindFast(ma, a => f(a).AsEnumerable()));
Exemplo n.º 3
0
 static IEnumerable <B> BindLazy <B>(IEnumerable <A> ma, Func <A, IEnumerable <B> > f) =>
 EnumerableOptimal.BindFast(ma, f);
Exemplo n.º 4
0
 public IEnumerable <A> Plus(IEnumerable <A> ma, IEnumerable <A> mb) =>
 EnumerableOptimal.ConcatFast(ma, mb);