This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Mimic type classes with additional param | |
| type 'a Num = { | |
| zero: 'a | |
| add: 'a -> 'a -> 'a | |
| mult: 'a -> 'a -> 'a | |
| fromInteger: int -> 'a } | |
| let intNum = { | |
| zero = 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Example of using F# MailboxProcessor against an HTML5 WebSocket (in Google Chrome) | |
| // taken from http://v2matveev.blogspot.com/2010/04/mailboxprocessors-practical-application.html | |
| // and then modified to work with the revised WebSocket protocol that includes a set of challenge bytes. | |
| // The main changes are in the handshake function. | |
| // Have a look at the http://nugget.codeplex.com for example WebSocket code in C#, on which I based the | |
| // challenge processing code. | |
| open System | |
| open System.IO | |
| open System.Linq |
NewerOlder