« first day (1775 days earlier)      last day (1749 days later) » 

12:35 PM
hm
F# Q
let's say there is a simple function:
module Sample =
    let inline toDoubleArray v =
        Array.map float v
and I want to call this function from C#:
var data = Enumerable.Range(0, 5).ToArray();
var fdata = Sample.toDoubleArray(data);
^ it raises an exception
and I have no idea why it happens
System.NotSupportedException: 'Dynamic invocation of op_Explicit is not supported'
 
 
1 hour later…
1:59 PM
posted on March 17, 2019 by Sergey Tihon

Welcome to F# Weekly, Fed up of fighting with infrastructure? Find out how to take advantage of Azure’s platform services that let you focus on writing F#. A roundup of F# content from this past week: News Bolero: F# in WebAssembly Try F# in Wasm JetBrains/fsharp-support 2019.1 Announcing ML.NET 0.11 – Machine Learning for .NET … Continue reading F# Weekly #11, 2019 – bolero.io, Rid

 
 
2 hours later…
4:07 PM
it's related to inline of course
 
4:36 PM
ok, seems I got it: float is marked as NoDynamicInvocation
 
4:58 PM
but still curious why this attribute doesn't allow C# to run code properly
so, mcve is: let [<NoDynamicInvocation>] inline nothing _ = ()
 
 
1 hour later…
6:04 PM
10
Q: Operator (-) used in F# raises Specified method is not supported exception from C#

mateuszlewkoI have this generic function in F# that uses (-) operator: let inline sub a b = a - b Now I'm calling this function from C#: int a = sub<int, int, int>(4, 1); This raises an error: Unhandled Exception: System.NotSupportedException: Specified method is not supported. at ProjA.MainClass...

the Q is solved :-)
 

« first day (1775 days earlier)      last day (1749 days later) »