简体   繁体   中英

Is there F# Interactive for Linux on .NET Core, without using Mono?

I'm able to build and run F# projects with .NET Core, but unable to use or see F# Interactive with it. Is it on the roadmap somewhere?

I'm using Linux Mint 18.3

dotnet core 3 preview 3 支持 F#interactive作为纯.NET Core应用程序:

dotnet fsi --readline

Yes there is, but it's hidden in a deep directory.

I have the following script in my $PATH, with name fsi , to find it and launch it:

#!/bin/sh

dotnet=/usr/bin/dotnet
fsi=/usr/share/dotnet/sdk/*/FSharp/fsi.exe

if ! [ -f $fsi ] 2>/dev/null; then
    echo ERROR Cannot find fsi.exe or more than one is present
    exit 2
fi

exec $dotnet $fsi "$@"

Result:

$ fsi

Microsoft (R) F# Interactive version 10.2.3 for F# 4.5
Copyright (c) Microsoft Corporation. All Rights Reserved.

For help type #help;;

> 1+1;;
val it : int = 2

> 

With this, you can uninstall Mono and the old fsharp package.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM