type-inference
Is it possible to place inequality constraints on haskell type variables?
Is it possible to place an inequality constraint on the typevariables of a function, à la foo :: (a ~ b) => a -> b as in GHC type family docs, except inequality rather than equality?[详细]
2023-03-25 15:47 分类:问答How can I improve Scala's type inference with type parameters that don't show up in the first parameter list?
To illustrate my point, here an example: abstract class Wrapper[A](wrapped: A) { protected def someCondition: Boolean[详细]
2023-03-25 07:16 分类:问答How to hint type inference when using static imports?
I am using junit with hamcrest in my unit tests and I came acro开发者_如何学Css a generics problem:[详细]
2023-03-24 04:43 分类:问答The relationship between auto and decltype
Is auto x = initializer; equivalent 开发者_JAVA技巧to decltype(initializer) x = initializer; or decltype((initializer)) x = initializer;[详细]
2023-03-23 22:37 分类:问答Type inferred to Nothing in Scala
When I try to compile the small example: trait Foo[A,B] { type F[_,_] def foo(): F[A,B] } class Bar[A,B] extends Foo[A,B] {[详细]
2023-03-23 21:33 分类:问答Hindley-Milner algorithm in Java
I\'m working on a simple dataflow based system (imagine it like a LabView editor/runtime) written in Java. The user can wire blocks together in an editor and I need type inference to ensure the datafl[详细]
2023-03-21 22:40 分类:问答Parametric polymorphism vs Ad-hoc polymorphism
I would like to understand the key difference between parametric polymorphism such as polymorphism of generic classes/functions in the Java/Scala/C++ languages and \"ad-hoc\" polymorphism in the Haske[详细]
2023-03-21 13:14 分类:问答Difference in Javascript validation between Eclipse Helios and Eclipse Indigo
I\'ve been experimenting with JSDT. Under Indigo, the validation has stopped complaining about unknown fields of objects. In Helios, it does.[详细]
2023-03-21 03:19 分类:问答Yet Another Value Restriction Question
In the following code Seq.generateUnique is constrained to be of type ((Assembly -> seq<Assembly>) -> seq<Assembly> -> seq<Assembly>).[详细]
2023-03-18 22:05 分类:问答Scala String vs java.lang.String - type inference
In the REPL, I define a function. Note the return type. scala> def next(i: List[String]) =i.map {\"0\" + _} ::: i.reverse.map {\"1\" + _}[详细]
2023-03-17 02:42 分类:问答