Why Hymans Use F#

1,274 views

Published on

Talk given at http://techmeetup.co.uk/ on 25th of September 2013.

Contact me at:
@KeithDHar
keithharrisonuk@yahoo.co.uk
http://www.linkedin.com/in/keithdharrison

We're hiring F# developers:
http://careers.stackoverflow.com/uk/company/hymans-robertson

Published in: Technology, Education
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,274
On SlideShare
0
From Embeds
0
Number of Embeds
130
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • I’m keithharrisonI’m a .Net Developer at Hymans RobertsonHere to talk about why Hymans use F#
  • Start with a bit of back groundWho are Hymans?Actuarial Consultancy FirmModel risk using complex mathematical modelsFor example in a pension scheme calculate how much money you need today to pay each member till the last one dies. Mortality, pay rises, how long each member stay with the company
  • Problem?Port legacy excel application to .NetInteroperation with other systemsUnit Testing
  • What problem does F# solve with F#?Familiar to someone with a maths backgroundLeverage maths skills
  • Compose maths formulas to solve different problemsCalculation such as mortality, discounting cashflows are used to solve lots of different problems.
  • How is F# familiar to people with a strong maths background?
  • C# code.You need to understand, classes, access modifiers, scope, constructors, object initialisers
  • Same solution in F#Explain F# syntax‘let’ names a value or a functionStrongly typed, Types are inferredClosure
  • Explaincomposibility
  • What if we wanted to filter people over 40?
  • Add age variableWhat if we wanted to filter Men?
  • Same as previous functions except if statement
  • Same as previous functions except if statement
  • Multi - paradigm
  • ConclusionPorted legacy system to F#Quickly train up actuaries to expand the teamReuse the math functionsPragmatic convert imperative to F# -> function and use power of .Net framework
  • Why Hymans Use F#

    1. 1. Keith Harrison Why Hymans Use F#
    2. 2. Risk ModellingActuarial Consultancy
    3. 3. Pragmatic
    4. 4. public class Multiplier { public int Factor; public int Calculate(int value) { return value * Factor; } } var tenMultiplier = new Multiplier { Factor = 10 }; var result = tenMultiplier.Calculate(2);
    5. 5. let createMultiplier (factor) = fun x -> x * factor let multiplyByTen = createMultiplier(10) let result = multiplyByTen(2)
    6. 6. let filter people = let results = new List<Person>() for person in people do if person.Age > 30 then results.Add(person) results
    7. 7. let filter people age = let results = new List<Person>() for person in people do if person.Age > age then results.Add(person) results
    8. 8. let filter people = let results = new List<Person>() for person in people do if person.Sex = Sex.Male then results.Add(person) results
    9. 9. let filter filterFunction people = let results = new List<Person>() for person in people do if filterFunction() then results.Add(person) results
    10. 10. let filter filterFunction people = let results = new List<Person>() for person in people do if filterFunction() then results.Add(person) results filter (fun p -> p.Age > 30) personList filter (fun p -> p.Age > 40) personList filter (fun p -> p.Sex = Sex.Male) personList
    11. 11. let isOver30 p = p.Age > 30 let isOver40 p = p.Age > 40 let isMale p = p.Sex = Sex.Male filter isOver30 personList filter isOver40 personList filter isMale personList
    12. 12. filter isOver30 personList personList |> filter isOver30
    13. 13. personList |> filter isOver30 |> filter isMale
    14. 14. Pragmatic
    15. 15. F# Functional Imperative Object Oriented
    16. 16. Books
    17. 17. We’re Hiring • www.hymans.co.uk/contact-us.aspx • http://careers.stackoverflow.com/uk/company/hymans-robertson • keith.Harrison@hymans.co.uk • @KeithDHar • http://www.linkedin.com/in/keithdharrison
    18. 18. Questions?

    ×