infix_fn 0.1.1

Procedural macro used to make infix function calls similarly to Haskell's syntax with pound (#) instead of backticks (`)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![doc = include_str!("../README.md")]

mod prelude;
mod utils;

use prelude::*;

#[proc_macro]
pub fn infix(input: TokenStream) -> TokenStream {
    let infix = parse_macro_input!(input as Infix);

    let (lhs, fn_ident, rhs) = (infix.lhs, infix.fn_ident, infix.rhs);

    quote! {
        #fn_ident(#lhs, #rhs)
    }
    .into()
}