Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created December 31, 2011 00:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/1542246 to your computer and use it in GitHub Desktop.
Save amalloy/1542246 to your computer and use it in GitHub Desktop.
(defn- lookup-edge [edges label]
(get edges label (edges :default)))
(defn- merge-nfa-edges [& edge-maps]
(into {}
(for [label (set (mapcat keys edge-maps))]
[label (apply union
(for [edges edge-maps]
(or (lookup-edge edges label) #{})))])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment