Tidal icon indicating copy to clipboard operation
Tidal copied to clipboard

Pattern String doesn't work with special chars like "-" or "#"

Open thgrund opened this issue 1 year ago • 4 comments

I was wondering why there is this restriction to not use i.e. "-" or "#" for a Pattern String:

"-12" :: Pattern String

Is this intended or a bug? Or should be possible to use "-" but not "#"? Why are these restrictions for a Pattern String?

And is there a way to customize this? To create a pattern directly with pure and VS or to use cS with those characters is not a problem at all:

filterJust $ pure $ getS (VS "-asd")
-- (0>1)|"-asd"

I am trying to achieve something like this:

"[-1#sd 3#it]" :: Pattern String
-- (0>1/2) | "-1#sd"
-- (1/2>1) | "3#it"

I use something similar to parse a string and use custom identifiers to apply custom functions on an other pattern. Making these custom identifiers usable within a pattern would be really helpful.

thgrund avatar Mar 02 '23 18:03 thgrund