Vasily Kirichenko

My feedback

  1. 22 votes
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      3 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
      Vasily Kirichenko commented  · 

      What the construction syntax would look like? In Go it's like this:

      type Base struct {
      X int
      Y int
      }

      type Foo struct {
      Base
      Z int
      }

      func main() {
      foo := Foo { Base { 1, 2 }, 3 }
      fmt.Println(foo.X + foo.Y + foo.Z)
      }

    • 4 votes
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        3 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
        Vasily Kirichenko commented  · 

        Nothing can be removed from the language.

      • 26 votes
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          1 comment  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
          Vasily Kirichenko shared this idea  · 
        • 6 votes
          Vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            Signed in as (Sign out)
            You have left! (?) (thinking…)
            1 comment  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
            Vasily Kirichenko shared this idea  · 
          • 4 votes
            Vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              Signed in as (Sign out)
              You have left! (?) (thinking…)
              3 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
              Vasily Kirichenko commented  · 

              You can write

              let sq = seq [ 1; 2; 3 ]

            • 17 votes
              Vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                Signed in as (Sign out)
                You have left! (?) (thinking…)
                0 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                Vasily Kirichenko supported this idea  · 
                Vasily Kirichenko shared this idea  · 
              • 11 votes
                Vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  Signed in as (Sign out)
                  You have left! (?) (thinking…)
                  2 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                  Vasily Kirichenko commented  · 

                  Return in computation expressions is the monodic "return" (or "pure") and has nothing in common with return in imperative languages like C#. What's more, return usually == yield.

                • 453 votes
                  Vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    Signed in as (Sign out)
                    You have left! (?) (thinking…)
                    38 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                    Vasily Kirichenko supported this idea  · 
                  • 15 votes
                    Vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      Signed in as (Sign out)
                      You have left! (?) (thinking…)
                      6 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                      Vasily Kirichenko commented  · 

                      I think a better name is getOrElse (it's also used in Scala). I would also like to add several other functions, like:

                      ofNull
                      ofNullable
                      toNullable
                      attempt
                      orElse
                      getOrTry
                      orTry
                      flatten

                      (we use all of them in Visual F# Power Tools https://github.com/fsprojects/VisualFSharpPowerTools/blob/3299b8cc99bea9430149df0338304b60c8a6405b/src/FSharpVSPowerTools.Core/Utils.fs#L49-L91)

                      There are many others in ExtCore https://github.com/jack-pappas/ExtCore/blob/master/ExtCore/Pervasive.fs#L727-L923 and in FSharpx https://github.com/fsprojects/fsharpx/blob/master/src/FSharpx.Core/ComputationExpressions/Monad.fs#L86-L285

                      I think we should collect all of them in a table (like it's with collections on codeplex) and discuss what should be added into FSharp.Core (it'd be fine to do the same with Choice).

                    • 36 votes
                      Vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        Signed in as (Sign out)
                        You have left! (?) (thinking…)
                        10 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                        Vasily Kirichenko commented  · 

                        This is now it's implemented in D https://gist.github.com/vasily-kirichenko/95a2cabfba599884b61d

                        So, no-static types can capture local variables and cannot escape the function scope.

                      • 42 votes
                        Vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          Signed in as (Sign out)
                          You have left! (?) (thinking…)
                          9 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                          Vasily Kirichenko commented  · 

                          Looks very nice.

                        • 59 votes
                          Vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            Signed in as (Sign out)
                            You have left! (?) (thinking…)
                            8 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                            Vasily Kirichenko commented  · 

                            None is represented as null in compiled code due to [<CompilationRepresentation(CompilationRepresentationFlags.UseNullAsTrueValue)>] applied on Option<'T>. So, only Some<'T> values are heap allocated.

                          • 12 votes
                            Vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              Signed in as (Sign out)
                              You have left! (?) (thinking…)
                              8 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                            • 4 votes
                              Vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                Signed in as (Sign out)
                                You have left! (?) (thinking…)
                                3 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                                Vasily Kirichenko commented  · 

                                I think it's more logical to place attributes right before object expression itself, like this:

                                let makeResource name =
                                [<MyAttribute>]
                                { new System.IDisposable with
                                member this.Dispose() = printfn "%s disposed" name }

                                It's also better since we now can apply attributes not only in bindings, but in any expression:

                                func ([<MyAttribute>]
                                { new System.IDisposable with
                                member this.Dispose() = printfn "%s disposed" name },
                                anotherArg)

                              • 270 votes
                                Vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  Signed in as (Sign out)
                                  You have left! (?) (thinking…)
                                  17 comments  ·  F# Language  ·  Flag idea as inappropriate…  ·  Admin →
                                  Vasily Kirichenko commented  · 

                                  I personally like the current syntax.

                                Feedback and Knowledge Base