Daniel

Texas

Oct
16
revised Running number of items in subgroups within ienumerable of items
added 598 characters in body
Oct
16
answered Running number of items in subgroups within ienumerable of items
Sep
30
awarded Explainer
Sep
21
awarded Notable Question
Sep
19
answered F# BinarySearch return position
Sep
18
comment F# BinarySearch return position
A slightly cleaner way, IMO, not requiring an "impossible" case.
Sep
16
answered Implementing delegate interface in F#
Sep
16
revised F# missing type constraint
added 236 characters in body
Sep
16
comment F# missing type constraint
@brianberns: I updated my answer with the working signature. The type extension doesn't work because it uses the generic argument defined on the type, and constraints on type-level generic args must be explicit.
Sep
16
revised F# missing type constraint
added 236 characters in body
Sep
16
comment Why doesn't a computation expression span the finally block
@Vesa.A.J.K: I'm not suggesting it's an impossible concept, only that the way workflows are presently desugared prevents it.
Sep
16
comment Assignment to Nullable in F#
It's no more misleading than the built-in dereferencing operator, e.g.: if !myboolref then ...
Sep
16
comment F# missing type constraint
Why the inline version works? The compiler infers the constraints. sumBy is inline, and its constraints are propagated to the consuming function by marking it inline as well.
Sep
16
comment Why doesn't a computation expression span the finally block
As an exercise, to understand this behavior, try desugaring the workflow. You'll see how the resulting series of function calls makes this impossible.
Sep
16
answered F# missing type constraint
Sep
10
comment Records satisfying implicit interface w/o re-implementing
That's correct. There is no implicit interface implementation in F#.
Sep
10
comment Nested generic constraints in f#
Right. It's possible with .NET-style extensions (via ExtensionAttribute).
Sep
9
comment Nested generic constraints in f#
This isn't possible with F#-style extensions. You can't extend a specific case of a generic type.
Aug
28
comment How to implement automatic generalization in a simple function
You can clean up the signature by annotating the return type: let inline (/!) (a : ^a) (b : ^a) : ^a = ...
Aug
28
comment How can I cast a back to a type a value was before?
Why do you need to cast to float before calling sqrt?
1 2 3 4 5