Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
215 views

In Windows, given a PowerShell script script1.ps1 and a command or PowerShell prompt, starting the script is just a matter of writing its name an enter in the keyboard: > .\script1.ps1 <...
Franco Tiveron's user avatar
2 votes
2 answers
113 views

Found that the question was pondered a few years ago: https://github.com/dotnet/fsharp/issues/8688 My code looks like #r "nuget: Microsoft.NETCore.App" #r "nuget: Microsoft.NETCore.App....
citykid's user avatar
  • 11.3k
2 votes
1 answer
124 views

I am attempting to parse records with a DateTime field, but FileHelpers is not using the format I am providing. The following is an F# script that should parse the records but throws an error. I ...
Matthew Crews's user avatar
3 votes
1 answer
224 views

I am using F# Formatting to do some Literate programming. My use case is that I have a couple of hundred data sets that I need to run through, and for each I want to create a "report" of some ...
UmaN's user avatar
  • 915
1 vote
1 answer
241 views

I have written a simple C# web app that allows the user to input some data and then upon button click: the data is saved to a local SQL db an F# script is called to retrieve that data using ...
J_L's user avatar
  • 320
4 votes
1 answer
686 views

I try to add reference to System.Memory by #r "C:/Program Files/dotnet/shared/Microsoft.NETCore.App/2.1.5/System.Memory.dll" But F# interactive still says The value or constructor 'Span' is not ...
ozgur's user avatar
  • 2,729
4 votes
1 answer
508 views

I create a new F# console application project in Visual Studio 2015 I create a simple new module file called Calc.fs like so: module Calc let add a b = a + b I add an F# script file to the project ...
urig's user avatar
  • 16.9k
0 votes
0 answers
86 views

How can I define two functions in a given file system using f#script? A function that will have two arguments and will create a file into the root directory of the given file system. The first ...
Oluwagbemi Kadri's user avatar
3 votes
0 answers
524 views

I'm working with visual studio 2015. I undestood that I have to create a console application project, then I added the scripts. Now i don't understand what I have to do. my main is just 4 lines of ...
Giuseppe Ayanami De Frenza's user avatar
3 votes
1 answer
129 views

I have a script: open System open System.IO let fileSize path = try Some((new FileInfo(path)).Length) with | e -> printfn "%A" e None let dirSize dir = ...
fairjm's user avatar
  • 1,207
5 votes
1 answer
626 views

I'm writing a type provider which allows the user to supply a configuration file to it. I use the TP's internal configuration object to identify the ResolutionFolder, which I use to get the fully-...
Isaac Abraham's user avatar
2 votes
1 answer
1k views

Using Visual Studio 2015 Update 3 and fsi.exe from F# v4.0 I' trying to run this script: //error.fsx #if INTERACTIVE let msg = "Interactive" #else let msg = "Not Interactive" #endif let add ...
Matt Klein's user avatar
  • 8,484
2 votes
1 answer
128 views

If I have a module of name MyModule defined in an .fsx script and referenced from within another .fsx script; is it possible to determine at runtime if the module defines a variable foo? I am trying ...
Stewart_R's user avatar
  • 14.5k
3 votes
2 answers
1k views

I installed the Ionide-fsharp (1.9.1) package in VSCode (1.2.1) and started writing some example scripts from fsharpforfunandprofit.com. I expected to have autocomplete in the VSCode editor, but it ...
Homorozeanu George's user avatar
0 votes
1 answer
223 views

Alright, so I'm a happy fsx-script programmer, because I love how I can have the compiler shout at me when I do mistakes before they show up at runtime. However I've found a case which really ...
ympostor's user avatar
  • 969
4 votes
1 answer
805 views

I am trying to use F# to automate some Excel tasks. I actually got two issues: 1. If I open a workbook using an Excel.Application instance, I would miss all the add-ins that would have been ...
xiphoid's user avatar
  • 73
11 votes
2 answers
3k views

I'm trying to find a simple solution that isn't so much manual work to reference packages. inside a .fsx file. LinqPad 4 lets me simply add nuget packages no intellisense or autocompletion deletes ...
Maslow's user avatar
  • 18.8k
0 votes
1 answer
81 views

I have noticed this a few times now. An example of an offending function is Array.take. In a script file I can write [|1; 2; 4; 7; 6; 5|] |> Array.take 3 |> Array.iter (printfn "%d") and this ...
Shredderroy's user avatar
  • 2,930
0 votes
2 answers
773 views

I want to use the following console program to get the type information (not the data) of Csv type provider. The file name will be passed as a command line argument. However, it seems the CsvProvider&...
ca9163d9's user avatar
  • 29.6k
2 votes
2 answers
2k views

I want to load a file from a .fsx script into into the F# Interactive Session but I can't use #load since I only want to load it if a certain condition is true. Is there a function like FSI.LoadFile ...
forki23's user avatar
  • 2,814
-1 votes
1 answer
120 views

I have a button class derived from Button() with position attribute namespace fgame15 open System open System.Windows.Forms open System.Drawing module Game15Button = type Game15Button(position:...
Aydar Omurbekov's user avatar
6 votes
2 answers
1k views

I'm just learning F#, and while playing at tryfsharp.org I noticed that if I change this code: [0..100] |> List.sum to ["A"; "B"; "D"] |> List.sum I get the following error: The type 'string' ...
Danny Tuppeny's user avatar
2 votes
3 answers
789 views

I like F# and I want to practice a little by writing some scripts for automation of some annoying task. How do i interact with other programs the same way i can do from CMD or PowerShell for example ...
AK_'s user avatar
  • 8,129
2 votes
2 answers
325 views

I have a function // Will perform a given function twice let twice f = (fun x -> f (f x)) Then I have something like. // Take x add 1 let f x = x+1 Depending on how I call twice it behaves ...
Mike John's user avatar
  • 818
0 votes
1 answer
1k views

let rec merge = function | ([], ys) -> ys | (xs, []) -> xs | (x::xs, y::ys) -> if x < y then x :: merge (xs, y::ys) else y :: merge (x::xs, ys) let rec split = ...
MarkNinja's user avatar
-1 votes
1 answer
1k views

I'm trying to expand on James Hugard's post How do I plot a data series in F#? and I'm running into a glitch when using a variable number of function arguments. If I specifically name out the ...
Shawn Eary's user avatar
0 votes
2 answers
1k views

Trying to write a recursive function that will cut a list by n. Then return 2 lists. So if I pass cut(2, [5;10;4;2;7]);; val it : int list * int list = ([5; 10], [4; 2; 7]) I would like to get ...
MarkNinja's user avatar
1 vote
1 answer
107 views

this simple function let s = function | [] -> [[]] | list -> []::list has type ('a List List -> 'a List List). Thus, since 'a is generic, it accepts lists af arbitrary depth as ...
D.F.F's user avatar
  • 981
1 vote
2 answers
351 views

I have been trying to write a curried function "multvec" which uses u=(u1, u2, ..., un) and v=(v1, v2, ..., vn) and outputs u1*v1 + u2*v2 + ... + un*vn. I think I have the logic mostly correct (at ...
wmarquez's user avatar
  • 147
7 votes
1 answer
1k views

Is it possible to use an app.config file from a F# script (fsx) file? If so, how? Where do I put the file and what will it be called?
Aidan's user avatar
  • 4,931
0 votes
1 answer
446 views

I have been doing a little reading on F# and decided to give it a try. I started with a somewhat involved example and I came up with and got lost immediately. I wonder if someone can share some ...
user1763590's user avatar
4 votes
3 answers
995 views

I have a bunch of F# scripts (fsx) that I use for my basic deployment needs. I just right click them and say "Run with F# interactive" However, sometimes the script fails and I would like to keep the ...
Christoph's user avatar
  • 28.5k
8 votes
2 answers
6k views

I am trying to build a single sequence that contains the contents of multiple files so that it can be sorted and then passed to a graphing component. However I am stuck trying to fold the contents of ...
Glyn Darkin's user avatar
2 votes
1 answer
2k views

I created a type Person as follows which runs fine. type Person = { First: string; Last : string } override this.ToString() = sprintf "%s, %s" this.First this.Last But when I try to make a ...
ivorykoder's user avatar
  • 1,020
1 vote
2 answers
460 views

Is it possible to stem words without using Regex in F#? I want to know how can I write a F# function which inputs a string and stems it. eg. input = "going" output = "go" I can't find a way to ...
codious's user avatar
  • 3,521
0 votes
3 answers
205 views

I am trying to write a code to remove stopwords like "the", "this" in a string list etc. I wrote this code: let rec public stopword (a : string list, b :string list) = match [a.Head] with ...
codious's user avatar
  • 3,521
1 vote
4 answers
188 views

I have a question regarding two types int -> (int -> int) and (int -> int) -> int. What is the difference between these two? I read here somewhere that the first one could be interpreted as a ...
user1072706's user avatar
1 vote
1 answer
587 views

I have this code provided by my instructor. I am supposed to fix it by finding what type f# infers from mergesort. When I try to send to interactive i get an error . I asked my proffesor what was ...
user1072706's user avatar
0 votes
1 answer
488 views

I want to read a text File and count the number of vowels in it. I want to know how to convert "ParseFile" content in to a string then pass as a variable to countVowels Obviously, the way I am trying ...
codious's user avatar
  • 3,521
7 votes
1 answer
7k views

Possible Duplicate: F# - cross product of two lists Projecting a list of lists efficiently in F# I have a function that takes two integer lists and returns a single list with all the cartesian ...
user1072706's user avatar
0 votes
4 answers
6k views

I would like to implement a function that takes as input a size n and a list. This function will cut the list into two lists, one of size n and the rest in another list. I am new to this language and ...
user1072706's user avatar
11 votes
6 answers
4k views

I am looking to merge 2 lists in F# in a purely functional way. I am having a hard time understanding the syntax. Let say I have a tuple ([5;3;8],[2;9;4]) When I call the function, it should return ...
user1072706's user avatar
4 votes
1 answer
445 views

I am trying something really simple in F# to try and test interaction with the SharePoint 2010 API. I think I am running into a general problem with F#. Is there anyway that an F# script can access ...
249076's user avatar
  • 670
6 votes
2 answers
1k views

When dynamically referencing assemblies in .fsx using #I and #r, VS highlights the following usages of imported types and writes "The namespace or module 'XXX' is not defined". Is it ok? For example,...
Dmitrii Lobanov's user avatar
0 votes
3 answers
945 views

I am very new to F# and i do more work with Javascript. I just want to know whether it is possible to call a javascript function from F#. Of course this Question may not show minimum effort. But i am ...
user avatar
8 votes
2 answers
2k views

Is it easily possible to run a F# script from within (and in the context) of a C# Application (host). With 'in the context' I mean the following should be true: no separate process for the execution ...
mklein's user avatar
  • 1,817
0 votes
2 answers
111 views

I need to capture a value and don't know how to do it. myData |> Seq.count How do I capture that count? I want to be able to do an if on it or whatever. Thanks.
Jayson Bailey's user avatar
11 votes
1 answer
6k views

I use F# as a scripting language with FSI. Is there a way to include another fsx file in my script? I want to be able to break my scripts into multiple files for larger tasks. Thanks.
Jayson Bailey's user avatar
0 votes
1 answer
724 views

How could I make this work? #I (__SOURCE_DIRECTORY__ + @"\bin\Release") And second questions. Is it possible to do something like: let path = __SOURCE_DIRECTORY__ + @"\bin\Release" #I path ?
Oldrich Svec's user avatar
  • 4,231
2 votes
1 answer
442 views

Is there a way within FSI that I can reference and use registered COM components? In a normal .fs compiled program I can simply reference the component in question and then open the relevant ...
Ross McKinlay's user avatar