Skip to content

Instantly share code, notes, and snippets.

@ygrenzinger
Created December 12, 2015 20:15
Show Gist options
  • Save ygrenzinger/b7f33edfa919635e888d to your computer and use it in GitHub Desktop.
Save ygrenzinger/b7f33edfa919635e888d to your computer and use it in GitHub Desktop.
open System
open System.IO
type MyRecord =
{ IP : string
MAC : string
FriendlyName : string
ID : int }
let IsMatchByName record name =
match record with
| { FriendlyName = nameFound; ID = id; IP = ip } when nameFound = name -> Some((id,ip))
| _ -> None
let checkmatch input =
match input with
| Some((x, y)) -> printfn "%A" x
| None -> printfn "%A" "Sorry no match"
[<EntryPoint>]
let main argv =
let input = Console.ReadLine()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment