f#-interactive

How to use F# 4.7 on Mac?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-10 05:29:06
问题 With the latest VS for mac installed (8.5 preview) and the latest net core sdk (3.1.200) F# 4.7 should be supported. When I run the dotnet fsi, indeed language features are supported and the FSI shows F# 4.7 as the F# version. In VS for mac, in the preferences settings the exact command: /usr/local/share/dotnet/dotnet fsi is the path to the F# compiler. However, when creating a new fix file and trying F# language features, it doesn’t work and the FSI in VS for mac doesn’t compile the code.

How to use F# 4.7 on Mac?

丶灬走出姿态 提交于 2021-02-10 05:28:14
问题 With the latest VS for mac installed (8.5 preview) and the latest net core sdk (3.1.200) F# 4.7 should be supported. When I run the dotnet fsi, indeed language features are supported and the FSI shows F# 4.7 as the F# version. In VS for mac, in the preferences settings the exact command: /usr/local/share/dotnet/dotnet fsi is the path to the F# compiler. However, when creating a new fix file and trying F# language features, it doesn’t work and the FSI in VS for mac doesn’t compile the code.

F# error 'error FS0039: The namespace or module 'MySql' is not defined'?

微笑、不失礼 提交于 2021-02-08 08:59:19
问题 Hello I try to connect F# and MySQL database, but i got fallowing error :error FS0039: The namespace or module 'MySql' is not defined. So far,i tried to reference the folder which contains MySQL.Data.dll:project -> add reference->browse -> C:\Program Files (x86)\MySQL\MySQL Connector Net 6.3.6\Assemblies\v2.0 Also i tired to reference MySQL.Data,too. But each time,i get this error. Thanks for your help. Regards, 回答1: The F# interactive window is unaware of your project references, so you need

How to copy to the clipboard in F#?

≡放荡痞女 提交于 2020-07-18 10:32:22
问题 And more specifically, in FSI ? 回答1: You can programatically control the clipboard using the Clipboard class in the System.Windows.Forms namespace. (The required assembly is brought in by default to FSI.) open System.Windows.Forms Clipboard.SetText("Hello from FSI!") 来源: https://stackoverflow.com/questions/1791747/how-to-copy-to-the-clipboard-in-f

Create a list of custom type in F# and create two sequences of that list

我与影子孤独终老i 提交于 2020-05-09 17:19:32
问题 I have created my own type in F# called Accounts and I have then created objects for each account. type Account() = let AccountNumber = "" let mutable Balance:float = 0.0 Every account has two fields, AccountNumber (string) and Balance (float). I have then created an object for every account that holds the AccountName and the Balance. let acc1 = new Account() acc1.Insert("John",10.0) let acc2 = new Account() acc2.Insert("Mike",50.0) How do I create a list that holds each account (object)? I

Code coverage using dotCover throws an error - FAKE F#MAKE

血红的双手。 提交于 2020-01-25 21:26:28
问题 I am trying to use DotCover in FAKE , but it is throwing some error , as I am new to FAKE as well as F# , it's becoming difficult for me to understand the root cause of the problem . Here is the code : #r "D:/FAKEProject/Fake/packages/FAKE/tools/FakeLib.dll" open Fake open Fake.DotCover let testDir = "D:/FAKEProject/Fake/test/" let filters = "" Target "Clean" (fun _ -> CleanDirs [testDir] ) Target "TestCoverage" (fun _ -> !! ("D:/FAKEProject/Fake/UnitTest/UnitTest.dll") |> DotCoverNUnit (fun

Using COM DLLs with FSI

為{幸葍}努か 提交于 2020-01-16 08:16:14
问题 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 generated namespace(s). In a .fsx file, however, I can't seem to replicate this behaviour. I have tried using #r to reference the .dll directly, and I have tried using #I to point to the directory followed #r both with the library's "friendly" name and the file name, but nothing seems to work. Are you

Why am I getting F# error FS0039: The namespace or module 'Http' is not defined

与世无争的帅哥 提交于 2020-01-15 03:46:09
问题 In Visual Studio 2015 and 2017, I'm trying out the Http class from several F# examples in FSharp Interactive, and I keep getting: error FS0039: The namespace or module 'Http' is not defined Here's the sample: open FSharp.Data let response = Http.RequestString("http://api.themoviedb.org/3/search/movie", silentHttpErrors = true) This is clearly due to the version of FSharp.Data. Is there a way to specify the correct version for FSharp Interactive? What version of FSharp.Data contains the Http

Windows UI (UWP or 8.1) in F# interactive

梦想的初衷 提交于 2020-01-14 09:06:08
问题 By referencing the default WPF DLLs, it's pretty easy to do anything you could do using code-only WPF: #r "PresentationCore.dll" #r "PresentationFramework.dll" // ...other DLLs... #r "WindowsBase.dll" let window = System.Windows.Window() let panel = System.Windows.Controls.StackPanel() let button = System.Windows.Controls.Button() panel.Children.Add button button.Content <- "hi" window.Content <- panel window.Show() ... and you can manipulate it while the window is still open... button.Click

summing elements from a user defined datatype

旧巷老猫 提交于 2020-01-06 05:00:27
问题 Upon covering the predefined datatypes in f# (i.e lists) and how to sum elements of a list or a sequence, I'm trying to learn how I can work with user defined datatypes. Say I create a data type, call it list1: type list1 = A | B of int * list1 Where: A stands for an empty list B builds a new list by adding an int in front of another list so 1,2,3,4, will be represented with the list1 value: B(1, B(2, B(3, B(4, A)))) From the wikibook I learned that with a list I can sum the elements by doing