I try to use different Scala implementations of "C # -like yield returns" (ie) with " Private DF permutations [T] (S: Vector [T]) = {Def swap (I: IT, J: IT) {Well TMP = S (I) S.set (I, s.get (j)) s.set (j, tmp)} iterator [vector [t]] {DRF generated (left: IT, right: IT): Unit @ CPS [[Vector [ T]]] = (if (left and =; = right) yield attribute (s) for other { (Left, right) (i & lt; - left to right) {swap (left, i) generate (left + 1, right) swap (left, i)}}} (0, s.size-1)}}
but this code is compiled with error:
Error: No method method for foreach parameters: (F: (int) => U) is present in the unit so that the arguments can be applied to (= int) => unit @ util.continuations.package.cps [ru.ispras.texterra.nlp .GHMMDisambiguator.Iteration [Vector [T]]] ) --- Because --- the type of argument expression, with formal parameter type Shall not; Found: (int) = & gt; Unit @UsingConnectIn package.cps [ru.ispras.texterra.nlp.GHMMDisambiguator.Iteration [Vector [T]]] Required: (Int) = & gt; (I & lt; - from left to right) { As I have understood that I () => For all types of code, enter the unit , not () => Unit @ side-annotation . How can I do this?
This problem is very common, but I did not get any mention in the internet.
If you are using the iterator type from the linked example , Then it is possible that your generate method
unit @ cps [altration [vector [t]], iftar [vector [t]] < / Code> P> I am afraid that I have not had much experience with this stuff, but it seems as if you were to call within iterator Two (same) question Arguments doors should the annotations.
Comments
Post a Comment