Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [A when Sequence?(A)]
- overload getMreturn(#A) {
- alias T = SequenceElementType(A);
- return x -> A(x);
- }
- [S when Sequence?(S)]
- overload mbind(x : S, f) = algorithms.concat(fmap(f, x));
- var mreturn = getMreturn(#vectors.Vector[Int]);
- main(){
- println(mbind(array(1,2,3), (x -> mbind(array(1,2,3), y -> mreturn(x*y)))));
- }
Add Comment
Please, Sign In to add comment