You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently StringLike is implemented by String and looks like it was in mind to only allowe structures which contain some Chars.
But I think it could be easily changed to support arbitrary containers of arbitrary data.
for example one might define some sumtype Data Color = Red | Blue| Orange ... and have wants to parse List Color into some other structure or maybe even in itself and just validate that colors in the List are in correct order or whatever.
But the StringLike is limiting this kind of use.
What i think is that the class could be changed to:
I'm not sure I like the type of indexOf there. I'd rather use a fundep for the String -> Char dependency, and break indexOf out into its own class if need be.
Currently StringLike is implemented by String and looks like it was in mind to only allowe structures which contain some Chars.
But I think it could be easily changed to support arbitrary containers of arbitrary data.
for example one might define some sumtype
Data Color = Red | Blue| Orange ...
and have wants to parseList Color
into some other structure or maybe even in itself and just validate that colors in the List are in correct order or whatever.But the StringLike is limiting this kind of use.
What i think is that the class could be changed to:
This way one could implement StringLike for List/Array ... and for example
anyChar
will change toThe text was updated successfully, but these errors were encountered: