type-inference
C# generics: failure of generic type inference means I cannot use anonymous type
I have a class Exporter which has a generic method which accepts an IEnumerable<T> and creates an export document by enumerating its property values using reflection:[详细]
2023-03-09 07:23 分类:问答How do I define Lisp’s apply in Haskell?
Shouldn’t this definition be allowed in a lazy language like Haskell in which functions are curried?[详细]
2023-03-08 21:58 分类:问答What are some advantages & disadvantages of type inference in C#?
I have a coworker that is against type inference in C#. I believe most of his arguments surrounded lack of readability. My argument against that is that Visual Studio\'s intellisense features provide[详细]
2023-03-06 12:21 分类:问答OCaml explicit type signatures
In Haskell, it is considered good practice to explicitly declare the type signature of your开发者_运维问答 functions, even though it can (usually) be inferred. It seems like this isn\'t even possible[详细]
2023-03-06 03:54 分类:问答How to get the proper return type when using a filter based on type in Scala
The following doesn\'t compile. Do I need to cast the person first? object People { def all = List( new Person(\"Jack\", 33),[详细]
2023-03-04 18:04 分类:问答Troubleshooting: Why doesn't type inference fail here?
Given a type declared as shown below public cla开发者_开发知识库ss EqualityProbe<T> { public EqualityProbe( Func<T> functionToGetActualValue, T expectedValue, string probeDescription) {..[详细]
2023-02-27 11:12 分类:问答How to understand Haskell compiler messages
Good day. Here is simple \"guess number\" snippet and it contains single error, but compiler makes it really hard to undertstand what is wrong:[详细]
2023-02-27 10:45 分类:问答Should Scala's map() behave differently when mapping to the same type?
In the Scala Collections framework, I think there are some behaviors that are counterintuitive when using map().[详细]
2023-02-24 22:22 分类:问答Populate a dictionary recursively?
I\'m testing the following code to populate a dictionary recursively. However the type inferencedoes not seem to recognize the dictionary type.I\'ve tried using a type annotation but that did not seem[详细]
2023-02-21 06:34 分类:问答Type inference failing (CS0246) compiling from MSBuild 3.5 but not Visual Studio
We just hit an interesting error on our build server when compiling some recent changes from the command line:[详细]
2023-02-20 12:27 分类:问答