-
Notifications
You must be signed in to change notification settings - Fork 34
Closed
Description
I was quite surprised to find that the following code is not valid:
import System.OsPath (OsPath, osp, takeExtension)
data Format = Png | Jpeg
extensionType :: OsPath -> Maybe Format
extensionType path = case takeExtension path of
[osp|.png|] -> Just Png
[osp|.jpg|] -> Just Jpeg
_ -> Nothing
I can see that the osp
QuasiQuoter is implemented to only support expressions, but this kind of use case feels very natural. Especially given that it is non-trivial to construct a valid OsPath
literal.
Is there any reason why this couldn't or shouldn't be implemented? If no, then I would be more than happy to have a go at it and put together a PR.
Metadata
Metadata
Assignees
Labels
No labels