Created
August 31, 2022 09:07
-
-
Save awalterschulze/0c23d9cc5a1174b923e5f55e388075d9 to your computer and use it in GitHub Desktop.
medium-derivative-of-a-regex-derive-answer-5.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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