![]() ![]() : OK, so one possibility might be: for any two adjacent elements in the list, they must be (-> A B) and (-> B C) for some A, B, C. ![]() Unfortunately, #:final is not supported by Typed Racket (yet), so you can't use it here. (define (apply-steps on steps stop-symbol) You should have this function return the x and y coordinates instead of that completely necessary true, and have the caller write the output. However, this is bad practice because you are both computing something and giving output in the same function. #Typed racket mouse coordinates code)]))īy the way, if you use regular Racket, you can just use for/fold with a #:final clause to implement this function too. Yeah, I get that the point of this code is to write the coordinates. (-> A A)) = (Listof (-> A A)).Īccording to the given type, each element is a (Pairof Function Symbol), but from your function, it looks like it expects a (List Symbol Function) (this is caught of Typed Racket when I tried out your program).Īpplying the fixes, you would get: (: apply-steps (All (A) (-> A (Listof (List Symbol (-> A A))) Symbol A))) To workaround this, I suggest you changing the requirement to (List (-> A A) (-> A A). If you write it out, it involves unbounded number of type variables, depending on the length of the list! How can you even finitely specify the type?. (-> Fn Fn+1)), but I don't think Typed Racket can support this kind of things. ![]() You want it to have type (List (-> F1 F2) (-> F2 F3). The Typed Racket Guide Version 8.6.0. One of your inputs is essentially a list of functions. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |