We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Describe the bug After reading https://code.haxe.org/category/abstract-types/pipe.html I was about to try the example. However, it doesn't properly format long pipe expressions:
Input file
abstract Pipe<T>(T) to T { public inline function new(s:T) { this = s; } @:op(A | B) public inline function pipe1<U>(fn:T->U):Pipe<U> { return new Pipe(fn(this)); } @:op(A | B) public inline function pipe2<A, B>(fn:T->A->B):Pipe<A->B> { return new Pipe(fn.bind(this)); } @:op(A | B) public inline function pipe3<A, B, C>(fn:T->A->B->C):Pipe<A->B->C> { return new Pipe(fn.bind(this)); } @:op(A | B) public inline function pipe4<A, B, C, D>(fn:T->A->B->C->D):Pipe<A->B->C->D> { return new Pipe(fn.bind(this)); } } inline function addWorld(str:String):String { return str + " world!"; } inline function capitalize(str:String):String { return str.toUpperCase(); } inline function count(str:String):Int { return str.length; } function main() { // function call as argument version var nestedHelloWorld = capitalize(addWorld("Hello")); trace(nestedHelloWorld); // HELLO WORLD! // update variable version var hello = "Hello"; hello = addWorld(hello); hello = capitalize(hello); trace(hello); // HELLO WORLD! // piped version var helloWorld:String = new Pipe("Hello") | addWorld | capitalize; trace(helloWorld); // HELLO WORLD! // piped version changing type from String to Int var helloWorldCount:Int = new Pipe("Hello") | addWorld | capitalize | count; trace(helloWorldCount / 2); // 6 }
Broken output
Expected output
(Note at the end, the piped versions are correctly indented, just like in the docs example).
Optional: hxformat.json
{} // Not customized
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
After reading https://code.haxe.org/category/abstract-types/pipe.html I was about to try the example. However, it doesn't properly format long pipe expressions:
Input file
Broken output
Expected output
(Note at the end, the piped versions are correctly indented, just like in the docs example).
Optional: hxformat.json
{} // Not customized
The text was updated successfully, but these errors were encountered: