Last active
July 19, 2019 07:56
-
-
Save tonymorris/a1503d5b453eaeb03c169def99a34364 to your computer and use it in GitHub Desktop.
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
occName :: | |
HasName a => | |
Lens' a OccName | |
occName = | |
name . (\k (Name o x) -> fmap (\o' -> Name o' x) (k o)) | |
occNameWrapped :: | |
Iso' | |
OccName | |
String | |
occNameWrapped = | |
iso | |
(\(OccName s) -> s) | |
OccName | |
mkNameFrom :: | |
(String -> String) | |
-> Name | |
-> Name | |
mkNameFrom k = | |
mkName . k . view (occName . occNameWrapped) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment