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
F#UNCTIONAL LONDONERS
• Founded Feb 2010
• 1100+ Members
• Meets every 2-4 weeks
• Topics include
– Machine Learning
– Finance
– Games
– Web
http://meetup.com/fsharplondon
VISUAL F#
THE F IN F# IS FOR FUN!
HALO 3 WITH F# SKILLS
XBLA: PATH TO GO – F# AI
F#
• Statically Typed
• Functional First
• Object Orientated
• Open Source
• .Net language
• In Visual Studio
& Xamarin Studio
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#
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/
ASK ME ANYTHING
F# IN INDUSTRYP 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
F# STARTUPS: JET.COM
$570M RAISED
ONIKIRA – DEMON KILLER:
AVAILABLE ON STEAM
F# ON FACEBOOK: MONOPOLY
F# ARCHITECTURE
VISIBLE FROM SPACE
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
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)
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
CODE GOLF: FIZZBUZZ
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; }
TYPE PROVIDERS: JSON
open FSharp.Data
type Person = JsonProvider<""" { "name":"Name", "age":64 } """>
let thomas = Person.Parse(""" { "name":"Thomas", "age":12 } """)
person.Age
SQL TYPE PROVIDER
SEAN (8) LIVE CODING AT NDC OSLO
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
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.
MOBILE WITH F#
• Xamarin Studio
– iOS
– Android
– Windows mobile
• JS
– Apache Cordova
– Appcelerator
– Sencha
– …
EXAMPLE APPS BUILT WITH F#
Learn on the Go | WP Pissed off Owls| iOS Pool | WebGL
MARIO TUTORIAL
FLAPPY BIRD WITH MONOGAME
http://tinyurl.com/funbasi
c
FUN BASIC - WINDOWS
STORE APP
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
•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
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 __
SERGEY TIHON’S F# WEEKLY
BUY THE BOOK
QUESTIONS?
• Twitter
– @ptrelford
• Blog
– http://trelford.com/blog

Mobile F#un

  • 1.
    MOBILE F#UN P HI 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 • FoundedFeb 2010 • 1100+ Members • Meets every 2-4 weeks • Topics include – Machine Learning – Finance – Games – Web http://meetup.com/fsharplondon
  • 3.
  • 4.
    THE F INF# IS FOR FUN!
  • 5.
    HALO 3 WITHF# SKILLS
  • 6.
    XBLA: PATH TOGO – F# AI
  • 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/
  • 10.
  • 11.
    F# IN INDUSTRYPH 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
  • 12.
  • 13.
    ONIKIRA – DEMONKILLER: AVAILABLE ON STEAM
  • 14.
  • 15.
  • 16.
    F# LANGUAGEP HI 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 WITHIF/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 WITHPATTERN MATCHING for i = 1 to 100 do match i%3, i%5 with | 0, 0 -> "FizzBuzz" | 0, _ -> "Fizz" | _, 0 -> "Buzz" | _, _ -> i.ToString() |> Console.WriteLine
  • 19.
  • 20.
    TYPES: LIGHT SYNTAX F# typePerson(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 openFSharp.Data type Person = JsonProvider<""" { "name":"Name", "age":64 } """> let thomas = Person.Parse(""" { "name":"Thomas", "age":12 } """) person.Age
  • 22.
  • 23.
    SEAN (8) LIVECODING AT NDC OSLO
  • 24.
    F# FOR APPSPH 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.2BILLION 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 BUILTWITH F# Learn on the Go | WP Pissed off Owls| iOS Pool | WebGL
  • 28.
  • 29.
  • 30.
  • 31.
    F# RESOURCESP HI 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 softwarestacks 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 //--------------------------------------------------------------- // AboutLet // // 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 __
  • 34.
  • 35.
  • 36.
    QUESTIONS? • Twitter – @ptrelford •Blog – http://trelford.com/blog

Editor's Notes

  • #4 MonoDevelop, Emacs & VIM
  • #10 http://fsharp.org/testimonials/#kaggle-1 Don’t throw out the baby with the bath water
  • #13 http://techgroup.jet.com/index.html https://www.crunchbase.com/organization/jet#/entity
  • #14 http://store.steampowered.com/app/310850/