Skip to content

Instantly share code, notes, and snippets.



Last active Apr 21, 2021
What would you like to do?
Haxe Simple Pipe Example
import haxe.Rest;
function main() {
var result = pipe('A',
(val:String) -> val.toUpperCase(),
(val2:String) -> val2 += " " + "World");
trace(result); //A World
//Dynamic Piping Function
function pipe<T>(val:T, ...fns:T->Any) {
for(fn in fns) {
val = fn(val);
return val;

This comment has been minimized.

Copy link
Owner Author

@KinoAR KinoAR commented Apr 21, 2021

You can try out the example pipe here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment