Skip to content

Commit

Permalink
Add example comment hinting at language features added in #25
Browse files Browse the repository at this point in the history
  • Loading branch information
regexident committed Nov 12, 2024
1 parent 1a15c67 commit 4b9a2d2
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion ascent/examples/ascent_generic_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,27 @@ use ascent::ascent;
pub struct Node(&'static str);

ascent! {
struct AscentProgram<N> where N: Clone + Eq + Hash;
struct AscentProgram<N: Clone + Eq + Hash>;

// Or alternatively (and with the same semantics!):
// struct AscentProgram<N> where N: Clone + Eq + Hash;

// If you want to keep the trait bounds out of the program's
// type signature and limit them to its `impl` blocks,
// you could alternatively specify the program's type like this:
//
// struct AscentProgram<N>;
// impl<N> AscentProgram<N: Clone + Eq + Hash>;
//
// Or alternatively (and with the same semantics!):
//
// struct AscentProgram<N>;
// impl<N> AscentProgram<N> where N: Clone + Eq + Hash;

// Where desirable you could even do a mix of both:
//
// struct AscentProgram<N: Eq + Hash>;
// impl<N> AscentProgram<N: Clone + Eq + Hash>;

// Facts:

Expand Down

0 comments on commit 4b9a2d2

Please sign in to comment.