type-inference
Generics: Why can't the compiler infer the type arguments in this case?
I wanted to write an extension-method that would work on dictionaries whose values were some sort of sequence. Unfortunately, the compiler can\'t seem to infer the generic arguments from my usage of t[详细]
2023-01-20 09:08 分类:问答How to implicitly convert to common super types in F# pattern matches?
Problem Summary At the moment when using f# I must explicitly coerce a value to the parent type of its type in order to get pattern matching expressions to type check correctly.I would ideally like a[详细]
2023-01-20 01:17 分类:问答Type inference with mutual recursion
I\'ve been thinking about how type inference works in the following OCaml program: let rec f x = (g x) + 5[详细]
2023-01-19 11:06 分类:问答PartialFunction type inference in Scala
Let\'s consider the following function: def printPfType[T](pf:PartialFunction[T, _])(implicit m:Manifest[T]) = {[详细]
2023-01-18 21:29 分类:问答What makes Haskell's type system more "powerful" than other languages' type systems?
Reading Disadvantages of Scala type system versus Haskell?, I have to开发者_运维技巧 ask: what is it, specifically, that makes Haskell\'s type system more powerful than other languages\' type systems[详细]
2023-01-17 23:47 分类:问答Problem understanding C# type inference as described in the language specification
The C# language specification describes type inference in Section §7.5.2. There is a detail in it that I don’t understand. Consider the following case:[详细]
2023-01-16 01:59 分类:问答Damas-Hindley-Milner type inference algorithm implementation
I\'m looking for information about the well-known Damas-Hindley-Milner algorithm to do type inference for functional languages, especially information about implementation.[详细]
2023-01-15 07:35 分类:问答Type mismatch error. F# type inference fail?
I\'m trying to write a method in F# that returns a new instance of a generic type based upon the type of a value passed into the method. In FSI:[详细]
2023-01-12 16:37 分类:问答scala type inference with _ place holder
List(\"This\",\"is\",\"Scala\").foreach(a => print(a+\" \")) compiles fine, but List(\"This\",\"is\",\"Scala\").foreach(print(_+\" \"))[详细]
2023-01-11 22:51 分类:问答F#: Why am I required to supply parameter types when overloading member functions?
Given the following code: type MyType() = static member processString (_string:string) = _string.Substring(0, 1)[详细]
2023-01-11 09:23 分类:问答