// Learn more about F# at http://docs.microsoft.com/dotnet/fsharp
open System
/// Decodes a Roman Number string to a int number // https://twitter.com/nikoloz_p/status/1421218836896960515
let DecodeRomanNumeral RomanNumeral =
let DigitToNumber = function
| 'I' -> 1
| 'V' -> 5
| 'X' -> 10
| 'L' -> 50
| 'C' -> 100
| 'D' -> 500
| 'M' -> 1000
| c -> failwith (sprintf "Invalid digit %c" c)
let rec sum' Numbers =
match Numbers with
| [] ->0
| x::y::rest when x < y -> y - x + sum' rest
| x::rest -> x + sum' rest
RomanNumeral
|> Seq.map DigitToNumber
|> Seq.toList
|> sum'
[<EntryPoint>]
let main argv =
let message = DecodeRomanNumeral "XVXV"
printfn "Hello world %i" message
0