Skip to content

Commit eefc8b0

Browse files
authored
Remove primes from foreign modules exports (#121)
1 parent 1c7f254 commit eefc8b0

File tree

4 files changed

+20
-17
lines changed

4 files changed

+20
-17
lines changed

src/Data/String/CodeUnits.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ exports._indexOf = function (just) {
5353
};
5454
};
5555

56-
exports["_indexOf'"] = function (just) {
56+
exports._indexOfStartingAt = function (just) {
5757
return function (nothing) {
5858
return function (x) {
5959
return function (startAt) {
@@ -78,7 +78,7 @@ exports._lastIndexOf = function (just) {
7878
};
7979
};
8080

81-
exports["_lastIndexOf'"] = function (just) {
81+
exports._lastIndexOfStartingAt = function (just) {
8282
return function (nothing) {
8383
return function (x) {
8484
return function (startAt) {

src/Data/String/CodeUnits.purs

+4-4
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ foreign import _indexOf
188188
-- | ```
189189
-- |
190190
indexOf' :: Pattern -> Int -> String -> Maybe Int
191-
indexOf' = _indexOf' Just Nothing
191+
indexOf' = _indexOfStartingAt Just Nothing
192192

193-
foreign import _indexOf'
193+
foreign import _indexOfStartingAt
194194
:: (forall a. a -> Maybe a)
195195
-> (forall a. Maybe a)
196196
-> Pattern
@@ -228,9 +228,9 @@ foreign import _lastIndexOf
228228
-- | ```
229229
-- |
230230
lastIndexOf' :: Pattern -> Int -> String -> Maybe Int
231-
lastIndexOf' = _lastIndexOf' Just Nothing
231+
lastIndexOf' = _lastIndexOfStartingAt Just Nothing
232232

233-
foreign import _lastIndexOf'
233+
foreign import _lastIndexOfStartingAt
234234
:: (forall a. a -> Maybe a)
235235
-> (forall a. Maybe a)
236236
-> Pattern

src/Data/String/Regex.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
"use strict";
22

3-
exports["showRegex'"] = function (r) {
3+
exports.showRegexImpl = function (r) {
44
return "" + r;
55
};
66

7-
exports["regex'"] = function (left) {
7+
exports.regexImpl = function (left) {
88
return function (right) {
99
return function (s1) {
1010
return function (s2) {
@@ -22,7 +22,7 @@ exports.source = function (r) {
2222
return r.source;
2323
};
2424

25-
exports["flags'"] = function (r) {
25+
exports.flagsImpl = function (r) {
2626
return {
2727
multiline: r.multiline,
2828
ignoreCase: r.ignoreCase,
@@ -67,7 +67,7 @@ exports.replace = function (r) {
6767
};
6868
};
6969

70-
exports["replace'"] = function (r) {
70+
exports.replaceBy = function (r) {
7171
return function (f) {
7272
return function (s2) {
7373
return s2.replace(r, function (match) {

src/Data/String/Regex.purs

+10-7
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import Data.String.Regex.Flags (RegexFlags(..), RegexFlagsRec)
2828
-- | Wraps Javascript `RegExp` objects.
2929
foreign import data Regex :: Type
3030

31-
foreign import showRegex' :: Regex -> String
31+
foreign import showRegexImpl :: Regex -> String
3232

3333
instance showRegex :: Show Regex where
34-
show = showRegex'
34+
show = showRegexImpl
3535

36-
foreign import regex'
36+
foreign import regexImpl
3737
:: (String -> Either String Regex)
3838
-> (Regex -> Either String Regex)
3939
-> String
@@ -43,17 +43,17 @@ foreign import regex'
4343
-- | Constructs a `Regex` from a pattern string and flags. Fails with
4444
-- | `Left error` if the pattern contains a syntax error.
4545
regex :: String -> RegexFlags -> Either String Regex
46-
regex s f = regex' Left Right s $ renderFlags f
46+
regex s f = regexImpl Left Right s $ renderFlags f
4747

4848
-- | Returns the pattern string used to construct the given `Regex`.
4949
foreign import source :: Regex -> String
5050

5151
-- | Returns the `RegexFlags` used to construct the given `Regex`.
5252
flags :: Regex -> RegexFlags
53-
flags = RegexFlags <<< flags'
53+
flags = RegexFlags <<< flagsImpl
5454

5555
-- | Returns the `RegexFlags` inner record used to construct the given `Regex`.
56-
foreign import flags' :: Regex -> RegexFlagsRec
56+
foreign import flagsImpl :: Regex -> RegexFlagsRec
5757

5858
-- | Returns the string representation of the given `RegexFlags`.
5959
renderFlags :: RegexFlags -> String
@@ -101,7 +101,10 @@ foreign import replace :: Regex -> String -> String -> String
101101
-- | Transforms occurences of the `Regex` using a function of the matched
102102
-- | substring and a list of submatch strings.
103103
-- | See the [reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter).
104-
foreign import replace' :: Regex -> (String -> Array String -> String) -> String -> String
104+
replace' :: Regex -> (String -> Array String -> String) -> String -> String
105+
replace' = replaceBy
106+
107+
foreign import replaceBy :: Regex -> (String -> Array String -> String) -> String -> String
105108

106109
foreign import _search
107110
:: (forall r. r -> Maybe r)

0 commit comments

Comments
 (0)