diff --git a/README.md b/README.md index 4dcaf68..ad6ab86 100644 --- a/README.md +++ b/README.md @@ -4,3 +4,7 @@ Providing FFI files for https://github.com/purescript/purescript-strings Available mirrors: https://github.com/purescript-python/purescript-python-ffi-index + +## Note on Regex + +`Data.String.Regex` and related modules is not supported yet, please check [#3](https://github.com/purescript-python/purescript-strings.py/issues/3) for details. diff --git a/python-ffi/Data/String/CodeUnits.py b/python-ffi/Data/String/CodeUnits.py index 328c749..fd93825 100644 --- a/python-ffi/Data/String/CodeUnits.py +++ b/python-ffi/Data/String/CodeUnits.py @@ -63,6 +63,10 @@ def _indexOfStartingAtImpl(just, nothing, x, startAt, s): i = s.find(x, startAt) return nothing if i == -1 else just(i) +def _indexOfStartingAt(just): + return lambda nothing: lambda x: lambda startAt: lambda s: _indexOfStartingAtImpl( + just, nothing, x, startAt, s +) globals()[ "_indexOf'"