Skip to content

Instantly share code, notes, and snippets.

@t0yv0
Created July 17, 2011 13:16
Show Gist options
  • Select an option

  • Save t0yv0/1087579 to your computer and use it in GitHub Desktop.

Select an option

Save t0yv0/1087579 to your computer and use it in GitHub Desktop.
testTNFA n =
let rep 0 p = pure 'a'
rep n p = rep (n - 1) p *> p
pat = rep n (char 'a' <|> pure 'a') *> rep n (char 'a')
in
run (compile pat) (take n (repeat 'a'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment