Multiple items type EntryPointAttribute = inherit Attribute new : unit -> EntryPointAttribute
Full name: Microsoft.FSharp.Core.EntryPointAttribute
-------------------- new : unit -> EntryPointAttribute
val main : argv:string [] -> int
Full name: index.main
val argv : string []
val printfn : format:Printf.TextWriterFormat<'T> -> 'T
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
type Console = static member BackgroundColor : ConsoleColor with get, set static member Beep : unit -> unit + 1 overload static member BufferHeight : int with get, set static member BufferWidth : int with get, set static member CapsLock : bool static member Clear : unit -> unit static member CursorLeft : int with get, set static member CursorSize : int with get, set static member CursorTop : int with get, set static member CursorVisible : bool with get, set ...
Full name: System.Console
Console.ReadLine() : string
val ignore : value:'T -> unit
Full name: Microsoft.FSharp.Core.Operators.ignore
Multiple items module Option
from Microsoft.FSharp.Core
-------------------- type Option<'a> = | Some of 'a | None
Full name: index.Option<_>
union case Option.Some: 'a -> Option<'a>
union case Option.None: Option<'a>
val validInt : Option<int>
Full name: index.validInt
val invalidInt : Option<'a>
Full name: index.invalidInt
val x : int
Introduction to F#
Grigoriy Belenkiy
Software developer, S&P Global Market Intelligence
// using namespaceopenSystem// entry point attribute for console app
[<EntryPoint>]
// main function// note: no args typeletmainargv=printfn"Hello World"// ignore function result// note: pipe operator - result from the// left is passed as the last parameter// to the next functionConsole.ReadLine() |>ignore// return value, i.e. exit code0
FizzBuzz
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
typeOption<'a>=// use a generic definition
| Someof'a// valid value
| NoneletvalidInt=Some1letinvalidInt=NonematchvalidIntwith
| Somex->printfn"the valid value is %A"x
| None->printfn"the value is None"
Metric mishap caused loss of NASA orbiter
(CNN) -- NASA lost a $125 million Mars orbiter because a Lockheed Martin engineering team used English [imperial] units of measurement while the agency's team used the more conventional metric system for a key spacecraft operation, according to a review finding released Thursday.