f#

F# Type Providers very very slow build

六月ゝ 毕业季﹏ 提交于 2020-01-01 03:18:05
问题 I'm playing around with Type Providers, specifically the sql entity framework type provider. I'm writing tests against a database that has a LOT of objects, and it's remote so the connection is a little slow. every time i build the project it takes a lot of time, good several minutes for the build to complete. what am I missing why does the compiler doesn't cache the type information? P.S. It's even worse with F# interactive.... 回答1: Try using the LocalSchemaFile attribute for the data

List comprehension vs high-order functions in F#

被刻印的时光 ゝ 提交于 2020-01-01 03:14:18
问题 I come from SML background and feel quite comfortable with high-order functions. But I don't really get the idea of list comprehension. Is there any situation where list comprehension is more suitable than high-order functions on List and vice versa? I heard somewhere that list comprehension is slower than high-order functions, should I avoid to use it when writing performance-critical functions? For the example' sake, take a look at Projecting a list of lists efficiently in F# where @cfern's

Generating F# code

谁说胖子不能爱 提交于 2020-01-01 03:11:17
问题 T4 is the "official" code generation engine for C#/VB.NET. But F# doesn't support it (this is from April, but I couldn't find any newer mentions). So what is a good way to generate F# code? EDIT: I want to implement 2-3 finger trees in F#. I already have implemented them in C#, so this should be a nice comparison. The "digits" and nodes of the tree can be represented as arrays, so type 't FingerTree = Empty | Single of 't | Deep of 't array * (('t FingerTree) array) lazy * 't array However,

Is F# a good language for card game AI? [closed]

一笑奈何 提交于 2020-01-01 02:39:09
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I'm writing a Mahjong Game in C# (the Chinese traditional game, not the solitaire kind). While writing the code for the bot player's

F#: Pattern Composition?

放肆的年华 提交于 2020-01-01 02:29:27
问题 I'm trying to write a pattern that composes two other patterns, but I'm not sure how to go about it. My input is a list of strings (a document); I have a pattern that matches the document header and a pattern that matches the document body. This pattern should match the entire document and return the results of the header and body patterns. 回答1: You can run two patterns together using & . You left out some details in your question, so here's some code that I'm assuming is somewhat similar to

F# Immutable data structures for high frequency real-time streaming data

别说谁变了你拦得住时间么 提交于 2019-12-31 22:31:32
问题 We are at the beginning of an f# project involving real-time and historical analysis of streaming data. The data is contained in a c# object (see below) and is sent as part of a standard .net event. In real-time, the number of events we typically receive can vary greatly from less than 1/sec to upwards of around 800 events per second per instrument and thus can be very bursty. A typical day might accumulate 5 million rows/elements per insturment A generic version of the C# event's data

F# Immutable data structures for high frequency real-time streaming data

好久不见. 提交于 2019-12-31 22:31:08
问题 We are at the beginning of an f# project involving real-time and historical analysis of streaming data. The data is contained in a c# object (see below) and is sent as part of a standard .net event. In real-time, the number of events we typically receive can vary greatly from less than 1/sec to upwards of around 800 events per second per instrument and thus can be very bursty. A typical day might accumulate 5 million rows/elements per insturment A generic version of the C# event's data

F#: is it OK for developing theorem provers?

陌路散爱 提交于 2019-12-31 19:29:08
问题 Please advise. I am a lawyer, I work in the field of Law Informatics. I have been a programmer for a long time (Basic, RPG, Fortran, Pascal, Cobol, VB.NET, C#). I am currently interested in F#, but I'd like some advise. My concern is F# seems to be fit for math applications. And what I want would require a lot of Boolean Math operations and Natural Language Processing of text and, if successful, speech. I am worried about the text processing. I received a revolutionary PROLOG source code

C# and F# lambda expressions code generation

ⅰ亾dé卋堺 提交于 2019-12-31 17:53:55
问题 Let's look at the code, generated by F# for simple function: let map_add valueToAdd xs = xs |> Seq.map (fun x -> x + valueToAdd) The generated code for lambda expression (instance of F# functional value) will looks like this: [Serializable] internal class map_add@3 : FSharpFunc<int, int> { public int valueToAdd; internal map_add@3(int valueToAdd) { this.valueToAdd = valueToAdd; } public override int Invoke(int x) { return (x + this.valueToAdd); } } And look at nearly the same C# code: using

C# and F# lambda expressions code generation

ぐ巨炮叔叔 提交于 2019-12-31 17:53:27
问题 Let's look at the code, generated by F# for simple function: let map_add valueToAdd xs = xs |> Seq.map (fun x -> x + valueToAdd) The generated code for lambda expression (instance of F# functional value) will looks like this: [Serializable] internal class map_add@3 : FSharpFunc<int, int> { public int valueToAdd; internal map_add@3(int valueToAdd) { this.valueToAdd = valueToAdd; } public override int Invoke(int x) { return (x + this.valueToAdd); } } And look at nearly the same C# code: using