Daniel

Texas

20m
comment F# BinarySearch return position
A slightly cleaner way, IMO, not requiring an "impossible" case.
2d
answered Implementing delegate interface in F#
2d
revised F# missing type constraint
added 236 characters in body
2d
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.
2d
revised F# missing type constraint
added 236 characters in body
2d
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.
2d
comment Assignment to Nullable in F#
It's no more misleading than the built-in dereferencing operator, e.g.: if !myboolref then ...
2d
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.
2d
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.
2d
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?
Aug
27
comment Join() equivalent function for F# sequences
Why not wrap the built-in join function and re-order the params to better support pipelines? That's sort of what you've done, but the query expression seems unnecessary.
Aug
25
awarded Yearling
Aug
25
awarded Yearling
Aug
22
answered Assignment to Nullable in F#
Aug
21
answered Tail-recursive query string builder in F#
1 2 3 4 5