call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
Mobile F#un
1. MOBILE F#UN
P H I L L I P T R E L F O R D ( A K A S E A N ’ S D A D )
W I N D O W S A P P S L O N D O N
2 0 1 6
2. F#UNCTIONAL LONDONERS
• Founded Feb 2010
• 1100+ Members
• Meets every 2-4 weeks
• Topics include
– Machine Learning
– Finance
– Games
– Web
http://meetup.com/fsharplondon
7. F#
• Statically Typed
• Functional First
• Object Orientated
• Open Source
• .Net language
• In Visual Studio
& Xamarin Studio
8. F# INFLUENCES
// OCaml + Python like light syntax
let dist (x1,y1) (x2,y2) =
let x = x1 - x2 in
let y = y2 - y1 in
sqrt (x * x + y * y)
// & C# dot-driven development
let trim (s:string) =
s.Trim() F#
OCaml
Python
C#
9. C# + F# = BEST FRIENDS
Kaggle Testimonial
“we have a large existing code
base in C#,
…getting started with F# was an
easy decision.”
“The F# code is consistently
shorter, easier to read, easier to
refactor and contains far fewer
bugs.
…we’ve become more
productive.”
Source: http://fsharp.org/testimonials/
16. F# LANGUAGEP H I L T R E L F O R D , @ P T R E L F O R D
W I N D O W S A P P L O N D O N , 2 0 1 6
17. CODE: FIZZBUZZ WITH IF/THEN/ELSE
for i = 1 to 100 do
let text =
if i % 3 = 0 && i % 5 = 0 then "FizzBuzz"
elif i % 3 = 0 then "Fizz"
elif i % 5 = 0 then "Buzz"
else i.ToString()
Console.WriteLine(text)
18. CODE: FIZZBUZZ WITH PATTERN
MATCHING
for i = 1 to 100 do
match i%3, i%5 with
| 0, 0 -> "FizzBuzz"
| 0, _ -> "Fizz"
| _, 0 -> "Buzz"
| _, _ -> i.ToString()
|> Console.WriteLine
20. TYPES: LIGHT SYNTAX
F#
type Person(name:string,age:int) =
/// Full name
member person.Name = name
/// Age in years
member person.Age = age
C#
public class Person
{
public Person(string name, int age)
{
_name = name;
_age = age;
}
private readonly string _name;
private readonly int _age;
/// <summary>
/// Full name
/// </summary>
public string Name
{
get { return _name; }
21. TYPE PROVIDERS: JSON
open FSharp.Data
type Person = JsonProvider<""" { "name":"Name", "age":64 } """>
let thomas = Person.Parse(""" { "name":"Thomas", "age":12 } """)
person.Age
24. F# FOR APPSP H I L T R E L F O R D , @ P T R E L F O R D
W I N D O W S A P P L O N D O N , 2 0 1 6
25. TARGET OVER 2.2 BILLION DEVICES
NATIVELY WITH F#
NATIVELY VIA .NET & MONO
• Android
• iOS
• Linux
• Mac
• Windows
• Raspberry Pi
• etc.
AND DON’T FORGET VIA WEB
Everything else with
• Fable
• Freya
• FunScript
• Suave
• WebSharper
• etc.
26. MOBILE WITH F#
• Xamarin Studio
– iOS
– Android
– Windows mobile
• JS
– Apache Cordova
– Appcelerator
– Sencha
– …
27. EXAMPLE APPS BUILT WITH F#
Learn on the Go | WP Pissed off Owls| iOS Pool | WebGL
31. F# RESOURCESP H I L T R E L F O R D , @ P T R E L F O R D
W I N D O W S A P P L O N D O N , 2 0 1 6
32. •F# Software Foundation
http://www.fsharp.org
software stacks
trainings teaching F# user groups snippets
mac and linux cross-platform books and tutorials
F# community open-source MonoDevelop
contributions research support
consultancy mailing list
33. F# KOANS
//---------------------------------------------------------------
// About Let
//
// The let keyword is one of the most fundamental parts of F#.
// You'll use it in almost every line of F# code you write, so
// let's get to know it well! (no pun intended)
//---------------------------------------------------------------
[<Koan(Sort = 2)>]
module ``about let`` =
[<Koan>]
let LetBindsANameToAValue() =
let x = 50
AssertEquality x __