Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 5ed1805d1e2d61000670078f

C# data class to F# record

Converting from C# to F# is not hard, but requires some manual labor. Here you should convert from a C# data class to a F# record.

Start file
public enum State
{
  Active, Inactive
}

public struct Price
{
  public decimal Amount { get; set; }
  public decimal Vat { get; set; }
}

public class Ticket
{
  public State State { get; set; }
  public int Count { get; set; }
  public Price Price { get; set; }
  public DateTime DepartureDate { get; set; }
  public DateTime? ReturnDate { get; set; }
}
End file
type State = Active | Inactive

type Price = {
  amount: decimal
  vat: decimal
}

type Ticket = {
  state: State
  count: int
  price: Price
  departureDate: DateTime
  returnDate: DateTime option
}

View Diff

1,4c1
< public enum State
< {
<   Active, Inactive
< }
---
> type State = Active | Inactive
6,9c3,5
< public struct Price
< {
<   public decimal Amount { get; set; }
<   public decimal Vat { get; set; }
---
> type Price = {
>   amount: decimal
>   vat: decimal
12,18c8,13
< public class Ticket
< {
<   public State State { get; set; }
<   public int Count { get; set; }
<   public Price Price { get; set; }
<   public DateTime DepartureDate { get; set; }
<   public DateTime? ReturnDate { get; set; }
---
> type Ticket = {
>   state: State
>   count: int
>   price: Price
>   departureDate: DateTime
>   returnDate: DateTime option

Solutions by @FICSQF:

Unlock 10 remaining solutions by signing in and submitting your own entry
Created by: @rqAbrahamsson

18 active golfers, 79 entries

Solutions by @FICSQF:
63
#1 - せいほう / @FICSQF

05/30/2020 at 11:50PM

65
#>9 - せいほう / @FICSQF

05/30/2020 at 11:34PM

67
#>10 - せいほう / @FICSQF

05/30/2020 at 03:21PM

70
#>11 - せいほう / @FICSQF

05/30/2020 at 08:33AM

70
#>11 - せいほう / @FICSQF

05/30/2020 at 08:44AM

71
#>11 - せいほう / @FICSQF

05/30/2020 at 08:26AM

78
#>13 - せいほう / @FICSQF

05/30/2020 at 06:29AM

79
#>13 - せいほう / @FICSQF

05/30/2020 at 06:12AM

81
#>13 - せいほう / @FICSQF

05/30/2020 at 05:59AM

83
#>14 - せいほう / @FICSQF

05/30/2020 at 05:44AM