Skip to content

Commit f2e40c0

Browse files
committed
Merge branch 'compiler/0.12' into nonemptyarray
2 parents 1f8411d + d6c6b58 commit f2e40c0

File tree

13 files changed

+55
-54
lines changed

13 files changed

+55
-54
lines changed

bower.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717
"package.json"
1818
],
1919
"dependencies": {
20-
"purescript-either": "^3.0.0",
21-
"purescript-gen": "^1.1.0",
22-
"purescript-maybe": "^3.0.0",
23-
"purescript-partial": "^1.2.0",
24-
"purescript-unfoldable": "^3.0.0",
25-
"purescript-arrays": "^4.3.0",
26-
"purescript-integers": "^3.2.0"
20+
"purescript-either": "#compiler/0.12",
21+
"purescript-gen": "#compiler/0.12",
22+
"purescript-maybe": "#compiler/0.12",
23+
"purescript-partial": "#compiler/0.12",
24+
"purescript-unfoldable": "#compiler/0.12",
25+
"purescript-arrays": "#compiler/0.12",
26+
"purescript-integers": "#compiler/0.12"
2727
},
2828
"devDependencies": {
29-
"purescript-assert": "^3.0.0",
30-
"purescript-console": "^3.0.0",
31-
"purescript-minibench": "^1.0.1"
29+
"purescript-assert": "#compiler/0.12",
30+
"purescript-console": "#compiler/0.12",
31+
"purescript-minibench": "#compiler/0.12"
3232
}
3333
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"clean": "rimraf output && rimraf .pulp-cache",
55
"build": "eslint src && pulp build -- --censor-lib --strict",
66
"test": "pulp test",
7-
87
"bench:build": "purs compile 'bench/**/*.purs' 'src/**/*.purs' 'bower_components/*/src/**/*.purs'",
98
"bench:run": "node --expose-gc -e 'require(\"./output/Bench.Main/index.js\").main()'",
109
"bench": "npm run bench:build && npm run bench:run"

src/Data/String/Regex.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ exports._match = function (just) {
4646
return function (r) {
4747
return function (s) {
4848
var m = s.match(r);
49-
if (m == null) {
49+
if (m == null || m.length === 0) {
5050
return nothing;
5151
} else {
5252
for (var i = 0; i < m.length; i++) {

src/Data/String/Regex.purs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ module Data.String.Regex
1818

1919
import Prelude
2020

21+
import Data.Array.NonEmpty (NonEmptyArray)
2122
import Data.Either (Either(..))
2223
import Data.Maybe (Maybe(..))
2324
import Data.String (Pattern(..), contains)
@@ -82,13 +83,13 @@ foreign import _match
8283
-> (forall r. Maybe r)
8384
-> Regex
8485
-> String
85-
-> Maybe (Array (Maybe String))
86+
-> Maybe (NonEmptyArray (Maybe String))
8687

8788
-- | Matches the string against the `Regex` and returns an array of matches
8889
-- | if there were any. Each match has type `Maybe String`, where `Nothing`
8990
-- | represents an unmatched optional capturing group.
9091
-- | See [reference](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match).
91-
match :: Regex -> String -> Maybe (Array (Maybe String))
92+
match :: Regex -> String -> Maybe (NonEmptyArray (Maybe String))
9293
match = _match Just Nothing
9394

9495
-- | Replaces occurences of the `Regex` with the first string. The replacement

src/Data/String/Regex/Flags.purs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ module Data.String.Regex.Flags where
33
import Prelude
44

55
import Control.MonadPlus (guard)
6-
7-
import Data.Monoid (class Monoid)
86
import Data.String (joinWith)
97

108
type RegexFlagsRec =

test/Test/Data/Char.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ module Test.Data.Char (testChar) where
22

33
import Prelude (Unit, (==), ($), discard)
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Console (CONSOLE, log)
5+
import Effect (Effect)
6+
import Effect.Console (log)
77

88
import Data.Char
99

10-
import Test.Assert (ASSERT, assert)
10+
import Test.Assert (assert)
1111

12-
testChar :: forall eff. Eff (console :: CONSOLE, assert :: ASSERT | eff) Unit
12+
testChar :: Effect Unit
1313
testChar = do
1414
log "toCharCode"
1515
assert $ toCharCode 'a' == 97

test/Test/Data/String.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ module Test.Data.String (testString) where
22

33
import Prelude (Unit, Ordering(..), (==), ($), discard, negate, not, (/=), (&&))
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Console (CONSOLE, log)
5+
import Effect (Effect)
6+
import Effect.Console (log)
77

88
import Data.Maybe (Maybe(..), isNothing, maybe)
99
import Data.String
1010

11-
import Test.Assert (ASSERT, assert)
11+
import Test.Assert (assert)
1212

13-
testString :: forall eff. Eff (console :: CONSOLE, assert :: ASSERT | eff) Unit
13+
testString :: Effect Unit
1414
testString = do
1515
log "charAt"
1616
assert $ charAt 0 "" == Nothing

test/Test/Data/String/CaseInsensitive.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ module Test.Data.String.CaseInsensitive (testCaseInsensitiveString) where
22

33
import Prelude (Unit, (==), ($), discard, compare, Ordering(..))
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Console (CONSOLE, log)
5+
import Effect (Effect)
6+
import Effect.Console (log)
77

88
import Data.String.CaseInsensitive
99

10-
import Test.Assert (ASSERT, assert)
10+
import Test.Assert (assert)
1111

12-
testCaseInsensitiveString :: forall eff. Eff (console :: CONSOLE, assert :: ASSERT | eff) Unit
12+
testCaseInsensitiveString :: Effect Unit
1313
testCaseInsensitiveString = do
1414
log "equality"
1515
assert $ CaseInsensitiveString "aB" == CaseInsensitiveString "AB"

test/Test/Data/String/CodePoints.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ module Test.Data.String.CodePoints (testStringCodePoints) where
22

33
import Prelude
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Console (CONSOLE, log)
5+
import Effect (Effect)
6+
import Effect.Console (log)
77

88
import Data.Char (fromCharCode)
99
import Data.Maybe (Maybe(..), isNothing, maybe)
1010
import Data.String.CodePoints
1111

12-
import Test.Assert (ASSERT, assert)
12+
import Test.Assert (assert)
1313

1414
str :: String
1515
str = "a\xDC00\xD800\xD800\x16805\x16A06\&z"
1616

17-
testStringCodePoints :: forall eff. Eff (console :: CONSOLE, assert :: ASSERT | eff) Unit
17+
testStringCodePoints :: Effect Unit
1818
testStringCodePoints = do
1919
log "show"
2020
assert $ map show (codePointAt 0 str) == Just "(CodePoint 0x61)"

test/Test/Data/String/NonEmpty.purs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ module Test.Data.String.NonEmpty (testNonEmptyString) where
22

33
import Data.String.NonEmpty
44

5-
import Control.Monad.Eff (Eff)
6-
import Control.Monad.Eff.Console (CONSOLE, log)
75
import Data.Array.NonEmpty as NEA
86
import Data.Array.Partial as AP
97
import Data.Foldable (class Foldable, foldl)
108
import Data.Maybe (Maybe(..), fromJust, isNothing, maybe)
119
import Data.Semigroup.Foldable (class Foldable1, foldMap1Default)
10+
import Effect (Effect)
11+
import Effect.Console (log)
1212
import Partial.Unsafe (unsafePartial)
1313
import Prelude (class Functor, Ordering(..), Unit, append, discard, negate, not, ($), (&&), (/=), (==))
14-
import Test.Assert (ASSERT, assert)
14+
import Test.Assert (assert)
1515

16-
testNonEmptyString :: forall eff. Eff (console :: CONSOLE, assert :: ASSERT | eff) Unit
16+
testNonEmptyString :: Effect Unit
1717
testNonEmptyString = do
1818
log "fromString"
1919
assert $ fromString "" == Nothing

0 commit comments

Comments
 (0)