-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunwithfsharp.html
612 lines (586 loc) · 59.2 KB
/
funwithfsharp.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Fun with F# while building my first OSS F# application</title>
<meta name="description" content="Fun with F# while building my first OSS F# application">
<meta name="author" content="koenmetsu">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<script src="//code.jquery.com/jquery-1.8.0.js"></script>
<script src="//code.jquery.com/ui/1.8.23/jquery-ui.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/moon.css" id="theme">
<link type="text/css" rel="stylesheet" href="fsharp.formatting/styles/style.css" />
<link type="text/css" rel="stylesheet" href="fsharp.formatting/styles/deedle.css" />
<link type="text/css" rel="stylesheet" href="css/custom.css" />
<script src="fsharp.formatting/styles/tips.js" type="text/javascript"></script>
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<link rel="stylesheet" href="css/fsreveal.css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
<!--[if lt IE 9]>
<script src="lib/js/html5shiv.js"></script>
<![endif]-->
<script language="javascript" type="text/javascript">
function init()
{
websocket = new WebSocket("ws://"+window.location.host+"/websocket");
websocket.onmessage = function(evt) { location.reload(); };
}
window.addEventListener("load", init, false);
</script>
</head>
<body>
<div class="reveal">
<div class="tip" id="fs1">namespace System</div>
<div class="tip" id="fs2">type Result<'success,'failure> =<br />  | Success of 'success<br />  | Failure of 'failure<br /><br />Full name: Funwithfsharp.Result<_,_></div>
<div class="tip" id="fs3">union case Result.Success: 'success -> Result<'success,'failure></div>
<div class="tip" id="fs4">Multiple items<br />union case Result.Failure: 'failure -> Result<'success,'failure><br /><br />--------------------<br />active recognizer Failure: exn -> string option<br /><br />Full name: Microsoft.FSharp.Core.Operators.( |Failure|_| )</div>
<div class="tip" id="fs5">namespace Microsoft.FSharp</div>
<div class="tip" id="fs6">namespace Microsoft.FSharp.Data</div>
<div class="tip" id="fs7">type DirectoryPath = string<br /><br />Full name: Funwithfsharp.DirectoryPath</div>
<div class="tip" id="fs8">Multiple items<br />val string : value:'T -> string<br /><br />Full name: Microsoft.FSharp.Core.Operators.string<br /><br />--------------------<br />type string = String<br /><br />Full name: Microsoft.FSharp.Core.string</div>
<div class="tip" id="fs9">type FilePath = string<br /><br />Full name: Funwithfsharp.FilePath</div>
<div class="tip" id="fs10">type TimeTaken = DateTimeOffset<br /><br />Full name: Funwithfsharp.TimeTaken</div>
<div class="tip" id="fs11">Multiple items<br />type DateTimeOffset =<br />  struct<br />    new : dateTime:DateTime -> DateTimeOffset + 5 overloads<br />    member Add : timeSpan:TimeSpan -> DateTimeOffset<br />    member AddDays : days:float -> DateTimeOffset<br />    member AddHours : hours:float -> DateTimeOffset<br />    member AddMilliseconds : milliseconds:float -> DateTimeOffset<br />    member AddMinutes : minutes:float -> DateTimeOffset<br />    member AddMonths : months:int -> DateTimeOffset<br />    member AddSeconds : seconds:float -> DateTimeOffset<br />    member AddTicks : ticks:int64 -> DateTimeOffset<br />    member AddYears : years:int -> DateTimeOffset<br />    ...<br />  end<br /><br />Full name: System.DateTimeOffset<br /><br />--------------------<br />DateTimeOffset()<br />DateTimeOffset(dateTime: DateTime) : unit<br />DateTimeOffset(ticks: int64, offset: TimeSpan) : unit<br />DateTimeOffset(dateTime: DateTime, offset: TimeSpan) : unit<br />DateTimeOffset(year: int, month: int, day: int, hour: int, minute: int, second: int, offset: TimeSpan) : unit<br />DateTimeOffset(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, offset: TimeSpan) : unit<br />DateTimeOffset(year: int, month: int, day: int, hour: int, minute: int, second: int, millisecond: int, calendar: Globalization.Calendar, offset: TimeSpan) : unit</div>
<div class="tip" id="fs12">type MoveRequest =<br />  {Source: FilePath;<br />   Destination: FilePath;}<br /><br />Full name: Funwithfsharp.MoveRequest</div>
<div class="tip" id="fs13">MoveRequest.Source: FilePath</div>
<div class="tip" id="fs14">MoveRequest.Destination: FilePath</div>
<div class="tip" id="fs15">type FailedMove =<br />  {Request: MoveRequest;<br />   Message: string;}<br /><br />Full name: Funwithfsharp.FailedMove</div>
<div class="tip" id="fs16">FailedMove.Request: MoveRequest</div>
<div class="tip" id="fs17">FailedMove.Message: string</div>
<div class="tip" id="fs18">type File =<br />  {FullPath: FilePath;<br />   Name: string;}<br /><br />Full name: Funwithfsharp.File</div>
<div class="tip" id="fs19">File.FullPath: FilePath</div>
<div class="tip" id="fs20">File.Name: string</div>
<div class="tip" id="fs21">type Picture =<br />  {File: File;<br />   TakenOn: TimeTaken;}<br />  member formatTakenOn : string<br /><br />Full name: Funwithfsharp.Picture</div>
<div class="tip" id="fs22">Multiple items<br />Picture.File: File<br /><br />--------------------<br />type File =<br />  {FullPath: FilePath;<br />   Name: string;}<br /><br />Full name: Funwithfsharp.File</div>
<div class="tip" id="fs23">Picture.TakenOn: TimeTaken</div>
<div class="tip" id="fs24">val this : Picture</div>
<div class="tip" id="fs25">member Picture.formatTakenOn : string<br /><br />Full name: Funwithfsharp.Picture.formatTakenOn</div>
<div class="tip" id="fs26">val sprintf : format:Printf.StringFormat<'T> -> 'T<br /><br />Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.sprintf</div>
<div class="tip" id="fs27">property DateTimeOffset.Year: int</div>
<div class="tip" id="fs28">property DateTimeOffset.Month: int</div>
<div class="tip" id="fs29">Multiple items<br />union case Result.Failure: 'failure -> Result<'success,'failure><br /><br />--------------------<br />type Failure =<br />  | BytesDidNotMatch of MoveRequest<br />  | CouldNotCopyFile of FailedMove<br />  | CouldNotDeleteSource of FailedMove<br />  | OhDearGodItAllBlewUp<br /><br />Full name: Funwithfsharp.Failure</div>
<div class="tip" id="fs30">union case Failure.BytesDidNotMatch: MoveRequest -> Failure</div>
<div class="tip" id="fs31">union case Failure.CouldNotCopyFile: FailedMove -> Failure</div>
<div class="tip" id="fs32">union case Failure.CouldNotDeleteSource: FailedMove -> Failure</div>
<div class="tip" id="fs33">union case Failure.OhDearGodItAllBlewUp: Failure</div>
<div class="tip" id="fs34">val formatFailure : failure:Failure -> string<br /><br />Full name: Funwithfsharp.formatFailure</div>
<div class="tip" id="fs35">val failure : Failure</div>
<div class="tip" id="fs36">val request : MoveRequest</div>
<div class="tip" id="fs37">val move : FailedMove</div>
<div class="tip" id="fs38">val report : numberOfSuccesses:int -> author:string -> string<br /><br />Full name: Funwithfsharp.report</div>
<div class="tip" id="fs39">val numberOfSuccesses : int</div>
<div class="tip" id="fs40">val author : string</div>
<div class="tip" id="fs41">val reported : string<br /><br />Full name: Funwithfsharp.reported</div>
<div class="tip" id="fs42">val mapSomeOrNone : f:('a -> 'b) -> things:'a list -> seq<'b> option<br /><br />Full name: Funwithfsharp.mapSomeOrNone</div>
<div class="tip" id="fs43">val f : ('a -> 'b)</div>
<div class="tip" id="fs44">val things : 'a list</div>
<div class="tip" id="fs45">val x : 'a</div>
<div class="tip" id="fs46">val xs : 'a list</div>
<div class="tip" id="fs47">module Seq<br /><br />from Microsoft.FSharp.Collections</div>
<div class="tip" id="fs48">val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U><br /><br />Full name: Microsoft.FSharp.Collections.Seq.map</div>
<div class="tip" id="fs49">union case Option.Some: Value: 'T -> Option<'T></div>
<div class="tip" id="fs50">union case Option.None: Option<'T></div>
<div class="tip" id="fs51">val mapped : seq<int> option<br /><br />Full name: Funwithfsharp.mapped</div>
<div class="tip" id="fs52">val x : int</div>
<div class="tip" id="fs53">val notMapped : seq<int> option<br /><br />Full name: Funwithfsharp.notMapped</div>
<div class="tip" id="fs54">Multiple items<br />module List<br /><br />from Microsoft.FSharp.Collections<br /><br />--------------------<br />type List<'T> =<br />  | ( [] )<br />  | ( :: ) of Head: 'T * Tail: 'T list<br />  interface IEnumerable<br />  interface IEnumerable<'T><br />  member GetSlice : startIndex:int option * endIndex:int option -> 'T list<br />  member Head : 'T<br />  member IsEmpty : bool<br />  member Item : index:int -> 'T with get<br />  member Length : int<br />  member Tail : 'T list<br />  static member Cons : head:'T * tail:'T list -> 'T list<br />  static member Empty : 'T list<br /><br />Full name: Microsoft.FSharp.Collections.List<_></div>
<div class="tip" id="fs55">val choose : chooser:('T -> 'U option) -> list:'T list -> 'U list<br /><br />Full name: Microsoft.FSharp.Collections.List.choose</div>
<div class="tip" id="fs56">type Tags = obj<br /><br />Full name: Funwithfsharp.Tags</div>
<div class="tip" id="fs57">val tags : seq<obj><br /><br />Full name: Funwithfsharp.tags</div>
<div class="tip" id="fs58">val picture : obj<br /><br />Full name: Funwithfsharp.picture</div>
<div class="tip" id="fs59">val find : predicate:('T -> bool) -> source:seq<'T> -> 'T<br /><br />Full name: Microsoft.FSharp.Collections.Seq.find</div>
<div class="tip" id="fs60">val pic : obj</div>
<div class="tip" id="fs61">val aperture : obj<br /><br />Full name: Funwithfsharp.aperture</div>
<div class="tip" id="fs62">namespace System.Diagnostics</div>
<div class="tip" id="fs63">val processStartInfo : ProcessStartInfo<br /><br />Full name: Funwithfsharp.processStartInfo</div>
<div class="tip" id="fs64">Multiple items<br />type ProcessStartInfo =<br />  new : unit -> ProcessStartInfo + 2 overloads<br />  member Arguments : string with get, set<br />  member CreateNoWindow : bool with get, set<br />  member Domain : string with get, set<br />  member EnvironmentVariables : StringDictionary<br />  member ErrorDialog : bool with get, set<br />  member ErrorDialogParentHandle : nativeint with get, set<br />  member FileName : string with get, set<br />  member LoadUserProfile : bool with get, set<br />  member Password : SecureString with get, set<br />  ...<br /><br />Full name: System.Diagnostics.ProcessStartInfo<br /><br />--------------------<br />ProcessStartInfo() : unit<br />ProcessStartInfo(fileName: string) : unit<br />ProcessStartInfo(fileName: string, arguments: string) : unit</div>
<div class="tip" id="fs65">property ProcessStartInfo.FileName: string</div>
<div class="tip" id="fs66">property ProcessStartInfo.Arguments: string</div>
<div class="tip" id="fs67">Multiple items<br />type Process =<br />  inherit Component<br />  new : unit -> Process<br />  member BasePriority : int<br />  member BeginErrorReadLine : unit -> unit<br />  member BeginOutputReadLine : unit -> unit<br />  member CancelErrorRead : unit -> unit<br />  member CancelOutputRead : unit -> unit<br />  member Close : unit -> unit<br />  member CloseMainWindow : unit -> bool<br />  member EnableRaisingEvents : bool with get, set<br />  member ExitCode : int<br />  ...<br /><br />Full name: System.Diagnostics.Process<br /><br />--------------------<br />Process() : unit</div>
<div class="tip" id="fs68">Process.Start(startInfo: ProcessStartInfo) : Process<br />Process.Start(fileName: string) : Process<br />Process.Start(fileName: string, arguments: string) : Process<br />Process.Start(fileName: string, userName: string, password: Security.SecureString, domain: string) : Process<br />Process.Start(fileName: string, arguments: string, userName: string, password: Security.SecureString, domain: string) : Process</div>
<div class="tip" id="fs69">val runAsync : move:('a -> 'b) -> ('a list -> 'b list)<br /><br />Full name: Funwithfsharp.runAsync</div>
<div class="tip" id="fs70">val move : ('a -> 'b)</div>
<div class="tip" id="fs71">val asyncMove : ('a -> Async<'b>)</div>
<div class="tip" id="fs72">val request : 'a</div>
<div class="tip" id="fs73">val async : AsyncBuilder<br /><br />Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.async</div>
<div class="tip" id="fs74">val map : mapping:('T -> 'U) -> list:'T list -> 'U list<br /><br />Full name: Microsoft.FSharp.Collections.List.map</div>
<div class="tip" id="fs75">Multiple items<br />type Async<br />static member AsBeginEnd : computation:('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit)<br />static member AwaitEvent : event:IEvent<'Del,'T> * ?cancelAction:(unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate)<br />static member AwaitIAsyncResult : iar:IAsyncResult * ?millisecondsTimeout:int -> Async<bool><br />static member AwaitTask : task:Task -> Async<unit><br />static member AwaitTask : task:Task<'T> -> Async<'T><br />static member AwaitWaitHandle : waitHandle:WaitHandle * ?millisecondsTimeout:int -> Async<bool><br />static member CancelDefaultToken : unit -> unit<br />static member Catch : computation:Async<'T> -> Async<Choice<'T,exn>><br />static member FromBeginEnd : beginAction:(AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T><br />static member FromBeginEnd : arg:'Arg1 * beginAction:('Arg1 * AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T><br />static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * beginAction:('Arg1 * 'Arg2 * AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T><br />static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * arg3:'Arg3 * beginAction:('Arg1 * 'Arg2 * 'Arg3 * AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T><br />static member FromContinuations : callback:(('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T><br />static member Ignore : computation:Async<'T> -> Async<unit><br />static member OnCancel : interruption:(unit -> unit) -> Async<IDisposable><br />static member Parallel : computations:seq<Async<'T>> -> Async<'T []><br />static member RunSynchronously : computation:Async<'T> * ?timeout:int * ?cancellationToken:CancellationToken -> 'T<br />static member Sleep : millisecondsDueTime:int -> Async<unit><br />static member Start : computation:Async<unit> * ?cancellationToken:CancellationToken -> unit<br />static member StartAsTask : computation:Async<'T> * ?taskCreationOptions:TaskCreationOptions * ?cancellationToken:CancellationToken -> Task<'T><br />static member StartChild : computation:Async<'T> * ?millisecondsTimeout:int -> Async<Async<'T>><br />static member StartChildAsTask : computation:Async<'T> * ?taskCreationOptions:TaskCreationOptions -> Async<Task<'T>><br />static member StartImmediate : computation:Async<unit> * ?cancellationToken:CancellationToken -> unit<br />static member StartWithContinuations : computation:Async<'T> * continuation:('T -> unit) * exceptionContinuation:(exn -> unit) * cancellationContinuation:(OperationCanceledException -> unit) * ?cancellationToken:CancellationToken -> unit<br />static member SwitchToContext : syncContext:SynchronizationContext -> Async<unit><br />static member SwitchToNewThread : unit -> Async<unit><br />static member SwitchToThreadPool : unit -> Async<unit><br />static member TryCancelled : computation:Async<'T> * compensation:(OperationCanceledException -> unit) -> Async<'T><br />static member CancellationToken : Async<CancellationToken><br />static member DefaultCancellationToken : CancellationToken<br /><br />Full name: Microsoft.FSharp.Control.Async<br /><br />--------------------<br />type Async<'T><br /><br />Full name: Microsoft.FSharp.Control.Async<_></div>
<div class="tip" id="fs76">static member Async.Parallel : computations:seq<Async<'T>> -> Async<'T []></div>
<div class="tip" id="fs77">static member Async.RunSynchronously : computation:Async<'T> * ?timeout:int * ?cancellationToken:Threading.CancellationToken -> 'T</div>
<div class="tip" id="fs78">val ofArray : array:'T [] -> 'T list<br /><br />Full name: Microsoft.FSharp.Collections.List.ofArray</div>
<div class="tip" id="fs79">val compareFiles : compare:(string -> string -> bool) -> x:string -> y:string -> string<br /><br />Full name: Funwithfsharp.compareFiles</div>
<div class="tip" id="fs80">val compare : (string -> string -> bool)</div>
<div class="tip" id="fs81">val x : string</div>
<div class="tip" id="fs82">val y : string</div>
<div class="tip" id="fs83">val badStrategy : x:'a -> y:'a -> bool (requires equality)<br /><br />Full name: Funwithfsharp.badStrategy</div>
<div class="tip" id="fs84">val x : 'a (requires equality)</div>
<div class="tip" id="fs85">val y : 'a (requires equality)</div>
<div class="tip" id="fs86">val areEqual : string<br /><br />Full name: Funwithfsharp.areEqual</div>
<div class="tip" id="fs87">val ( Verify Awww... when things don't match up ) : unit -> 'a<br /><br />Full name: Funwithfsharp.( Verify Awww... when things don't match up )</div>
<div class="tip" id="fs88">val stubComparer : ('b -> 'c -> bool)</div>
<div class="tip" id="fs89">val x : 'b</div>
<div class="tip" id="fs90">val y : 'c</div>
<div class="tip" id="fs91">val comparison : string</div>
<div class="tip" id="fs92">val isOlderThanXMonths : currentTime:DateTimeOffset -> months:int -> date:DateTimeOffset -> bool<br /><br />Full name: Funwithfsharp.isOlderThanXMonths</div>
<div class="tip" id="fs93">val currentTime : DateTimeOffset</div>
<div class="tip" id="fs94">val months : int</div>
<div class="tip" id="fs95">val date : DateTimeOffset</div>
<div class="tip" id="fs96">DateTimeOffset.AddMonths(months: int) : DateTimeOffset</div>
<div class="tip" id="fs97">val now : DateTimeOffset<br /><br />Full name: Funwithfsharp.now</div>
<div class="tip" id="fs98">property DateTimeOffset.UtcNow: DateTimeOffset</div>
<div class="tip" id="fs99">val isOlderThan1Month : (DateTimeOffset -> bool)<br /><br />Full name: Funwithfsharp.isOlderThan1Month</div>
<div class="tip" id="fs100">val firstOldDate : DateTimeOffset<br /><br />Full name: Funwithfsharp.firstOldDate</div>
<div class="tip" id="fs101">val i : float</div>
<div class="tip" id="fs102">DateTimeOffset.AddDays(days: float) : DateTimeOffset</div>
<!-- Any section element inside of this container is displayed as a slide -->
<div class="slides">
<section >
<h2>Some cool stuff I liked in F# while building a pet project in my spare time</h2>
<h4>Koen Metsu</h4>
</section>
<section >
<h2>What's my pet project about?</h2>
<ul>
<li>Image archiver</li>
<li>Uses ExifTool (perl) to extract EXIF|XMP|... data</li>
<li>Archives based on date taken</li>
</ul>
<p><a href="https://koenmetsu.github.io/Muffin.Pictures.Archiver/">Muffin.Pictures.Archiver on GitHub</a></p>
</section>
<section >
<h2>What's F# about?</h2>
<ul>
<li>Functional-first language</li>
<li>Open source</li>
<li>Cross-platform</li>
</ul>
</section>
<section >
<h2>What's F# about?</h2>
<ul>
<li>.NET Interoperability</li>
<li>Immutable by default</li>
<li>Strong type-system</li>
<li>Concise yet robust</li>
<li>Awesome community</li>
</ul>
</section>
<section >
<h1>Now for the cool stuff</h1>
<p>(that I actually used in my application)</p>
</section>
<section >
<section >
<h2>Easy to create wrapper types</h2>
<p>Let's say you want a wrapper around a string in C#</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
<span class="l">11: </span>
<span class="l">12: </span>
<span class="l">13: </span>
<span class="l">14: </span>
<span class="l">15: </span>
<span class="l">16: </span>
<span class="l">17: </span>
<span class="l">18: </span>
<span class="l">19: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="csharp"><span class="k">public</span> <span class="k">class</span> DirectoryPath
{
<span class="k">private</span> <span class="k">readonly</span> <span class="k">string</span> _path;
<span class="k">public</span> DirectoryPath(<span class="k">string</span> path)
{
_path <span class="o">=</span> path;
}
<span class="k">public</span> <span class="k">string</span> Path
{
get { <span class="k">return</span> _path; }
}
<span class="k">public</span> <span class="k">static</span> <span class="k">implicit</span> <span class="k">operator</span> <span class="k">string</span>(DirectoryPath directoryPath)
{
<span class="k">return</span> directoryPath.Path;
}
}
</code></pre></td></tr></table>
</section>
<section >
<h2>Easy to create wrapper types</h2>
<p>Let's say you want a wrapper around a string in F#</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span onmouseout="hideTip(event, 'fs7', 7)" onmouseover="showTip(event, 'fs7', 7)" class="t">DirectoryPath</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs8', 8)" onmouseover="showTip(event, 'fs8', 8)" class="t">string</span>
<span class="k">type</span> <span onmouseout="hideTip(event, 'fs9', 9)" onmouseover="showTip(event, 'fs9', 9)" class="t">FilePath</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs8', 10)" onmouseover="showTip(event, 'fs8', 10)" class="t">string</span>
<span class="k">type</span> <span onmouseout="hideTip(event, 'fs10', 11)" onmouseover="showTip(event, 'fs10', 11)" class="t">TimeTaken</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs11', 12)" onmouseover="showTip(event, 'fs11', 12)" class="t">DateTimeOffset</span>
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Easy to create data types</h2>
<p>(your plain old POCO)</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span onmouseout="hideTip(event, 'fs12', 13)" onmouseover="showTip(event, 'fs12', 13)" class="t">MoveRequest</span> <span class="o">=</span> { <span onmouseout="hideTip(event, 'fs13', 14)" onmouseover="showTip(event, 'fs13', 14)" class="i">Source</span> <span class="o">:</span> <span onmouseout="hideTip(event, 'fs9', 15)" onmouseover="showTip(event, 'fs9', 15)" class="t">FilePath</span>;
<span onmouseout="hideTip(event, 'fs14', 16)" onmouseover="showTip(event, 'fs14', 16)" class="i">Destination</span> <span class="o">:</span> <span onmouseout="hideTip(event, 'fs9', 17)" onmouseover="showTip(event, 'fs9', 17)" class="t">FilePath</span> }
<span class="k">type</span> <span onmouseout="hideTip(event, 'fs15', 18)" onmouseover="showTip(event, 'fs15', 18)" class="t">FailedMove</span> <span class="o">=</span> { <span onmouseout="hideTip(event, 'fs16', 19)" onmouseover="showTip(event, 'fs16', 19)" class="i">Request</span> <span class="o">:</span> <span onmouseout="hideTip(event, 'fs12', 20)" onmouseover="showTip(event, 'fs12', 20)" class="t">MoveRequest</span>;
<span onmouseout="hideTip(event, 'fs17', 21)" onmouseover="showTip(event, 'fs17', 21)" class="i">Message</span> <span class="o">:</span> <span onmouseout="hideTip(event, 'fs8', 22)" onmouseover="showTip(event, 'fs8', 22)" class="t">string</span> }
<span class="k">type</span> <span onmouseout="hideTip(event, 'fs18', 23)" onmouseover="showTip(event, 'fs18', 23)" class="t">File</span> <span class="o">=</span> { <span onmouseout="hideTip(event, 'fs19', 24)" onmouseover="showTip(event, 'fs19', 24)" class="i">FullPath</span><span class="o">:</span><span onmouseout="hideTip(event, 'fs9', 25)" onmouseover="showTip(event, 'fs9', 25)" class="t">FilePath</span>;
<span onmouseout="hideTip(event, 'fs20', 26)" onmouseover="showTip(event, 'fs20', 26)" class="i">Name</span><span class="o">:</span><span onmouseout="hideTip(event, 'fs8', 27)" onmouseover="showTip(event, 'fs8', 27)" class="t">string</span> }
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Easy to extend types</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span onmouseout="hideTip(event, 'fs21', 28)" onmouseover="showTip(event, 'fs21', 28)" class="t">Picture</span> <span class="o">=</span> { <span onmouseout="hideTip(event, 'fs22', 29)" onmouseover="showTip(event, 'fs22', 29)" class="i">File</span><span class="o">:</span><span onmouseout="hideTip(event, 'fs22', 30)" onmouseover="showTip(event, 'fs22', 30)" class="t">File</span>;
<span onmouseout="hideTip(event, 'fs23', 31)" onmouseover="showTip(event, 'fs23', 31)" class="i">TakenOn</span><span class="o">:</span><span onmouseout="hideTip(event, 'fs10', 32)" onmouseover="showTip(event, 'fs10', 32)" class="t">TimeTaken</span> } <span class="k">with</span>
<span class="k">member</span> <span onmouseout="hideTip(event, 'fs24', 33)" onmouseover="showTip(event, 'fs24', 33)" class="i">this</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs25', 34)" onmouseover="showTip(event, 'fs25', 34)" class="i">formatTakenOn</span> <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs26', 35)" onmouseover="showTip(event, 'fs26', 35)" class="f">sprintf</span> <span class="s">"</span><span class="pf">%i</span><span class="s">-</span><span class="pf">%02i</span><span class="s">"</span>
<span onmouseout="hideTip(event, 'fs24', 36)" onmouseover="showTip(event, 'fs24', 36)" class="i">this</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs23', 37)" onmouseover="showTip(event, 'fs23', 37)" class="i">TakenOn</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs27', 38)" onmouseover="showTip(event, 'fs27', 38)" class="i">Year</span>
<span onmouseout="hideTip(event, 'fs24', 39)" onmouseover="showTip(event, 'fs24', 39)" class="i">this</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs23', 40)" onmouseover="showTip(event, 'fs23', 40)" class="i">TakenOn</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs28', 41)" onmouseover="showTip(event, 'fs28', 41)" class="i">Month</span>
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Easy to create union types</h2>
<p>(kind of like enums but way cooler)</p>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">type</span> <span onmouseout="hideTip(event, 'fs29', 42)" onmouseover="showTip(event, 'fs29', 42)" class="t">Failure</span> <span class="o">=</span>
| <span onmouseout="hideTip(event, 'fs30', 43)" onmouseover="showTip(event, 'fs30', 43)" class="p">BytesDidNotMatch</span> <span class="k">of</span> <span onmouseout="hideTip(event, 'fs12', 44)" onmouseover="showTip(event, 'fs12', 44)" class="t">MoveRequest</span>
| <span onmouseout="hideTip(event, 'fs31', 45)" onmouseover="showTip(event, 'fs31', 45)" class="p">CouldNotCopyFile</span> <span class="k">of</span> <span onmouseout="hideTip(event, 'fs15', 46)" onmouseover="showTip(event, 'fs15', 46)" class="t">FailedMove</span>
| <span onmouseout="hideTip(event, 'fs32', 47)" onmouseover="showTip(event, 'fs32', 47)" class="p">CouldNotDeleteSource</span> <span class="k">of</span> <span onmouseout="hideTip(event, 'fs15', 48)" onmouseover="showTip(event, 'fs15', 48)" class="t">FailedMove</span>
| <span onmouseout="hideTip(event, 'fs33', 49)" onmouseover="showTip(event, 'fs33', 49)" class="p">OhDearGodItAllBlewUp</span>
</code></pre></td>
</tr>
</table>
</section>
</section>
<section >
<section >
<h2>Type safety: pattern matching</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs34', 50)" onmouseover="showTip(event, 'fs34', 50)" class="f">formatFailure</span> <span onmouseout="hideTip(event, 'fs35', 51)" onmouseover="showTip(event, 'fs35', 51)" class="i">failure</span> <span class="o">=</span>
<span class="k">match</span> <span onmouseout="hideTip(event, 'fs35', 52)" onmouseover="showTip(event, 'fs35', 52)" class="i">failure</span> <span class="k">with</span>
| <span onmouseout="hideTip(event, 'fs30', 53)" onmouseover="showTip(event, 'fs30', 53)" class="p">BytesDidNotMatch</span> <span onmouseout="hideTip(event, 'fs36', 54)" onmouseover="showTip(event, 'fs36', 54)" class="i">request</span> <span class="k">-></span>
<span class="s">"Reason: Bytes did not match"</span>
| <span onmouseout="hideTip(event, 'fs31', 55)" onmouseover="showTip(event, 'fs31', 55)" class="p">CouldNotCopyFile</span> <span onmouseout="hideTip(event, 'fs37', 56)" onmouseover="showTip(event, 'fs37', 56)" class="i">move</span> <span class="k">-></span>
<span onmouseout="hideTip(event, 'fs26', 57)" onmouseover="showTip(event, 'fs26', 57)" class="f">sprintf</span> <span class="s">"Reason: Could not copy </span><span class="pf">%A</span><span class="s">"</span> <span onmouseout="hideTip(event, 'fs37', 58)" onmouseover="showTip(event, 'fs37', 58)" class="i">move</span>
| <span onmouseout="hideTip(event, 'fs32', 59)" onmouseover="showTip(event, 'fs32', 59)" class="p">CouldNotDeleteSource</span> <span onmouseout="hideTip(event, 'fs37', 60)" onmouseover="showTip(event, 'fs37', 60)" class="i">move</span> <span class="k">-></span>
<span class="s">"Reason: Could not delete source"</span>
| <span onmouseout="hideTip(event, 'fs33', 61)" onmouseover="showTip(event, 'fs33', 61)" class="p">OhDearGodItAllBlewUp</span> <span class="k">-></span>
<span class="s">"You handle it from here"</span>
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Type safety: string formatting</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs38', 62)" onmouseover="showTip(event, 'fs38', 62)" class="f">report</span> <span onmouseout="hideTip(event, 'fs39', 63)" onmouseover="showTip(event, 'fs39', 63)" class="i">numberOfSuccesses</span> <span onmouseout="hideTip(event, 'fs40', 64)" onmouseover="showTip(event, 'fs40', 64)" class="i">author</span> <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs26', 65)" onmouseover="showTip(event, 'fs26', 65)" class="f">sprintf</span> <span class="s">"</span><span class="pf">%i</span><span class="s"> successes, go </span><span class="pf">%s</span><span class="s">!"</span>
<span onmouseout="hideTip(event, 'fs39', 66)" onmouseover="showTip(event, 'fs39', 66)" class="i">numberOfSuccesses</span>
<span onmouseout="hideTip(event, 'fs40', 67)" onmouseover="showTip(event, 'fs40', 67)" class="i">author</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs41', 68)" onmouseover="showTip(event, 'fs41', 68)" class="i">reported</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs38', 69)" onmouseover="showTip(event, 'fs38', 69)" class="f">report</span> <span class="n">1000000</span> <span class="s">"Koen"</span>
</code></pre></td>
</tr>
</table>
<table class="pre"><tr><td><pre><code>"1000000 successes, go Koen!"</code></pre></td></tr></table>
</section>
<section >
<h2>Type safety: inference</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs42', 70)" onmouseover="showTip(event, 'fs42', 70)" class="f">mapSomeOrNone</span> <span onmouseout="hideTip(event, 'fs43', 71)" onmouseover="showTip(event, 'fs43', 71)" class="f">f</span> <span onmouseout="hideTip(event, 'fs44', 72)" onmouseover="showTip(event, 'fs44', 72)" class="i">things</span> <span class="o">=</span>
<span class="k">match</span> <span onmouseout="hideTip(event, 'fs44', 73)" onmouseover="showTip(event, 'fs44', 73)" class="i">things</span> <span class="k">with</span>
| <span onmouseout="hideTip(event, 'fs45', 74)" onmouseover="showTip(event, 'fs45', 74)" class="i">x</span><span class="o">::</span><span onmouseout="hideTip(event, 'fs46', 75)" onmouseover="showTip(event, 'fs46', 75)" class="i">xs</span> <span class="k">-></span> <span onmouseout="hideTip(event, 'fs44', 76)" onmouseover="showTip(event, 'fs44', 76)" class="i">things</span> <span class="o">|></span> <span onmouseout="hideTip(event, 'fs47', 77)" onmouseover="showTip(event, 'fs47', 77)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs48', 78)" onmouseover="showTip(event, 'fs48', 78)" class="f">map</span> <span onmouseout="hideTip(event, 'fs43', 79)" onmouseover="showTip(event, 'fs43', 79)" class="f">f</span> <span class="o">|></span> <span onmouseout="hideTip(event, 'fs49', 80)" onmouseover="showTip(event, 'fs49', 80)" class="p">Some</span>
| _ <span class="k">-></span> <span onmouseout="hideTip(event, 'fs50', 81)" onmouseover="showTip(event, 'fs50', 81)" class="p">None</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs51', 82)" onmouseover="showTip(event, 'fs51', 82)" class="i">mapped</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs42', 83)" onmouseover="showTip(event, 'fs42', 83)" class="f">mapSomeOrNone</span> (<span class="k">fun</span> <span onmouseout="hideTip(event, 'fs52', 84)" onmouseover="showTip(event, 'fs52', 84)" class="i">x</span> <span class="k">-></span> <span onmouseout="hideTip(event, 'fs52', 85)" onmouseover="showTip(event, 'fs52', 85)" class="i">x</span> <span class="o">+</span> <span class="n">20</span>) [<span class="n">0</span> ; <span class="n">5</span> ; <span class="n">10</span>]
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs53', 86)" onmouseover="showTip(event, 'fs53', 86)" class="i">notMapped</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs42', 87)" onmouseover="showTip(event, 'fs42', 87)" class="f">mapSomeOrNone</span> (<span class="k">fun</span> <span onmouseout="hideTip(event, 'fs52', 88)" onmouseover="showTip(event, 'fs52', 88)" class="i">x</span> <span class="k">-></span> <span onmouseout="hideTip(event, 'fs52', 89)" onmouseover="showTip(event, 'fs52', 89)" class="i">x</span> <span class="o">+</span> <span class="n">20</span>) []
</code></pre></td>
</tr>
</table>
<table class="pre"><tr><td><pre><code>Some (seq [20; 25; 30])</code></pre></td></tr></table>
<table class="pre"><tr><td><pre><code><null></code></pre></td></tr></table>
</section>
</section>
<section >
<section >
<h2>Easily pipeline operations</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="i">moveRequests</span>
<span class="o">|></span> <span onmouseout="hideTip(event, 'fs54', 90)" onmouseover="showTip(event, 'fs54', 90)" class="i">List</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs55', 91)" onmouseover="showTip(event, 'fs55', 91)" class="i">choose</span> <span class="i">isSuccess</span>
<span class="o">|></span> <span class="i">moveInParallel</span> <span class="i">move</span>
<span class="o">|></span> <span class="i">tee</span> (<span class="k">fun</span> _ <span class="k">-></span> <span class="i">watch</span><span class="o">.</span><span class="i">Stop</span>())
<span class="o">|></span> <span class="i">createReport</span> <span class="i">moveRequests</span>
<span class="o">|></span> <span class="i">tee</span> <span class="i">reportToConsole</span>
<span class="o">|></span> <span class="i">reportToMailIfNecessary</span> <span class="i">arguments</span>
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Compose operations with ROP</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span class="i">move</span> <span class="i">moveWithFs</span> <span class="i">compareFiles</span> <span class="i">cleanUp</span> <span class="o">=</span>
<span class="i">moveWithFs</span>
<span class="o">></span><span class="o">=></span> <span class="i">compareFiles</span>
<span class="o">></span><span class="o">=></span> <span class="i">cleanUp</span>
</code></pre></td>
</tr>
</table>
<p><img src="images/funwithfsharp/Recipe_Railway_Transparent.png" alt="Railway-Oriented-Programming" /></p>
<p><a href="http://fsharpforfunandprofit.com/rop/">source</a></p>
</section>
</section>
<section >
<h2>F# Type providers</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l"> 1: </span>
<span class="l"> 2: </span>
<span class="l"> 3: </span>
<span class="l"> 4: </span>
<span class="l"> 5: </span>
<span class="l"> 6: </span>
<span class="l"> 7: </span>
<span class="l"> 8: </span>
<span class="l"> 9: </span>
<span class="l">10: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span onmouseout="hideTip(event, 'fs5', 92)" onmouseover="showTip(event, 'fs5', 92)" class="i">FSharp</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs6', 93)" onmouseover="showTip(event, 'fs6', 93)" class="i">Data</span>
<span class="k">type</span> <span onmouseout="hideTip(event, 'fs56', 94)" onmouseover="showTip(event, 'fs56', 94)" class="t">Tags</span> <span class="o">=</span> <span class="i">JsonProvider</span><span class="o"><</span><span class="s">"example.json"</span><span class="o">></span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs57', 95)" onmouseover="showTip(event, 'fs57', 95)" class="i">tags</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs56', 96)" onmouseover="showTip(event, 'fs56', 96)" class="i">Tags</span><span class="o">.</span><span class="i">Load</span> (<span class="s">"someFile.json"</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs58', 97)" onmouseover="showTip(event, 'fs58', 97)" class="i">picture</span> <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs57', 98)" onmouseover="showTip(event, 'fs57', 98)" class="i">tags</span>
<span class="o">|></span> <span onmouseout="hideTip(event, 'fs47', 99)" onmouseover="showTip(event, 'fs47', 99)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs59', 100)" onmouseover="showTip(event, 'fs59', 100)" class="f">find</span> (<span class="k">fun</span> <span onmouseout="hideTip(event, 'fs60', 101)" onmouseover="showTip(event, 'fs60', 101)" class="i">pic</span> <span class="k">-></span> <span onmouseout="hideTip(event, 'fs60', 102)" onmouseover="showTip(event, 'fs60', 102)" class="i">pic</span><span class="o">.</span><span class="i">FileName</span> <span class="o">=</span> <span class="s">"bla"</span>)
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs61', 103)" onmouseover="showTip(event, 'fs61', 103)" class="i">aperture</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs58', 104)" onmouseover="showTip(event, 'fs58', 104)" class="i">picture</span><span class="o">.</span><span class="i">Aperture</span>
</code></pre></td>
</tr>
</table>
<p><a href="https://raw.githubusercontent.com/koenmetsu/Muffin.Pictures.Archiver/master/src/Muffin.Pictures.Archiver/example_exiftool_output.json">example json</a></p>
</section>
<section >
<h2>.NET Interoperability</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span onmouseout="hideTip(event, 'fs1', 105)" onmouseover="showTip(event, 'fs1', 105)" class="i">System</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs62', 106)" onmouseover="showTip(event, 'fs62', 106)" class="i">Diagnostics</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs63', 107)" onmouseover="showTip(event, 'fs63', 107)" class="i">processStartInfo</span> <span class="o">=</span> <span class="k">new</span> <span onmouseout="hideTip(event, 'fs64', 108)" onmouseover="showTip(event, 'fs64', 108)" class="t">ProcessStartInfo</span>()
<span onmouseout="hideTip(event, 'fs63', 109)" onmouseover="showTip(event, 'fs63', 109)" class="i">processStartInfo</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs65', 110)" onmouseover="showTip(event, 'fs65', 110)" class="i">FileName</span> <span class="o"><-</span> <span class="s">"killdestroy.exe"</span>
<span onmouseout="hideTip(event, 'fs63', 111)" onmouseover="showTip(event, 'fs63', 111)" class="i">processStartInfo</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs66', 112)" onmouseover="showTip(event, 'fs66', 112)" class="i">Arguments</span> <span class="o"><-</span>
<span onmouseout="hideTip(event, 'fs26', 113)" onmouseover="showTip(event, 'fs26', 113)" class="f">sprintf</span> <span class="s">"/r /y /c /b /a /r </span><span class="pf">%i</span><span class="s">"</span> <span class="n">1234</span>
<span onmouseout="hideTip(event, 'fs67', 114)" onmouseover="showTip(event, 'fs67', 114)" class="t">Process</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs68', 115)" onmouseover="showTip(event, 'fs68', 115)" class="f">Start</span>(<span onmouseout="hideTip(event, 'fs63', 116)" onmouseover="showTip(event, 'fs63', 116)" class="i">processStartInfo</span>)
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Easy async</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs69', 117)" onmouseover="showTip(event, 'fs69', 117)" class="f">runAsync</span> <span onmouseout="hideTip(event, 'fs70', 118)" onmouseover="showTip(event, 'fs70', 118)" class="f">move</span> <span class="o">=</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs71', 119)" onmouseover="showTip(event, 'fs71', 119)" class="f">asyncMove</span> <span onmouseout="hideTip(event, 'fs72', 120)" onmouseover="showTip(event, 'fs72', 120)" class="i">request</span> <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs73', 121)" onmouseover="showTip(event, 'fs73', 121)" class="i">async</span> { <span class="k">return</span> <span onmouseout="hideTip(event, 'fs70', 122)" onmouseover="showTip(event, 'fs70', 122)" class="f">move</span> <span onmouseout="hideTip(event, 'fs72', 123)" onmouseover="showTip(event, 'fs72', 123)" class="i">request</span> }
<span onmouseout="hideTip(event, 'fs54', 124)" onmouseover="showTip(event, 'fs54', 124)" class="t">List</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs74', 125)" onmouseover="showTip(event, 'fs74', 125)" class="f">map</span> <span onmouseout="hideTip(event, 'fs71', 126)" onmouseover="showTip(event, 'fs71', 126)" class="f">asyncMove</span>
<span class="o">></span><span class="o">></span> <span onmouseout="hideTip(event, 'fs75', 127)" onmouseover="showTip(event, 'fs75', 127)" class="t">Async</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs76', 128)" onmouseover="showTip(event, 'fs76', 128)" class="f">Parallel</span>
<span class="o">></span><span class="o">></span> <span onmouseout="hideTip(event, 'fs75', 129)" onmouseover="showTip(event, 'fs75', 129)" class="t">Async</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs77', 130)" onmouseover="showTip(event, 'fs77', 130)" class="f">RunSynchronously</span>
<span class="o">></span><span class="o">></span> <span onmouseout="hideTip(event, 'fs54', 131)" onmouseover="showTip(event, 'fs54', 131)" class="t">List</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs78', 132)" onmouseover="showTip(event, 'fs78', 132)" class="f">ofArray</span>
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Functions as interfaces</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
<span class="l">9: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs79', 133)" onmouseover="showTip(event, 'fs79', 133)" class="f">compareFiles</span> <span onmouseout="hideTip(event, 'fs80', 134)" onmouseover="showTip(event, 'fs80', 134)" class="f">compare</span> <span onmouseout="hideTip(event, 'fs81', 135)" onmouseover="showTip(event, 'fs81', 135)" class="i">x</span> <span onmouseout="hideTip(event, 'fs82', 136)" onmouseover="showTip(event, 'fs82', 136)" class="i">y</span> <span class="o">=</span>
<span class="k">if</span> <span onmouseout="hideTip(event, 'fs80', 137)" onmouseover="showTip(event, 'fs80', 137)" class="f">compare</span> <span onmouseout="hideTip(event, 'fs81', 138)" onmouseover="showTip(event, 'fs81', 138)" class="i">x</span> <span onmouseout="hideTip(event, 'fs82', 139)" onmouseover="showTip(event, 'fs82', 139)" class="i">y</span> <span class="k">then</span>
<span onmouseout="hideTip(event, 'fs26', 140)" onmouseover="showTip(event, 'fs26', 140)" class="f">sprintf</span>
<span class="s">"Wow! </span><span class="pf">%s</span><span class="s"> IS </span><span class="pf">%s</span><span class="s">!"</span> <span onmouseout="hideTip(event, 'fs81', 141)" onmouseover="showTip(event, 'fs81', 141)" class="i">x</span> <span onmouseout="hideTip(event, 'fs82', 142)" onmouseover="showTip(event, 'fs82', 142)" class="i">y</span>
<span class="k">else</span>
<span class="s">"Awww..."</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs83', 143)" onmouseover="showTip(event, 'fs83', 143)" class="f">badStrategy</span> <span onmouseout="hideTip(event, 'fs84', 144)" onmouseover="showTip(event, 'fs84', 144)" class="i">x</span> <span onmouseout="hideTip(event, 'fs85', 145)" onmouseover="showTip(event, 'fs85', 145)" class="i">y</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs84', 146)" onmouseover="showTip(event, 'fs84', 146)" class="i">x</span> <span class="o"><></span> <span onmouseout="hideTip(event, 'fs85', 147)" onmouseover="showTip(event, 'fs85', 147)" class="i">y</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs86', 148)" onmouseover="showTip(event, 'fs86', 148)" class="i">areEqual</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs79', 149)" onmouseover="showTip(event, 'fs79', 149)" class="f">compareFiles</span> <span onmouseout="hideTip(event, 'fs83', 150)" onmouseover="showTip(event, 'fs83', 150)" class="f">badStrategy</span> <span class="s">"Time"</span> <span class="s">"Money"</span>
</code></pre></td>
</tr>
</table>
<table class="pre"><tr><td><pre><code>"Wow! Time IS Money!"</code></pre></td></tr></table>
</section>
<section >
<h2>Easy stubs!</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
<span class="l">7: </span>
<span class="l">8: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">open</span> <span class="i">Swensen</span><span class="o">.</span><span class="i">Unquote</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs87', 151)" onmouseover="showTip(event, 'fs87', 151)" class="f">``Verify Awww... when things don't match up``</span> () <span class="o">=</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs88', 152)" onmouseover="showTip(event, 'fs88', 152)" class="f">stubComparer</span> <span onmouseout="hideTip(event, 'fs89', 153)" onmouseover="showTip(event, 'fs89', 153)" class="i">x</span> <span onmouseout="hideTip(event, 'fs90', 154)" onmouseover="showTip(event, 'fs90', 154)" class="i">y</span> <span class="o">=</span> <span class="k">false</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs91', 155)" onmouseover="showTip(event, 'fs91', 155)" class="i">comparison</span> <span class="o">=</span>
<span onmouseout="hideTip(event, 'fs79', 156)" onmouseover="showTip(event, 'fs79', 156)" class="f">compareFiles</span> <span onmouseout="hideTip(event, 'fs88', 157)" onmouseover="showTip(event, 'fs88', 157)" class="f">stubComparer</span> <span class="s">"Time"</span> <span class="s">"Money"</span>
<span class="i">test</span> <@ <span class="s">"Awww..."</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs91', 158)" onmouseover="showTip(event, 'fs91', 158)" class="i">comparison</span> @>
</code></pre></td>
</tr>
</table>
</section>
<section >
<h2>Partial application</h2>
<table class="pre"><tr><td class="lines"><pre class="fssnip"><span class="l">1: </span>
<span class="l">2: </span>
<span class="l">3: </span>
<span class="l">4: </span>
<span class="l">5: </span>
<span class="l">6: </span>
</pre></td>
<td class="snippet"><pre class="fssnip highlighted"><code lang="fsharp"><span class="k">let</span> <span onmouseout="hideTip(event, 'fs97', 170)" onmouseover="showTip(event, 'fs97', 170)" class="i">now</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs11', 171)" onmouseover="showTip(event, 'fs11', 171)" class="t">DateTimeOffset</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs98', 172)" onmouseover="showTip(event, 'fs98', 172)" class="i">UtcNow</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs99', 173)" onmouseover="showTip(event, 'fs99', 173)" class="f">isOlderThan1Month</span> <span class="o">=</span> <span onmouseout="hideTip(event, 'fs92', 174)" onmouseover="showTip(event, 'fs92', 174)" class="f">isOlderThanXMonths</span> <span onmouseout="hideTip(event, 'fs97', 175)" onmouseover="showTip(event, 'fs97', 175)" class="i">now</span> <span class="n">1</span>
<span class="k">let</span> <span onmouseout="hideTip(event, 'fs100', 176)" onmouseover="showTip(event, 'fs100', 176)" class="i">firstOldDate</span> <span class="o">=</span>
[ <span class="n">0.0</span> <span class="o">..</span> <span class="n">8.0</span> <span class="o">..</span> <span class="n">100.0</span> ]
<span class="o">|></span> <span onmouseout="hideTip(event, 'fs47', 177)" onmouseover="showTip(event, 'fs47', 177)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs48', 178)" onmouseover="showTip(event, 'fs48', 178)" class="f">map</span> (<span class="k">fun</span> <span onmouseout="hideTip(event, 'fs101', 179)" onmouseover="showTip(event, 'fs101', 179)" class="i">i</span> <span class="k">-></span> <span onmouseout="hideTip(event, 'fs97', 180)" onmouseover="showTip(event, 'fs97', 180)" class="i">now</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs102', 181)" onmouseover="showTip(event, 'fs102', 181)" class="f">AddDays</span>(<span class="o">-</span><span onmouseout="hideTip(event, 'fs101', 182)" onmouseover="showTip(event, 'fs101', 182)" class="i">i</span>))
<span class="o">|></span> <span onmouseout="hideTip(event, 'fs47', 183)" onmouseover="showTip(event, 'fs47', 183)" class="t">Seq</span><span class="o">.</span><span onmouseout="hideTip(event, 'fs59', 184)" onmouseover="showTip(event, 'fs59', 184)" class="f">find</span> <span onmouseout="hideTip(event, 'fs99', 185)" onmouseover="showTip(event, 'fs99', 185)" class="f">isOlderThan1Month</span>
</code></pre></td>
</tr>
</table>
<table class="pre"><tr><td><pre><code>No value has been returned</code></pre></td></tr></table>
</section>
<section >
<h3>More information</h3>
<p><a href="http://fsharp.org/">F# official site</a></p>
<p><a href="http://fsharpforfunandprofit.com">F# For Fun and Profit</a></p>
<p><img src="images/funwithfsharp/fsharp.png" alt="FSharp" /></p>
<p><a href="https://twitter.com/koenmetsu">@koenmetsu</a></p>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.js"></script>
<script>
// Add the nohighlight class and data-noescape attribute to code elements that have already been formatted by FSharp.Formatting
$('pre.highlighted code').addClass('nohighlight').attr('data-noescape', '');
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
transition: 'slide', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function () { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function () { return !!document.querySelector('[data-markdown]'); } },
{ src: 'plugin/markdown/markdown.js', condition: function () { return !!document.querySelector('[data-markdown]'); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function () { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function () { return !!document.body.classList; } },
{ src: 'plugin/notes/notes.js', async: true, condition: function () { return !!document.body.classList; } }
]
});
</script>
</body>
</html>