Daniel

Texas

2d
comment Infer generic constraints with explicitly specified generic parameters
No, h still won't be generic, but removing g reveals the true behavior. I was just pointing out that the type parameter isn't being completely ignored.
2d
answered Infer generic constraints with explicitly specified generic parameters
Feb
4
comment F#: Substitute to .Replace("oldValue","newValue")
If you combine this with FuleSnabel's isVowel function, it would be the best of both world's, IMO: String.collect (function c when isVowel c -> string c | c -> sprintf "%co%c" c c)
Jan
30
awarded Nice Question
Jan
25
awarded Enlightened
Jan
25
awarded Nice Answer
Jan
20
comment F# code to check whether there are three same digits within a given number
It's not a compiler optimization. It's simply the behavior of IEnumerable<T>. It works the same in other .NET languages.
Jan
20
comment F# code to check whether there are three same digits within a given number
Once the first element passes filter, isEmpty will see it and return false. In the case isEmpty returns true, yes, the entire sequence will have been evaluated. But it would be no different with your snippet using exists.
Jan
20
comment F# code to check whether there are three same digits within a given number
@stt106: Actually, that isn't an improvement because sequences are evaluated lazily. That is, once an element makes it past Seq.filter and is evaluated by Seq.isEmpty, the expression returns.
Jan
13
comment F# - printfn Guid
Also, a third option: %O.
Jan
7
comment Why do I have the feeling my F# code could be more concise
Remove comments for instant 20% reduction. :)
Jan
5
answered Returning arrays of different dimensions from one function; is it possible in F#?
Jan
4
answered F# code to check whether there are three same digits within a given number
Nov
13
awarded Popular Question
Nov
11
comment Handling Null Values in F#
@Maslow: Updated. Thanks.
Nov
11
revised Handling Null Values in F#
added 312 characters in body
Nov
10
comment converting an enum to a list or sequence or generic collection type in F#
@KaseySpeakman No worries. It's quite subtle behavior.
Nov
10
comment converting an enum to a list or sequence or generic collection type in F#
Handling properties that return a value type is an edge case? The library could be written differently indeed.
Nov
10
answered parse log files with f#
Nov
10
comment converting an enum to a list or sequence or generic collection type in F#
The key difference between our fiddles is that mine is inspecting a value type property and yours a reference type property. C# auto-inserts the boxing conversion for value types, but not for reference types. F# requires explicit boxing for both. A library that uses expressions in this way should be able to handle the conversion, otherwise it doesn't support value type properties. If the support is there, F# is on par with C# for this usage.
1 2 3 4 5