Skip to content

coloredmarble/pipey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

this is a relatively shitty clone of tap but in 3 lines (for readability)

made this because i am bored as fuck

tap = access the value temporarily. and return it
pipe = access value and return whatever
poof = like "pipe". marks the fact that the value will be dropped (all returns are ignored). this allows chaining multiple statements
btw = wawa

usage:

use pipey::Pipey;
fn main(){
    // the value is created
    (10)
    // this will allow temporary access to the value
    .tap(|n| println!("value before adding 10 to it is {n}"))
    .btw(|| println!("im gay")) // uhhhhh do something unrelated
    // this will create another value. using the previous one
    .pipe(|n| n + 10)
    // the next function call will be the last to use this value!
    .poof(|n| println!("the value is {n}"));
    // the value is dropped. not leaving a mark, you will be the last to remember it, and then it will be gone again, forever
}

Releases

No releases published

Packages

No packages published

Languages