Favorite Tags
View questions based on your favorite tags across the Stack Exchange network

1 answer

Using Automapper with F# Entity Type Provider

I am looking at Automapper for the first time using F# and the Entity Type Provider. I want to map between the EF Type Provider types and the F# record types that I have created. The EF Type ...

1 answer

Type inference error

I have two types: type Issue = { Id: string; Assigned_To: string; } type Journal = { JournalizedId: string; Id: string; UserId: string; } I want to create a function which get the list ...

1 answers | 3 hours ago by demas on Stack Overflow stackoverflow.com
2 answers

Find distance between list's elements

I have a list of numbers and want to get the list of distances between the numbers. For example: [1; 3; 8; 10; 12] → [2; 5; 2; 2] Here is my code: let rec diffs lst acc = match List.length lst ...

2 answers | 4 hours ago by demas on Stack Overflow stackoverflow.com
25 answers

Invert “if” statement to reduce nesting

When I ran ReSharper on my code, for example: if (some condition) { Some code... } ReSharper gave me the above warning (Invert "if" statement to reduce nesting), and ...

25 answers | 5 hours ago by Lea Cohen on Stack Overflow stackoverflow.com
2 answers

Object initialization syntax

I'm just starting out with F# and I can't find the syntax to do object initialization like in C# 3. I.e. given this: public class Person { public DateTime BirthDate { get; set; } public string ...

1 answer

F# FAKE will not execute powershell script file

Update: The actual cause of the issue was the '\' being round the wrong way, should have been './GenerateNuspecFile.ps1' - weird thing with F# parsing. I am unable to run a ps1 script file from F# ...

2 answers

F#,correct usage of split method

How do i use the split method in f# correctly? The code: let a = "abc def" let b = a.Split [|' '|] Console.WriteLine("{0}", b) does return "System.String[]" i tryed many variations of: ...

2 answers | yesterday by Philipp on Stack Overflow stackoverflow.com
1 answer

Websharper HighCharts Exmaple

It couldn't find the JQuery and Highcharts packages so I had to download them from nuget. Besides that I am running the example as a single page application. It doesn't run and I get the following ...

2 answers

How to fix this bug in a math expression evaluator

I've written a typical evaluator for simple math expressions (arithmetic with some custom functions) in F#. While it seems to be working correctly, some expressions don't evaluate as expected, for ...

3 answers

F# reduce function on List of Tuples

This simple piece of code is stumping me So this works > let l = [1; 2; 3; 4];; val l : int list = [1; 2; 3; 4] > List.reduce(fun accm i -> accm + i) l;; val it : int = 10 But this ...

2 answers

Cancel a sub-block of an F# async workflow

I'm trying to make an async workflow, where there's a main async loop, which executes an async sub-block in each loop. And I want this async sub-block to be cancellable, but when it cancels then I ...

2 answers | 2 days ago by Dax Fohl on Stack Overflow stackoverflow.com
1 answer

ReSharper: Null check is always false warning

Using ReSharper 8.2 I get a warning ("Expression is always false") for the null check in public bool TryGetValue(TKey key, out TValue value) { if (key == null) from NHibernate NullableDictionary. ...

1 answers | 2 days ago by user764754 on Stack Overflow stackoverflow.com
2 answers

Returning neighbours of a cell in a given matrix F#

I have written a small snippet for extracing any neighbours of a given cell in a NxN matrix. Like so let getNeighbours (x,y) (matrix: 'a [,]) = let lower n = max 0 (n - 1) let upper n = min ...

1 answer

Resharper Code Inspection bug?

Example: Public Enum Vehicles As Integer Car = 0 MotorBike = 1 Plane = 2 End Enum To get each vehicle member value (0, 1, 2) I suppose I have to cast it like this: ...

1 answers | 2 days ago by SomeNickName on Stack Overflow stackoverflow.com
1 answer

quickly reading text data into array

I'm having difficulty reading from a text file into an array of floats using F#. The text files have lots of other data types so I can't use the CSV parser but I'm sure there must be a simple function ...

1 answers | 2 days ago by arthuritus on Stack Overflow stackoverflow.com
0 answers

Resharper support for NUnit 3.0 alpha

Is there any way to inject support into Resharper for NUnit 3.0 alpha? I don't see a Resharper extension for that version of NUnit and the NUnit page says that the 2.x version runner won't run 3.x ...

0 answers

Code formatting issue - adding spaces and line-wrapping

On code cleanup, this: <a onclick='DisplayScheduleNowPopup(@Model.Contract.ContractId, false)'>Schedule</a> Turns into: <a onclick=' ...

10 answers

Using Artificial Intelligence (AI) to predict Stock Prices

Given a set of data very similar to the Motley Fool CAPS system, where individual users enter BUY and SELL recommendations on various equities. What I would like to do is show each recommendation and ...

2 answers

Multiple Videos On Screen

I'm trying to get a whole bunch of videos on screen, playing at one time. The idea would be to slowly pan into the central video. Any ideas how this can be achieved? I'm using Sony Vegas Pro 9. I've ...

2 answers | 2 days ago by Tjcrazy on Video Production video.stackexchange.com
3 answers

F# cross-thread UI exception in WinForms App

I have a problem with developing a simple application in F#, which just reads the length of the requested HTML page. Seems to be that such an error would be similar for VB.NET/C# language too, when ...

1 answer

Intuition behind calling Zero for else branch of if..then construct in computation expressions

The msdn documentation for the Zero method in computation expressions states that Called for empty else branches of if...then expressions in computation expressions. Assume we're using an ...

4 answers

How do I use Travis-CI with C# or F#

Travis CI continuous integration service officially supports many languages, but not C# or F#. Can I use it with my .net projects?

4 answers | Dec 19 at 12:32 by jbtule on Stack Overflow stackoverflow.com
0 answers

How to access F#.Data.SqlClient Record properties dynamically

I've got some data Records returned via an F# Data SqlClient Type provider using code like: open FSharp.Data [<Literal>] let connectionString = "..." [<Literal>] let ...

1 answer

How to compare Matrix elements in Math.Net numerics in F#

In this question, I asked how to perform a similar operation using PowerPack. I have decided to use MathNet instead as it is designed for .Net in general, not just F#. I need a function that takes 2 ...

1 answers | Dec 19 at 8:32 by Travis on Stack Overflow stackoverflow.com
1 answer

why is Seq.iter and Seq.map so much slower?

Consider this code in F#: let n = 10000000 let arr = Array.init n (fun _ -> 0) let rec buildList n acc i = if i = n then acc else buildList n (0::acc) (i + 1) let lst = buildList n [] 0 let ...

1 answers | Dec 19 at 6:35 by theburningmonk on Stack Overflow stackoverflow.com
5 answers

How to invoke the function in Seq.whatever without “printf”?

I'm new to f# and I tried to write a program supposed to go through all files in a given dir and for each file of type ".txt" to add an id number + "DONE" to the file. my program: //const: ...

5 answers | Dec 19 at 6:30 by nati on Stack Overflow stackoverflow.com
1 answer

Convert delimited string to array

I have an F# Library I call from C# that reads JSON output and CSV files. The library does processing of the data. When reading a CSV file to a datatable, I can iterate over the header row like ...

1 answers | Dec 19 at 6:27 by RT1138 on Stack Overflow stackoverflow.com
2 answers

Any benefit for targeting F# runtime for F# 4.0 or 3.1 instead of 3.0?

In Visual Studio 2015 Preview you can select from three target F# runtimes: Is there any benefit to targeting the newer versions? Do they give you access to additional APIs? If so, which ones? It ...

2 answers | Dec 19 at 0:31 by Cameron Taggart on Stack Overflow stackoverflow.com
2 answers

InvalidOperationException in Fsharp.Core.dll

So I am doing a simple personal project in winforms with F#. My code used to work, but now throws this exception for seemingly no reason. An unhandled exception of type ...

3 answers

How to make Resharper resolve path for CustomBinding MarkupExtension

I want to create some extended Binding-Markup-Extension, which behaves just like a normal WPF-Binding but does some things more (use different defaults, maybe add some behavior, etc.). Code looks like ...

15 30 50 per page
1 2 3