User Tools

Site Tools


projects:fsharp_workshop

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
projects:fsharp_workshop [2015/04/07 20:01] – [References] mkuciaprojects:fsharp_workshop [2015/04/17 23:03] mkucia
Line 1: Line 1:
 ====== F# workshop ====== ====== F# workshop ======
  
 +===== Prerequisites =====
 +    * https://www.linqpad.net/ or anything that can execute a REPL((Read, Evaluate, Print Loop))
 +<hidden ↘ alternatives>
 +    * Try F# in browser: http://www.tryfsharp.org/Create
 +    * Use Visual Studio https://www.visualstudio.com/
 +    * Get a full distribution: http://fsharp.org/use/windows/ OR http://fsharp.org/use/linux/
 +</hidden>
  
-  * f(x) Hello_Word +===== Agenda =====
-  * On Testing and +
  
-===== How to use? Where to get? ===== +  * hello(x) 
-Try F# in browser: +  * Type providers (strongly typed) 
-http://www.tryfsharp.org/Create+  * Matching 
 +  * Options
  
-Want to get a full distribution?  
-http://fsharp.org/ → Use F# 
  
-===== [Hello] =====+===== hello(x) =====
 <code fsharp> <code fsharp>
 let hello = printf "Hello World" let hello = printf "Hello World"
 +hello
 </code> </code>
  
-===== Why? =====+<code fsharp> 
 +let hello x printfn "Hello %s" x 
 +hello "world" 
 +</code>
  
 +<code fsharp>
 +let hello x = printfn "Hello %s" x
 +"World" |> hello
 +</code>
 +''|>'' is the pipeline operator
  
 +<code fsharp>
 +let square x = x * x
 +let subtract x y = x - y
 +</code>
  
 +<code fsharp>
 +let ``complicated stuff`` x =
 +    printfn "%d" (add 5 (square x))
 +</code>
 +
 +<code fsharp>
 +let ``another complicated stuff`` x =
 +    x |> square |> subtract 5 |> printfn "%d"
 +</code>
 +
 +<code fsharp>
 +let equation x =
 +
 + |> (fun y -> y * y ) 
 + |> (fun y z -> y - z ) 5
 + |> printfn "%d"
 +</code>
 +
 +===== Why? =====
  
 <WRAP group> <WRAP group>
Line 30: Line 67:
   * Lazy evaluation   * Lazy evaluation
   * Reusable   * Reusable
-  * Reduced code+  * Reduced code (See [[http://theburningmonk.com/2014/12/seven-ineffective-coding-habits-many-f-programmers-dont-have/|signal-to-noise ratio]])
   * Strongly typed   * Strongly typed
 </WRAP> </WRAP>
Line 37: Line 74:
 Cons: Cons:
   * Not suitable for real time (unpredictable performance)   * Not suitable for real time (unpredictable performance)
 +  * Functional languages fundamentally don't model how your computer works ⇒ harder to optimize.
   * Different thinking process (you need to re-learn)   * Different thinking process (you need to re-learn)
 </WRAP> </WRAP>
 </WRAP> </WRAP>
- 
-<hidden ↘ C# equivalent>Since you want to know more, here is an explanation with more details […]</hidden> 
- 
-===== Pitfalls and drawbacks ===== 
-Functional languages fundamentally don't model how your computer works. 
-Harder to optimize. 
  
 ===== References ===== ===== References =====
Line 58: Line 90:
   * http://fsharpforfunandprofit.com/site-contents/   * http://fsharpforfunandprofit.com/site-contents/
   * http://research.microsoft.com/en-us/projects/kiwi/   * http://research.microsoft.com/en-us/projects/kiwi/
 +  * [[https://www.youtube.com/watch?v=hMjv8m--W28|Ten things F# can do, and C# can't - Liam McLennan @ DDD Brisbane 2013]]
projects/fsharp_workshop.txt · Last modified: 2015/05/02 12:45 by mkucia