This file contains 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
// Steps: | |
// 1. If the length of the provided string is 0, then return the default of Person | |
// 2. Split the given string on the commas present in it | |
// 3. Extract the first element from the split operation and use it as the name | |
// 4. If the name is empty, then return the default of Person | |
// 5. Extract the other element from the split operation and parse it into a `usize` as the age | |
// If while parsing the age, something goes wrong, then return the default of Person | |
// Otherwise, then return an instantiated Person object with the results | |
// I AM NOT DONE |
This file contains 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
type MyDU = | |
| CaseOne of int | |
| CaseTwo of int | |
let c1 = CaseOne 1 | |
let c2 = CaseTwo 2 | |
let matchit mdu = |
This file contains 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
module FSharpExpr = | |
let getMethod = | |
function | |
| Patterns.Call (_, m, _) when m.IsGenericMethod -> m.GetGenericMethodDefinition() | |
| Patterns.Call (_, m, _) -> m | |
| _ -> failwith "Incorrect getMethod Pattern" | |
let X<'T> : 'T = Unchecked.defaultof<'T> | |
let inline application prms expr = Expr.Application(expr, prms) |
This file contains 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
type Days = | |
| None = 0x0 | |
| Sunday = 0x1 | |
| Monday = 0x2 | |
| Tuesday = 0x4 | |
| Wednesday = 0x8 | |
| Thursday = 0x10 | |
| Friday = 0x20 | |
| Saturday = 0x40 |
This file contains 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
let y = | |
let x = 10 | |
x * 10 | |
let timesTen y = | |
let x = 10 in y * x |
This file contains 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
type ParseError = string list | |
type HashBlocking = { CustomerField: string; ProviderField: string } | |
type SuffixArrayBlocking = { CustomerField: string; ProviderField: string } | |
type BlockingMethod = | |
| Hash of HashBlocking | |
| SuffixArray of SuffixArrayBlocking | |
type FieldConfig = |
This file contains 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
type ParseError = string list | |
type HashBlocking = { CustomerField: string; ProviderField: string } | |
type SuffixArrayBlocking = { CustomerField: string; ProviderField: string } | |
type BlockingMethod = | |
| Hash of HashBlocking | |
| SuffixArray of SuffixArrayBlocking | |
type FieldConfig = |
This file contains 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
type ParseError = string list | |
type HashBlocking = { CustomerField: string; ProviderField: string } | |
type SuffixArrayBlocking = { CustomerField: string; ProviderField: string } | |
type BlockingMethod = | |
| Hash of HashBlocking | |
| SuffixArray of SuffixArrayBlocking | |
type FieldConfig = |