#infix #syntax #haskell #calls #procedural #proc-macro #similarly

macro infix_fn

Procedural macro used to make infix function calls similarly to Haskell’s syntax with pound (#) instead of backticks (`)

2 releases

0.1.1 Feb 6, 2025
0.1.0 Feb 6, 2025

#613 in Procedural macros

Download history 250/week @ 2025-02-05 8/week @ 2025-02-12 14/week @ 2025-02-26

272 downloads per month

MIT license

4KB

Infix macro

Build IconDocs IconVersion IconLicense Icon

A very simple procedural macro used to make infix function calls similarly to Haskell's syntax (# instead of ```).

Table of contents

Example

use infix_fn::infix;

// Function definition:
fn add(lhs: i32, rhs: i32) -> i32 {
  lhs + rhs
}

// Macro usage:
let (lhs, rhs) = (6, 9);
assert_eq!(lhs + rhs, infix!(lhs # add # rhs));

Dependencies

~185–610KB
~14K SLoC