A practical functional library for C# programmers. This is a port from the javascript Ramda library.
Like Ramda itself, this code is licensed under the MIT License
Copyright © 2016 Sagi Fogel
Practical functional C# port from Ramda.js
License: MIT License
A practical functional library for C# programmers. This is a port from the javascript Ramda library.
Like Ramda itself, this code is licensed under the MIT License
Copyright © 2016 Sagi Fogel
I was trying out the library and it seems that when you do a merge on a type you end up with a dynamic ExpandoObject which then wouldn't pipe to another method/function. Do I have to remap the dynamic objects back to a type any time I do a merge?
More generally, does this library preserve typing and facilitate mapping one type to another? Obviously this wouldn't be an issue for Ramda.js, but a big deal for C#.
Are you willing to create a Nuget package to make cloud builds easier?
using System;
namespace temp1
{
class MainClass
{
public static void Main(string[] args)
{
Ramda.NET.R.Add(2, 3);
Console.WriteLine("Hello World!");
}
}
}
The type initializer for 'Ramda.NET.Currying' threw an exception.
System.TypeInitializationException: The type initializer for 'Ramda.NET.Currying' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: Ramda.NET.Currying' does not contain a definition for
DynamicInvoke'
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,System.Type,object,object[])
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0013d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:512
at Ramda.NET.Currying.Dispatchable (System.String methodName, System.Object xf, System.Object fn, System.Object[] arguments) [0x00195] in /Users/zzz/Downloads/Ramda.NET-master/Currying.internal.cs:254
at System.Dynamic.UpdateDelegates.UpdateAndExecute5[T0,T1,T2,T3,T4,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4) [0x00159] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:762
at Ramda.NET.Currying+c__AnonStoreyA.<>m__0 (System.Object arg1, System.Object arg2) [0x00000] in /Users/zzz/Downloads/Ramda.NET-master/Currying.internal.cs:221
at at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:313
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00107] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:461
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MulticastDelegate.cs:67
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:406
at Ramda.NET.ReflectionExtensions.Invoke (System.Delegate target, System.Object[] arguments) [0x0006f] in /Users/zzz/Downloads/Ramda.NET-master/Extensions/ReflectionExtensions.cs:382
at Ramda.NET.DelegateDecorator.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments, System.Object& result) [0x00009] in /Users/zzz/Downloads/Ramda.NET-master/DelegateDecorator.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0013d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:512
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
at Ramda.NET.Curry2.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments) [0x001f9] in /Users/zzz/Downloads/Ramda.NET-master/Curry2.cs:32
at Ramda.NET.AbstractLambda.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] args, System.Object& result) [0x00005] in /Users/zzz/Downloads/Ramda.NET-master/AbstractLambda.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,System.Collections.IList)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0013d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:512
at Ramda.NET.Currying.m__9A (System.Object p, System.Collections.IList list) [0x00000] in /Users/zzz/Downloads/Ramda.NET-master/Currying.cs:1156
at at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:313
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00107] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:461
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MulticastDelegate.cs:67
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:406
at Ramda.NET.ReflectionExtensions.Invoke (System.Delegate target, System.Object[] arguments) [0x0006f] in /Users/zzz/Downloads/Ramda.NET-master/Extensions/ReflectionExtensions.cs:382
at Ramda.NET.DelegateDecorator.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments, System.Object& result) [0x00009] in /Users/zzz/Downloads/Ramda.NET-master/DelegateDecorator.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0013d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:512
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
at Ramda.NET.Curry2.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments) [0x001f9] in /Users/zzz/Downloads/Ramda.NET-master/Curry2.cs:32
at Ramda.NET.AbstractLambda.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] args, System.Object& result) [0x00005] in /Users/zzz/Downloads/Ramda.NET-master/AbstractLambda.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,string,System.Collections.IList)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0013d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:512
at Ramda.NET.Currying.m__AB (System.Object after, System.Collections.IList fns) [0x00015] in /Users/zzz/Downloads/Ramda.NET-master/Currying.cs:1289
at at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:313
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00107] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:461
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MulticastDelegate.cs:67
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:406
at Ramda.NET.ReflectionExtensions.Invoke (System.Delegate target, System.Object[] arguments) [0x0006f] in /Users/zzz/Downloads/Ramda.NET-master/Extensions/ReflectionExtensions.cs:382
at Ramda.NET.DelegateDecorator.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments, System.Object& result) [0x00009] in /Users/zzz/Downloads/Ramda.NET-master/DelegateDecorator.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0003e] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:444
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,object)
at Ramda.NET.Curry2.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments) [0x001f9] in /Users/zzz/Downloads/Ramda.NET-master/Curry2.cs:32
at Ramda.NET.AbstractLambda.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] args, System.Object& result) [0x00005] in /Users/zzz/Downloads/Ramda.NET-master/AbstractLambda.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object,System.Collections.IList)
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1, T2 arg2) [0x0013d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:512
at Ramda.NET.Currying.m__B3 (System.Collections.IList fns) [0x00000] in /Users/zzz/Downloads/Ramda.NET-master/Currying.cs:1346
at at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00038] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:305
--- End of inner exception stack trace ---
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0004d] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System.Reflection/MonoMethod.cs:313
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/referencesource/mscorlib/system/reflection/methodbase.cs:229
at System.Delegate.DynamicInvokeImpl (System.Object[] args) [0x00107] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:461
at System.MulticastDelegate.DynamicInvokeImpl (System.Object[] args) [0x0000b] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/MulticastDelegate.cs:67
at System.Delegate.DynamicInvoke (System.Object[] args) [0x00000] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/corlib/System/Delegate.cs:406
at Ramda.NET.ReflectionExtensions.Invoke (System.Delegate target, System.Object[] arguments) [0x0006f] in /Users/zzz/Downloads/Ramda.NET-master/Extensions/ReflectionExtensions.cs:382
at Ramda.NET.DelegateDecorator.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments, System.Object& result) [0x00009] in /Users/zzz/Downloads/Ramda.NET-master/DelegateDecorator.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object)
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1) [0x00132] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:387
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object)
at Ramda.NET.Curry1.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] arguments) [0x00092] in /Users/zzz/Downloads/Ramda.NET-master/Curry1.cs:27
at Ramda.NET.AbstractLambda.TryInvoke (System.Dynamic.InvokeBinder binder, System.Object[] args, System.Object& result) [0x00005] in /Users/zzz/Downloads/Ramda.NET-master/AbstractLambda.cs:18
at at (wrapper dynamic-method) System.Object:CallSite.Target (System.Runtime.CompilerServices.Closure,System.Runtime.CompilerServices.CallSite,object,object[])
at System.Dynamic.UpdateDelegates.UpdateAndExecute2[T0,T1,TRet] (System.Runtime.CompilerServices.CallSite site, T0 arg0, T1 arg1) [0x00132] in /private/tmp/source-mono-4.8.0/bockbuild-mono-4.8.0-branch/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/dlr/Runtime/Microsoft.Scripting.Core/Actions/UpdateDelegates.Generated.cs:387
at Ramda.NET.Currying..cctor () [0x02a39] in /Users/zzz/Downloads/Ramda.NET-master/Currying.cs:1383
--- End of inner exception stack trace ---
at temp1.MainClass.Main (System.String[] args) [0x00003] in /Users/zzz/Projects/temp1/temp1/Program.cs:9
Hi there, sorry to bother, this could be a dump question but I cant figure it out.
Im trying to use R.IsNil
like this: var result = R.Not(R.IsNil(someObject))
but it doesnt work. SomeObject
is null
so result
should be false
but it gives me an exception: Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'The best overloaded method match for 'Ramda.NET.R.Not(bool)' has some invalid arguments'
How is it that I have to use the lib?
thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.