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 5ed25358070f0e0006193c04

C# function to F#

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

Start file
private static string GetData(Environment environment, string name)
{
  var options = new DefaultOptions();
  if (environment.IsDevelopment())
  {
    options.LocalCredentials = true;
    options.Path = "/stuff";
  }
  else
  {
    options.LocalCredentials = false;
  }
  var uri = new Uri("https://example.com/" + name);
  var client = new GetClient(uri, options);
  return client.GetStuff(name);
}
End file
let getData (environment: Environment) (name: string) : string =
  let options = DefaultOptions()
  if environment.IsDevelopment() then
    options.LocalCredentials <- true
    options.Path <- "/stuff"
  else
    options.LocalCredentials <- false
  let uri = Uri("https://example.com/" + name)
  let client = GetClient(uri, options)
  client.GetStuff(name)

View Diff

1,8c1,5
< private static string GetData(Environment environment, string name)
< {
<   var options = new DefaultOptions();
<   if (environment.IsDevelopment())
<   {
<     options.LocalCredentials = true;
<     options.Path = "/stuff";
<   }
---
> let getData (environment: Environment) (name: string) : string =
>   let options = DefaultOptions()
>   if environment.IsDevelopment() then
>     options.LocalCredentials <- true
>     options.Path <- "/stuff"
10,16c7,10
<   {
<     options.LocalCredentials = false;
<   }
<   var uri = new Uri("https://example.com/" + name);
<   var client = new GetClient(uri, options);
<   return client.GetStuff(name);
< }
\ No newline at end of file
---
>     options.LocalCredentials <- false
>   let uri = Uri("https://example.com/" + name)
>   let client = GetClient(uri, options)
>   client.GetStuff(name)
\ No newline at end of file

Solutions by @quemeraisc:

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

11 active golfers, 30 entries

Solutions by @quemeraisc:
105
#3 - quemeraisc / @quemeraisc

08/19/2022 at 11:54AM

111
#>5 - quemeraisc / @quemeraisc

08/19/2022 at 11:25AM

114
#>6 - quemeraisc / @quemeraisc

08/19/2022 at 11:20AM

133
#>10 - quemeraisc / @quemeraisc

08/19/2022 at 11:14AM