Skip to content

CSharp Loader F# Support: hello sample #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions source/scripts/fsharp/hello/Hello.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
namespace Scripts

type IJump =
abstract member Jump : unit -> int

type SuperJump() =
interface IJump with
member __.Jump () = 2

type TinyJump() =
interface IJump with
member __.Jump () = 1

type JumpMaster() =
static member SuperJump () : int =
let sj = SuperJump() :> IJump
sj.Jump ()

static member TinyJump () =
let sj = TinyJump() :> IJump
sj.Jump ()

type Program() =
static member SayHello () = printfn "%s" "HELLO"
static member Say text = printfn "%s" text
static member Sum a b = a + b
static member Concat (a:string) (b:string) = a + b
12 changes: 12 additions & 0 deletions source/scripts/fsharp/hello/HelloFSharp.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netcoreapp1.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Hello.fs" />
</ItemGroup>

</Project>