Advertisement
Guest User

Untitled

a guest
Apr 21st, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. type IResult<A, B, C> = Result<A, (B, C)>;
  2.  
  3. pub fn one_of<I, T, Error>(list: T) -> impl Fn(I) -> IResult<I, char, Error> {
  4. Ok
  5. }
  6.  
  7. pub fn escaped<P1, P2, T, O, Input, Error>(normal: P1, control: T, escapable: P2)
  8. -> impl FnOnce(Input) -> IResult<Input, Input, Error>
  9. where
  10. P1: Fn(Input) -> IResult<Input, O, Error>,
  11. P2: Fn(Input) -> IResult<Input, O, Error>,
  12. {
  13. Ok
  14. }
  15.  
  16. fn main() {
  17. let alpha = Ok::<_, (_, ())>;
  18. escaped(alpha, '\\', one_of(""))("abcd");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement