Skip to content

Instantly share code, notes, and snippets.

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 awalterschulze/0c23d9cc5a1174b923e5f55e388075d9 to your computer and use it in GitHub Desktop.
Save awalterschulze/0c23d9cc5a1174b923e5f55e388075d9 to your computer and use it in GitHub Desktop.
medium-derivative-of-a-regex-derive-answer-5.hs
derive "∅*b" 'b'
= derive "∅*" 'b' `concat` "b"
`or`
derive "b" 'b'
= derive "∅" 'b' `concat` "∅*" `concat` "b"
`or`
derive "b" 'b'
= "∅" `concat` "∅*" `concat` "b"
`or`
"ε"
= "∅∅*b|ε"
= "ε"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment