Skip to content

Commit 10a3ddc

Browse files
authoredNov 26, 2020
Merge pull request #134 from kl0tl/no-monomorphic-proxies
Replace monomorphic proxies by Type.Proxy.Proxy and polymorphic variables
2 parents 176633d + 848b330 commit 10a3ddc

File tree

3 files changed

+189
-189
lines changed

3 files changed

+189
-189
lines changed
 

‎src/Data/String/NonEmpty/Internal.purs

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Data.Maybe (Maybe(..), fromJust)
88
import Data.Semigroup.Foldable (class Foldable1)
99
import Data.String as String
1010
import Data.String.Pattern (Pattern)
11-
import Data.Symbol (class IsSymbol, SProxy, reflectSymbol)
11+
import Data.Symbol (class IsSymbol, reflectSymbol)
1212
import Prim.TypeError as TE
1313
import Unsafe.Coerce (unsafeCoerce)
1414

@@ -26,10 +26,10 @@ instance showNonEmptyString :: Show NonEmptyString where
2626
-- |
2727
-- | ``` purescript
2828
-- | something :: NonEmptyString
29-
-- | something = nes (SProxy :: SProxy "something")
29+
-- | something = nes (Proxy :: Proxy "something")
3030
-- | ```
3131
class MakeNonEmpty (s :: Symbol) where
32-
nes :: SProxy s -> NonEmptyString
32+
nes :: forall proxy. proxy s -> NonEmptyString
3333

3434
instance makeNonEmptyBad :: TE.Fail (TE.Text "Cannot create an NonEmptyString from an empty Symbol") => MakeNonEmpty "" where
3535
nes _ = NonEmptyString ""

‎test/Test/Data/String/NonEmpty.purs

+69-69
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import Data.Array.NonEmpty as NEA
66
import Data.Maybe (Maybe(..), fromJust)
77
import Data.String.NonEmpty (Pattern(..), nes)
88
import Data.String.NonEmpty as NES
9-
import Data.Symbol (SProxy(..))
109
import Effect (Effect)
1110
import Effect.Console (log)
1211
import Partial.Unsafe (unsafePartial)
1312
import Test.Assert (assert, assertEqual)
13+
import Type.Proxy (Proxy(..))
1414

1515
testNonEmptyString :: Effect Unit
1616
testNonEmptyString = do
@@ -22,7 +22,7 @@ testNonEmptyString = do
2222
}
2323
assertEqual
2424
{ actual: NES.fromString "hello"
25-
, expected: Just (nes (SProxy :: SProxy "hello"))
25+
, expected: Just (nes (Proxy :: Proxy "hello"))
2626
}
2727

2828
log "toString"
@@ -33,136 +33,136 @@ testNonEmptyString = do
3333

3434
log "appendString"
3535
assertEqual
36-
{ actual: NES.appendString (nes (SProxy :: SProxy "Hello")) " world"
37-
, expected: nes (SProxy :: SProxy "Hello world")
36+
{ actual: NES.appendString (nes (Proxy :: Proxy "Hello")) " world"
37+
, expected: nes (Proxy :: Proxy "Hello world")
3838
}
3939
assertEqual
40-
{ actual: NES.appendString (nes (SProxy :: SProxy "Hello")) ""
41-
, expected: nes (SProxy :: SProxy "Hello")
40+
{ actual: NES.appendString (nes (Proxy :: Proxy "Hello")) ""
41+
, expected: nes (Proxy :: Proxy "Hello")
4242
}
4343

4444
log "prependString"
4545
assertEqual
46-
{ actual: NES.prependString "be" (nes (SProxy :: SProxy "fore"))
47-
, expected: nes (SProxy :: SProxy "before")
46+
{ actual: NES.prependString "be" (nes (Proxy :: Proxy "fore"))
47+
, expected: nes (Proxy :: Proxy "before")
4848
}
4949
assertEqual
50-
{ actual: NES.prependString "" (nes (SProxy :: SProxy "fore"))
51-
, expected: nes (SProxy :: SProxy "fore")
50+
{ actual: NES.prependString "" (nes (Proxy :: Proxy "fore"))
51+
, expected: nes (Proxy :: Proxy "fore")
5252
}
5353

5454
log "contains"
55-
assert $ NES.contains (Pattern "") (nes (SProxy :: SProxy "abcd"))
56-
assert $ NES.contains (Pattern "bc") (nes (SProxy :: SProxy "abcd"))
57-
assert $ not NES.contains (Pattern "cb") (nes (SProxy :: SProxy "abcd"))
58-
assert $ NES.contains (Pattern "needle") (nes (SProxy :: SProxy "haystack with needle"))
59-
assert $ not NES.contains (Pattern "needle") (nes (SProxy :: SProxy "haystack"))
55+
assert $ NES.contains (Pattern "") (nes (Proxy :: Proxy "abcd"))
56+
assert $ NES.contains (Pattern "bc") (nes (Proxy :: Proxy "abcd"))
57+
assert $ not NES.contains (Pattern "cb") (nes (Proxy :: Proxy "abcd"))
58+
assert $ NES.contains (Pattern "needle") (nes (Proxy :: Proxy "haystack with needle"))
59+
assert $ not NES.contains (Pattern "needle") (nes (Proxy :: Proxy "haystack"))
6060

6161
log "localeCompare"
6262
assertEqual
63-
{ actual: NES.localeCompare (nes (SProxy :: SProxy "a")) (nes (SProxy :: SProxy "a"))
63+
{ actual: NES.localeCompare (nes (Proxy :: Proxy "a")) (nes (Proxy :: Proxy "a"))
6464
, expected: EQ
6565
}
6666
assertEqual
67-
{ actual: NES.localeCompare (nes (SProxy :: SProxy "a")) (nes (SProxy :: SProxy "b"))
67+
{ actual: NES.localeCompare (nes (Proxy :: Proxy "a")) (nes (Proxy :: Proxy "b"))
6868
, expected: LT
6969
}
7070
assertEqual
71-
{ actual: NES.localeCompare (nes (SProxy :: SProxy "b")) (nes (SProxy :: SProxy "a"))
71+
{ actual: NES.localeCompare (nes (Proxy :: Proxy "b")) (nes (Proxy :: Proxy "a"))
7272
, expected: GT
7373
}
7474

7575
log "replace"
7676
assertEqual
77-
{ actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes (SProxy :: SProxy "!"))) (nes (SProxy :: SProxy "abc"))
78-
, expected: nes (SProxy :: SProxy "a!c")
77+
{ actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abc"))
78+
, expected: nes (Proxy :: Proxy "a!c")
7979
}
8080
assertEqual
81-
{ actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes (SProxy :: SProxy "!"))) (nes (SProxy :: SProxy "abbc"))
82-
, expected: nes (SProxy :: SProxy "a!bc")
81+
{ actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abbc"))
82+
, expected: nes (Proxy :: Proxy "a!bc")
8383
}
8484
assertEqual
85-
{ actual: NES.replace (Pattern "d") (NES.NonEmptyReplacement (nes (SProxy :: SProxy "!"))) (nes (SProxy :: SProxy "abc"))
86-
, expected: nes (SProxy :: SProxy "abc")
85+
{ actual: NES.replace (Pattern "d") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abc"))
86+
, expected: nes (Proxy :: Proxy "abc")
8787
}
8888

8989
log "replaceAll"
9090
assertEqual
91-
{ actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes (SProxy :: SProxy "!"))) (nes (SProxy :: SProxy "a[b]c"))
92-
, expected: nes (SProxy :: SProxy "a!c")
91+
{ actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "a[b]c"))
92+
, expected: nes (Proxy :: Proxy "a!c")
9393
}
9494
assertEqual
95-
{ actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes (SProxy :: SProxy "!"))) (nes (SProxy :: SProxy "a[b]c[b]"))
96-
, expected: nes (SProxy :: SProxy "a!c!")
95+
{ actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "a[b]c[b]"))
96+
, expected: nes (Proxy :: Proxy "a!c!")
9797
}
9898
assertEqual
99-
{ actual: NES.replaceAll (Pattern "x") (NES.NonEmptyReplacement (nes (SProxy :: SProxy "!"))) (nes (SProxy :: SProxy "abc"))
100-
, expected: nes (SProxy :: SProxy "abc")
99+
{ actual: NES.replaceAll (Pattern "x") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abc"))
100+
, expected: nes (Proxy :: Proxy "abc")
101101
}
102102

103103
log "stripPrefix"
104104
assertEqual
105-
{ actual: NES.stripPrefix (Pattern "") (nes (SProxy :: SProxy "abc"))
106-
, expected: Just (nes (SProxy :: SProxy "abc"))
105+
{ actual: NES.stripPrefix (Pattern "") (nes (Proxy :: Proxy "abc"))
106+
, expected: Just (nes (Proxy :: Proxy "abc"))
107107
}
108108
assertEqual
109-
{ actual: NES.stripPrefix (Pattern "a") (nes (SProxy :: SProxy "abc"))
110-
, expected: Just (nes (SProxy :: SProxy "bc"))
109+
{ actual: NES.stripPrefix (Pattern "a") (nes (Proxy :: Proxy "abc"))
110+
, expected: Just (nes (Proxy :: Proxy "bc"))
111111
}
112112
assertEqual
113-
{ actual: NES.stripPrefix (Pattern "abc") (nes (SProxy :: SProxy "abc"))
113+
{ actual: NES.stripPrefix (Pattern "abc") (nes (Proxy :: Proxy "abc"))
114114
, expected: Nothing
115115
}
116116
assertEqual
117-
{ actual: NES.stripPrefix (Pattern "!") (nes (SProxy :: SProxy "abc"))
117+
{ actual: NES.stripPrefix (Pattern "!") (nes (Proxy :: Proxy "abc"))
118118
, expected: Nothing
119119
}
120120
assertEqual
121-
{ actual: NES.stripPrefix (Pattern "http:") (nes (SProxy :: SProxy "http://purescript.org"))
122-
, expected: Just (nes (SProxy :: SProxy "//purescript.org"))
121+
{ actual: NES.stripPrefix (Pattern "http:") (nes (Proxy :: Proxy "http://purescript.org"))
122+
, expected: Just (nes (Proxy :: Proxy "//purescript.org"))
123123
}
124124
assertEqual
125-
{ actual: NES.stripPrefix (Pattern "http:") (nes (SProxy :: SProxy "https://purescript.org"))
125+
{ actual: NES.stripPrefix (Pattern "http:") (nes (Proxy :: Proxy "https://purescript.org"))
126126
, expected: Nothing
127127
}
128128
assertEqual
129-
{ actual: NES.stripPrefix (Pattern "Hello!") (nes (SProxy :: SProxy "Hello!"))
129+
{ actual: NES.stripPrefix (Pattern "Hello!") (nes (Proxy :: Proxy "Hello!"))
130130
, expected: Nothing
131131
}
132132

133133
log "stripSuffix"
134134
assertEqual
135-
{ actual: NES.stripSuffix (Pattern ".exe") (nes (SProxy :: SProxy "purs.exe"))
136-
, expected: Just (nes (SProxy :: SProxy "purs"))
135+
{ actual: NES.stripSuffix (Pattern ".exe") (nes (Proxy :: Proxy "purs.exe"))
136+
, expected: Just (nes (Proxy :: Proxy "purs"))
137137
}
138138
assertEqual
139-
{ actual: NES.stripSuffix (Pattern ".exe") (nes (SProxy :: SProxy "purs"))
139+
{ actual: NES.stripSuffix (Pattern ".exe") (nes (Proxy :: Proxy "purs"))
140140
, expected: Nothing
141141
}
142142
assertEqual
143-
{ actual: NES.stripSuffix (Pattern "Hello!") (nes (SProxy :: SProxy "Hello!"))
143+
{ actual: NES.stripSuffix (Pattern "Hello!") (nes (Proxy :: Proxy "Hello!"))
144144
, expected: Nothing
145145
}
146146

147147
log "toLower"
148148
assertEqual
149-
{ actual: NES.toLower (nes (SProxy :: SProxy "bAtMaN"))
150-
, expected: nes (SProxy :: SProxy "batman")
149+
{ actual: NES.toLower (nes (Proxy :: Proxy "bAtMaN"))
150+
, expected: nes (Proxy :: Proxy "batman")
151151
}
152152

153153
log "toUpper"
154154
assertEqual
155-
{ actual: NES.toUpper (nes (SProxy :: SProxy "bAtMaN"))
156-
, expected: nes (SProxy :: SProxy "BATMAN")
155+
{ actual: NES.toUpper (nes (Proxy :: Proxy "bAtMaN"))
156+
, expected: nes (Proxy :: Proxy "BATMAN")
157157
}
158158

159159
log "trim"
160160
assertEqual
161-
{ actual: NES.trim (nes (SProxy :: SProxy " abc "))
162-
, expected: Just (nes (SProxy :: SProxy "abc"))
161+
{ actual: NES.trim (nes (Proxy :: Proxy " abc "))
162+
, expected: Just (nes (Proxy :: Proxy "abc"))
163163
}
164164
assertEqual
165-
{ actual: NES.trim (nes (SProxy :: SProxy " \n"))
165+
{ actual: NES.trim (nes (Proxy :: Proxy " \n"))
166166
, expected: Nothing
167167
}
168168

@@ -172,48 +172,48 @@ testNonEmptyString = do
172172
, expected: ""
173173
}
174174
assertEqual
175-
{ actual: NES.joinWith "" [nes (SProxy :: SProxy "a"), nes (SProxy :: SProxy "b")]
175+
{ actual: NES.joinWith "" [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b")]
176176
, expected: "ab"
177177
}
178178
assertEqual
179-
{ actual: NES.joinWith "--" [nes (SProxy :: SProxy "a"), nes (SProxy :: SProxy "b"), nes (SProxy :: SProxy "c")]
179+
{ actual: NES.joinWith "--" [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b"), nes (Proxy :: Proxy "c")]
180180
, expected: "a--b--c"
181181
}
182182

183183
log "join1With"
184184
assertEqual
185-
{ actual: NES.join1With "" (nea [nes (SProxy :: SProxy "a"), nes (SProxy :: SProxy "b")])
186-
, expected: nes (SProxy :: SProxy "ab")
185+
{ actual: NES.join1With "" (nea [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b")])
186+
, expected: nes (Proxy :: Proxy "ab")
187187
}
188188
assertEqual
189-
{ actual: NES.join1With "--" (nea [nes (SProxy :: SProxy "a"), nes (SProxy :: SProxy "b"), nes (SProxy :: SProxy "c")])
190-
, expected: nes (SProxy :: SProxy "a--b--c")
189+
{ actual: NES.join1With "--" (nea [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b"), nes (Proxy :: Proxy "c")])
190+
, expected: nes (Proxy :: Proxy "a--b--c")
191191
}
192192
assertEqual
193-
{ actual: NES.join1With ", " (nea [nes (SProxy :: SProxy "apple"), nes (SProxy :: SProxy "banana")])
194-
, expected: nes (SProxy :: SProxy "apple, banana")
193+
{ actual: NES.join1With ", " (nea [nes (Proxy :: Proxy "apple"), nes (Proxy :: Proxy "banana")])
194+
, expected: nes (Proxy :: Proxy "apple, banana")
195195
}
196196
assertEqual
197-
{ actual: NES.join1With "" (nea [nes (SProxy :: SProxy "apple"), nes (SProxy :: SProxy "banana")])
198-
, expected: nes (SProxy :: SProxy "applebanana")
197+
{ actual: NES.join1With "" (nea [nes (Proxy :: Proxy "apple"), nes (Proxy :: Proxy "banana")])
198+
, expected: nes (Proxy :: Proxy "applebanana")
199199
}
200200

201201
log "joinWith1"
202202
assertEqual
203-
{ actual: NES.joinWith1 (nes (SProxy :: SProxy " ")) (nea ["a", "b"])
204-
, expected: nes (SProxy :: SProxy "a b")
203+
{ actual: NES.joinWith1 (nes (Proxy :: Proxy " ")) (nea ["a", "b"])
204+
, expected: nes (Proxy :: Proxy "a b")
205205
}
206206
assertEqual
207-
{ actual: NES.joinWith1 (nes (SProxy :: SProxy "--")) (nea ["a", "b", "c"])
208-
, expected: nes (SProxy :: SProxy "a--b--c")
207+
{ actual: NES.joinWith1 (nes (Proxy :: Proxy "--")) (nea ["a", "b", "c"])
208+
, expected: nes (Proxy :: Proxy "a--b--c")
209209
}
210210
assertEqual
211-
{ actual: NES.joinWith1 (nes (SProxy :: SProxy ", ")) (nea ["apple", "banana"])
212-
, expected: nes (SProxy :: SProxy "apple, banana")
211+
{ actual: NES.joinWith1 (nes (Proxy :: Proxy ", ")) (nea ["apple", "banana"])
212+
, expected: nes (Proxy :: Proxy "apple, banana")
213213
}
214214
assertEqual
215-
{ actual: NES.joinWith1 (nes (SProxy :: SProxy "/")) (nea ["a", "b", "", "c", ""])
216-
, expected: nes (SProxy :: SProxy "a/b//c/")
215+
{ actual: NES.joinWith1 (nes (Proxy :: Proxy "/")) (nea ["a", "b", "", "c", ""])
216+
, expected: nes (Proxy :: Proxy "a/b//c/")
217217
}
218218

219219
nea :: Array ~> NEA.NonEmptyArray

‎test/Test/Data/String/NonEmpty/CodeUnits.purs

+117-117
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ import Data.Enum (fromEnum)
77
import Data.Maybe (Maybe(..), fromJust)
88
import Data.String.NonEmpty (Pattern(..), nes)
99
import Data.String.NonEmpty.CodeUnits as NESCU
10-
import Data.Symbol (SProxy(..))
1110
import Effect (Effect)
1211
import Effect.Console (log)
1312
import Partial.Unsafe (unsafePartial)
1413
import Test.Assert (assertEqual)
14+
import Type.Proxy (Proxy(..))
1515

1616
testNonEmptyStringCodeUnits :: Effect Unit
1717
testNonEmptyStringCodeUnits = do
@@ -23,7 +23,7 @@ testNonEmptyStringCodeUnits = do
2323
}
2424
assertEqual
2525
{ actual: NESCU.fromCharArray ['a', 'b']
26-
, expected: Just (nes (SProxy :: SProxy "ab"))
26+
, expected: Just (nes (Proxy :: Proxy "ab"))
2727
}
2828

2929
log "fromNonEmptyCharArray"
@@ -35,415 +35,415 @@ testNonEmptyStringCodeUnits = do
3535
log "singleton"
3636
assertEqual
3737
{ actual: NESCU.singleton 'a'
38-
, expected: nes (SProxy :: SProxy "a")
38+
, expected: nes (Proxy :: Proxy "a")
3939
}
4040

4141
log "cons"
4242
assertEqual
4343
{ actual: NESCU.cons 'a' "bc"
44-
, expected: nes (SProxy :: SProxy "abc")
44+
, expected: nes (Proxy :: Proxy "abc")
4545
}
4646
assertEqual
4747
{ actual: NESCU.cons 'a' ""
48-
, expected: nes (SProxy :: SProxy "a")
48+
, expected: nes (Proxy :: Proxy "a")
4949
}
5050

5151
log "snoc"
5252
assertEqual
5353
{ actual: NESCU.snoc 'c' "ab"
54-
, expected: nes (SProxy :: SProxy "abc")
54+
, expected: nes (Proxy :: Proxy "abc")
5555
}
5656
assertEqual
5757
{ actual: NESCU.snoc 'a' ""
58-
, expected: nes (SProxy :: SProxy "a")
58+
, expected: nes (Proxy :: Proxy "a")
5959
}
6060

6161
log "fromFoldable1"
6262
assertEqual
6363
{ actual: NESCU.fromFoldable1 (nea ['a'])
64-
, expected: nes (SProxy :: SProxy "a")
64+
, expected: nes (Proxy :: Proxy "a")
6565
}
6666
assertEqual
6767
{ actual: NESCU.fromFoldable1 (nea ['a', 'b', 'c'])
68-
, expected: nes (SProxy :: SProxy "abc")
68+
, expected: nes (Proxy :: Proxy "abc")
6969
}
7070

7171
log "charAt"
7272
assertEqual
73-
{ actual: NESCU.charAt 0 (nes (SProxy :: SProxy "a"))
73+
{ actual: NESCU.charAt 0 (nes (Proxy :: Proxy "a"))
7474
, expected: Just 'a'
7575
}
7676
assertEqual
77-
{ actual: NESCU.charAt 1 (nes (SProxy :: SProxy "a"))
77+
{ actual: NESCU.charAt 1 (nes (Proxy :: Proxy "a"))
7878
, expected: Nothing
7979
}
8080
assertEqual
81-
{ actual: NESCU.charAt 0 (nes (SProxy :: SProxy "ab"))
81+
{ actual: NESCU.charAt 0 (nes (Proxy :: Proxy "ab"))
8282
, expected: Just 'a'
8383
}
8484
assertEqual
85-
{ actual: NESCU.charAt 1 (nes (SProxy :: SProxy "ab"))
85+
{ actual: NESCU.charAt 1 (nes (Proxy :: Proxy "ab"))
8686
, expected: Just 'b'
8787
}
8888
assertEqual
89-
{ actual: NESCU.charAt 2 (nes (SProxy :: SProxy "ab"))
89+
{ actual: NESCU.charAt 2 (nes (Proxy :: Proxy "ab"))
9090
, expected: Nothing
9191
}
9292
assertEqual
93-
{ actual: NESCU.charAt 2 (nes (SProxy :: SProxy "Hello"))
93+
{ actual: NESCU.charAt 2 (nes (Proxy :: Proxy "Hello"))
9494
, expected: Just 'l'
9595
}
9696
assertEqual
97-
{ actual: NESCU.charAt 10 (nes (SProxy :: SProxy "Hello"))
97+
{ actual: NESCU.charAt 10 (nes (Proxy :: Proxy "Hello"))
9898
, expected: Nothing
9999
}
100100

101101
log "charCodeAt"
102102
assertEqual
103-
{ actual: fromEnum <$> NESCU.charAt 0 (nes (SProxy :: SProxy "a"))
103+
{ actual: fromEnum <$> NESCU.charAt 0 (nes (Proxy :: Proxy "a"))
104104
, expected: Just 97
105105
}
106106
assertEqual
107-
{ actual: fromEnum <$> NESCU.charAt 1 (nes (SProxy :: SProxy "a"))
107+
{ actual: fromEnum <$> NESCU.charAt 1 (nes (Proxy :: Proxy "a"))
108108
, expected: Nothing
109109
}
110110
assertEqual
111-
{ actual: fromEnum <$> NESCU.charAt 0 (nes (SProxy :: SProxy "ab"))
111+
{ actual: fromEnum <$> NESCU.charAt 0 (nes (Proxy :: Proxy "ab"))
112112
, expected: Just 97
113113
}
114114
assertEqual
115-
{ actual: fromEnum <$> NESCU.charAt 1 (nes (SProxy :: SProxy "ab"))
115+
{ actual: fromEnum <$> NESCU.charAt 1 (nes (Proxy :: Proxy "ab"))
116116
, expected: Just 98
117117
}
118118
assertEqual
119-
{ actual: fromEnum <$> NESCU.charAt 2 (nes (SProxy :: SProxy "ab"))
119+
{ actual: fromEnum <$> NESCU.charAt 2 (nes (Proxy :: Proxy "ab"))
120120
, expected: Nothing
121121
}
122122
assertEqual
123-
{ actual: fromEnum <$> NESCU.charAt 2 (nes (SProxy :: SProxy "5 €"))
123+
{ actual: fromEnum <$> NESCU.charAt 2 (nes (Proxy :: Proxy "5 €"))
124124
, expected: Just 0x20AC
125125
}
126126
assertEqual
127-
{ actual: fromEnum <$> NESCU.charAt 10 (nes (SProxy :: SProxy "5 €"))
127+
{ actual: fromEnum <$> NESCU.charAt 10 (nes (Proxy :: Proxy "5 €"))
128128
, expected: Nothing
129129
}
130130

131131
log "toChar"
132132
assertEqual
133-
{ actual: NESCU.toChar (nes (SProxy :: SProxy "a"))
133+
{ actual: NESCU.toChar (nes (Proxy :: Proxy "a"))
134134
, expected: Just 'a'
135135
}
136136
assertEqual
137-
{ actual: NESCU.toChar (nes (SProxy :: SProxy "ab"))
137+
{ actual: NESCU.toChar (nes (Proxy :: Proxy "ab"))
138138
, expected: Nothing
139139
}
140140

141141
log "toCharArray"
142142
assertEqual
143-
{ actual: NESCU.toCharArray (nes (SProxy :: SProxy "a"))
143+
{ actual: NESCU.toCharArray (nes (Proxy :: Proxy "a"))
144144
, expected: ['a']
145145
}
146146
assertEqual
147-
{ actual: NESCU.toCharArray (nes (SProxy :: SProxy "ab"))
147+
{ actual: NESCU.toCharArray (nes (Proxy :: Proxy "ab"))
148148
, expected: ['a', 'b']
149149
}
150150
assertEqual
151-
{ actual: NESCU.toCharArray (nes (SProxy :: SProxy "Hello☺\n"))
151+
{ actual: NESCU.toCharArray (nes (Proxy :: Proxy "Hello☺\n"))
152152
, expected: ['H','e','l','l','o','☺','\n']
153153
}
154154

155155
log "toNonEmptyCharArray"
156156
assertEqual
157-
{ actual: NESCU.toNonEmptyCharArray (nes (SProxy :: SProxy "ab"))
157+
{ actual: NESCU.toNonEmptyCharArray (nes (Proxy :: Proxy "ab"))
158158
, expected: nea ['a', 'b']
159159
}
160160

161161
log "uncons"
162162
assertEqual
163-
{ actual: NESCU.uncons (nes (SProxy :: SProxy "a"))
163+
{ actual: NESCU.uncons (nes (Proxy :: Proxy "a"))
164164
, expected: { head: 'a', tail: Nothing }
165165
}
166166
assertEqual
167-
{ actual: NESCU.uncons (nes (SProxy :: SProxy "Hello World"))
168-
, expected: { head: 'H', tail: Just (nes (SProxy :: SProxy "ello World")) }
167+
{ actual: NESCU.uncons (nes (Proxy :: Proxy "Hello World"))
168+
, expected: { head: 'H', tail: Just (nes (Proxy :: Proxy "ello World")) }
169169
}
170170

171171
log "takeWhile"
172172
assertEqual
173-
{ actual: NESCU.takeWhile (\c -> true) (nes (SProxy :: SProxy "abc"))
174-
, expected: Just (nes (SProxy :: SProxy "abc"))
173+
{ actual: NESCU.takeWhile (\c -> true) (nes (Proxy :: Proxy "abc"))
174+
, expected: Just (nes (Proxy :: Proxy "abc"))
175175
}
176176
assertEqual
177-
{ actual: NESCU.takeWhile (\c -> false) (nes (SProxy :: SProxy "abc"))
177+
{ actual: NESCU.takeWhile (\c -> false) (nes (Proxy :: Proxy "abc"))
178178
, expected: Nothing
179179
}
180180
assertEqual
181-
{ actual: NESCU.takeWhile (\c -> c /= 'b') (nes (SProxy :: SProxy "aabbcc"))
182-
, expected: Just (nes (SProxy :: SProxy "aa"))
181+
{ actual: NESCU.takeWhile (\c -> c /= 'b') (nes (Proxy :: Proxy "aabbcc"))
182+
, expected: Just (nes (Proxy :: Proxy "aa"))
183183
}
184184
assertEqual
185-
{ actual: NESCU.takeWhile (_ /= ':') (nes (SProxy :: SProxy "http://purescript.org"))
186-
, expected: Just (nes (SProxy :: SProxy "http"))
185+
{ actual: NESCU.takeWhile (_ /= ':') (nes (Proxy :: Proxy "http://purescript.org"))
186+
, expected: Just (nes (Proxy :: Proxy "http"))
187187
}
188188
assertEqual
189-
{ actual: NESCU.takeWhile (_ == 'a') (nes (SProxy :: SProxy "xyz"))
189+
{ actual: NESCU.takeWhile (_ == 'a') (nes (Proxy :: Proxy "xyz"))
190190
, expected: Nothing
191191
}
192192

193193
log "dropWhile"
194194
assertEqual
195-
{ actual: NESCU.dropWhile (\c -> true) (nes (SProxy :: SProxy "abc"))
195+
{ actual: NESCU.dropWhile (\c -> true) (nes (Proxy :: Proxy "abc"))
196196
, expected: Nothing
197197
}
198198
assertEqual
199-
{ actual: NESCU.dropWhile (\c -> false) (nes (SProxy :: SProxy "abc"))
200-
, expected: Just (nes (SProxy :: SProxy "abc"))
199+
{ actual: NESCU.dropWhile (\c -> false) (nes (Proxy :: Proxy "abc"))
200+
, expected: Just (nes (Proxy :: Proxy "abc"))
201201
}
202202
assertEqual
203-
{ actual: NESCU.dropWhile (\c -> c /= 'b') (nes (SProxy :: SProxy "aabbcc"))
204-
, expected: Just (nes (SProxy :: SProxy "bbcc"))
203+
{ actual: NESCU.dropWhile (\c -> c /= 'b') (nes (Proxy :: Proxy "aabbcc"))
204+
, expected: Just (nes (Proxy :: Proxy "bbcc"))
205205
}
206206
assertEqual
207-
{ actual: NESCU.dropWhile (_ /= '.') (nes (SProxy :: SProxy "Test.purs"))
208-
, expected: Just (nes (SProxy :: SProxy ".purs"))
207+
{ actual: NESCU.dropWhile (_ /= '.') (nes (Proxy :: Proxy "Test.purs"))
208+
, expected: Just (nes (Proxy :: Proxy ".purs"))
209209
}
210210

211211
log "indexOf"
212212
assertEqual
213-
{ actual: NESCU.indexOf (Pattern "") (nes (SProxy :: SProxy "abcd"))
213+
{ actual: NESCU.indexOf (Pattern "") (nes (Proxy :: Proxy "abcd"))
214214
, expected: Just 0
215215
}
216216
assertEqual
217-
{ actual: NESCU.indexOf (Pattern "bc") (nes (SProxy :: SProxy "abcd"))
217+
{ actual: NESCU.indexOf (Pattern "bc") (nes (Proxy :: Proxy "abcd"))
218218
, expected: Just 1
219219
}
220220
assertEqual
221-
{ actual: NESCU.indexOf (Pattern "cb") (nes (SProxy :: SProxy "abcd"))
221+
{ actual: NESCU.indexOf (Pattern "cb") (nes (Proxy :: Proxy "abcd"))
222222
, expected: Nothing
223223
}
224224

225225
log "indexOf'"
226226
assertEqual
227-
{ actual: NESCU.indexOf' (Pattern "") (-1) (nes (SProxy :: SProxy "ab"))
227+
{ actual: NESCU.indexOf' (Pattern "") (-1) (nes (Proxy :: Proxy "ab"))
228228
, expected: Nothing
229229
}
230230
assertEqual
231-
{ actual: NESCU.indexOf' (Pattern "") 0 (nes (SProxy :: SProxy "ab"))
231+
{ actual: NESCU.indexOf' (Pattern "") 0 (nes (Proxy :: Proxy "ab"))
232232
, expected: Just 0
233233
}
234234
assertEqual
235-
{ actual: NESCU.indexOf' (Pattern "") 1 (nes (SProxy :: SProxy "ab"))
235+
{ actual: NESCU.indexOf' (Pattern "") 1 (nes (Proxy :: Proxy "ab"))
236236
, expected: Just 1
237237
}
238238
assertEqual
239-
{ actual: NESCU.indexOf' (Pattern "") 2 (nes (SProxy :: SProxy "ab"))
239+
{ actual: NESCU.indexOf' (Pattern "") 2 (nes (Proxy :: Proxy "ab"))
240240
, expected: Just 2
241241
}
242242
assertEqual
243-
{ actual: NESCU.indexOf' (Pattern "") 3 (nes (SProxy :: SProxy "ab"))
243+
{ actual: NESCU.indexOf' (Pattern "") 3 (nes (Proxy :: Proxy "ab"))
244244
, expected: Nothing
245245
}
246246
assertEqual
247-
{ actual: NESCU.indexOf' (Pattern "bc") 0 (nes (SProxy :: SProxy "abcd"))
247+
{ actual: NESCU.indexOf' (Pattern "bc") 0 (nes (Proxy :: Proxy "abcd"))
248248
, expected: Just 1
249249
}
250250
assertEqual
251-
{ actual: NESCU.indexOf' (Pattern "bc") 1 (nes (SProxy :: SProxy "abcd"))
251+
{ actual: NESCU.indexOf' (Pattern "bc") 1 (nes (Proxy :: Proxy "abcd"))
252252
, expected: Just 1
253253
}
254254
assertEqual
255-
{ actual: NESCU.indexOf' (Pattern "bc") 2 (nes (SProxy :: SProxy "abcd"))
255+
{ actual: NESCU.indexOf' (Pattern "bc") 2 (nes (Proxy :: Proxy "abcd"))
256256
, expected: Nothing
257257
}
258258
assertEqual
259-
{ actual: NESCU.indexOf' (Pattern "cb") 0 (nes (SProxy :: SProxy "abcd"))
259+
{ actual: NESCU.indexOf' (Pattern "cb") 0 (nes (Proxy :: Proxy "abcd"))
260260
, expected: Nothing
261261
}
262262

263263
log "lastIndexOf"
264264
assertEqual
265-
{ actual: NESCU.lastIndexOf (Pattern "") (nes (SProxy :: SProxy "abcd"))
265+
{ actual: NESCU.lastIndexOf (Pattern "") (nes (Proxy :: Proxy "abcd"))
266266
, expected: Just 4
267267
}
268268
assertEqual
269-
{ actual: NESCU.lastIndexOf (Pattern "bc") (nes (SProxy :: SProxy "abcd"))
269+
{ actual: NESCU.lastIndexOf (Pattern "bc") (nes (Proxy :: Proxy "abcd"))
270270
, expected: Just 1
271271
}
272272
assertEqual
273-
{ actual: NESCU.lastIndexOf (Pattern "cb") (nes (SProxy :: SProxy "abcd"))
273+
{ actual: NESCU.lastIndexOf (Pattern "cb") (nes (Proxy :: Proxy "abcd"))
274274
, expected: Nothing
275275
}
276276

277277
log "lastIndexOf'"
278278
assertEqual
279-
{ actual: NESCU.lastIndexOf' (Pattern "") (-1) (nes (SProxy :: SProxy "ab"))
279+
{ actual: NESCU.lastIndexOf' (Pattern "") (-1) (nes (Proxy :: Proxy "ab"))
280280
, expected: Nothing
281281
}
282282
assertEqual
283-
{ actual: NESCU.lastIndexOf' (Pattern "") 0 (nes (SProxy :: SProxy "ab"))
283+
{ actual: NESCU.lastIndexOf' (Pattern "") 0 (nes (Proxy :: Proxy "ab"))
284284
, expected: Just 0
285285
}
286286
assertEqual
287-
{ actual: NESCU.lastIndexOf' (Pattern "") 1 (nes (SProxy :: SProxy "ab"))
287+
{ actual: NESCU.lastIndexOf' (Pattern "") 1 (nes (Proxy :: Proxy "ab"))
288288
, expected: Just 1
289289
}
290290
assertEqual
291-
{ actual: NESCU.lastIndexOf' (Pattern "") 2 (nes (SProxy :: SProxy "ab"))
291+
{ actual: NESCU.lastIndexOf' (Pattern "") 2 (nes (Proxy :: Proxy "ab"))
292292
, expected: Just 2
293293
}
294294
assertEqual
295-
{ actual: NESCU.lastIndexOf' (Pattern "") 3 (nes (SProxy :: SProxy "ab"))
295+
{ actual: NESCU.lastIndexOf' (Pattern "") 3 (nes (Proxy :: Proxy "ab"))
296296
, expected: Nothing
297297
}
298298
assertEqual
299-
{ actual: NESCU.lastIndexOf' (Pattern "bc") 0 (nes (SProxy :: SProxy "abcd"))
299+
{ actual: NESCU.lastIndexOf' (Pattern "bc") 0 (nes (Proxy :: Proxy "abcd"))
300300
, expected: Nothing
301301
}
302302
assertEqual
303-
{ actual: NESCU.lastIndexOf' (Pattern "bc") 1 (nes (SProxy :: SProxy "abcd"))
303+
{ actual: NESCU.lastIndexOf' (Pattern "bc") 1 (nes (Proxy :: Proxy "abcd"))
304304
, expected: Just 1
305305
}
306306
assertEqual
307-
{ actual: NESCU.lastIndexOf' (Pattern "bc") 2 (nes (SProxy :: SProxy "abcd"))
307+
{ actual: NESCU.lastIndexOf' (Pattern "bc") 2 (nes (Proxy :: Proxy "abcd"))
308308
, expected: Just 1
309309
}
310310
assertEqual
311-
{ actual: NESCU.lastIndexOf' (Pattern "cb") 0 (nes (SProxy :: SProxy "abcd"))
311+
{ actual: NESCU.lastIndexOf' (Pattern "cb") 0 (nes (Proxy :: Proxy "abcd"))
312312
, expected: Nothing
313313
}
314314

315315
log "length"
316316
assertEqual
317-
{ actual: NESCU.length (nes (SProxy :: SProxy "a"))
317+
{ actual: NESCU.length (nes (Proxy :: Proxy "a"))
318318
, expected: 1
319319
}
320320
assertEqual
321-
{ actual: NESCU.length (nes (SProxy :: SProxy "ab"))
321+
{ actual: NESCU.length (nes (Proxy :: Proxy "ab"))
322322
, expected: 2
323323
}
324324

325325
log "take"
326326
assertEqual
327-
{ actual: NESCU.take 0 (nes (SProxy :: SProxy "ab"))
327+
{ actual: NESCU.take 0 (nes (Proxy :: Proxy "ab"))
328328
, expected: Nothing
329329
}
330330
assertEqual
331-
{ actual: NESCU.take 1 (nes (SProxy :: SProxy "ab"))
332-
, expected: Just (nes (SProxy :: SProxy "a"))
331+
{ actual: NESCU.take 1 (nes (Proxy :: Proxy "ab"))
332+
, expected: Just (nes (Proxy :: Proxy "a"))
333333
}
334334
assertEqual
335-
{ actual: NESCU.take 2 (nes (SProxy :: SProxy "ab"))
336-
, expected: Just (nes (SProxy :: SProxy "ab"))
335+
{ actual: NESCU.take 2 (nes (Proxy :: Proxy "ab"))
336+
, expected: Just (nes (Proxy :: Proxy "ab"))
337337
}
338338
assertEqual
339-
{ actual: NESCU.take 3 (nes (SProxy :: SProxy "ab"))
340-
, expected: Just (nes (SProxy :: SProxy "ab"))
339+
{ actual: NESCU.take 3 (nes (Proxy :: Proxy "ab"))
340+
, expected: Just (nes (Proxy :: Proxy "ab"))
341341
}
342342
assertEqual
343-
{ actual: NESCU.take (-1) (nes (SProxy :: SProxy "ab"))
343+
{ actual: NESCU.take (-1) (nes (Proxy :: Proxy "ab"))
344344
, expected: Nothing
345345
}
346346

347347
log "takeRight"
348348
assertEqual
349-
{ actual: NESCU.takeRight 0 (nes (SProxy :: SProxy "ab"))
349+
{ actual: NESCU.takeRight 0 (nes (Proxy :: Proxy "ab"))
350350
, expected: Nothing
351351
}
352352
assertEqual
353-
{ actual: NESCU.takeRight 1 (nes (SProxy :: SProxy "ab"))
354-
, expected: Just (nes (SProxy :: SProxy "b"))
353+
{ actual: NESCU.takeRight 1 (nes (Proxy :: Proxy "ab"))
354+
, expected: Just (nes (Proxy :: Proxy "b"))
355355
}
356356
assertEqual
357-
{ actual: NESCU.takeRight 2 (nes (SProxy :: SProxy "ab"))
358-
, expected: Just (nes (SProxy :: SProxy "ab"))
357+
{ actual: NESCU.takeRight 2 (nes (Proxy :: Proxy "ab"))
358+
, expected: Just (nes (Proxy :: Proxy "ab"))
359359
}
360360
assertEqual
361-
{ actual: NESCU.takeRight 3 (nes (SProxy :: SProxy "ab"))
362-
, expected: Just (nes (SProxy :: SProxy "ab"))
361+
{ actual: NESCU.takeRight 3 (nes (Proxy :: Proxy "ab"))
362+
, expected: Just (nes (Proxy :: Proxy "ab"))
363363
}
364364
assertEqual
365-
{ actual: NESCU.takeRight (-1) (nes (SProxy :: SProxy "ab"))
365+
{ actual: NESCU.takeRight (-1) (nes (Proxy :: Proxy "ab"))
366366
, expected: Nothing
367367
}
368368

369369
log "drop"
370370
assertEqual
371-
{ actual: NESCU.drop 0 (nes (SProxy :: SProxy "ab"))
372-
, expected: Just (nes (SProxy :: SProxy "ab"))
371+
{ actual: NESCU.drop 0 (nes (Proxy :: Proxy "ab"))
372+
, expected: Just (nes (Proxy :: Proxy "ab"))
373373
}
374374
assertEqual
375-
{ actual: NESCU.drop 1 (nes (SProxy :: SProxy "ab"))
376-
, expected: Just (nes (SProxy :: SProxy "b"))
375+
{ actual: NESCU.drop 1 (nes (Proxy :: Proxy "ab"))
376+
, expected: Just (nes (Proxy :: Proxy "b"))
377377
}
378378
assertEqual
379-
{ actual: NESCU.drop 2 (nes (SProxy :: SProxy "ab"))
379+
{ actual: NESCU.drop 2 (nes (Proxy :: Proxy "ab"))
380380
, expected: Nothing
381381
}
382382
assertEqual
383-
{ actual: NESCU.drop 3 (nes (SProxy :: SProxy "ab"))
383+
{ actual: NESCU.drop 3 (nes (Proxy :: Proxy "ab"))
384384
, expected: Nothing
385385
}
386386
assertEqual
387-
{ actual: NESCU.drop (-1) (nes (SProxy :: SProxy "ab"))
388-
, expected: Just (nes (SProxy :: SProxy "ab"))
387+
{ actual: NESCU.drop (-1) (nes (Proxy :: Proxy "ab"))
388+
, expected: Just (nes (Proxy :: Proxy "ab"))
389389
}
390390

391391
log "dropRight"
392392
assertEqual
393-
{ actual: NESCU.dropRight 0 (nes (SProxy :: SProxy "ab"))
394-
, expected: Just (nes (SProxy :: SProxy "ab"))
393+
{ actual: NESCU.dropRight 0 (nes (Proxy :: Proxy "ab"))
394+
, expected: Just (nes (Proxy :: Proxy "ab"))
395395
}
396396
assertEqual
397-
{ actual: NESCU.dropRight 1 (nes (SProxy :: SProxy "ab"))
398-
, expected: Just (nes (SProxy :: SProxy "a"))
397+
{ actual: NESCU.dropRight 1 (nes (Proxy :: Proxy "ab"))
398+
, expected: Just (nes (Proxy :: Proxy "a"))
399399
}
400400
assertEqual
401-
{ actual: NESCU.dropRight 2 (nes (SProxy :: SProxy "ab"))
401+
{ actual: NESCU.dropRight 2 (nes (Proxy :: Proxy "ab"))
402402
, expected: Nothing
403403
}
404404
assertEqual
405-
{ actual: NESCU.dropRight 3 (nes (SProxy :: SProxy "ab"))
405+
{ actual: NESCU.dropRight 3 (nes (Proxy :: Proxy "ab"))
406406
, expected: Nothing
407407
}
408408
assertEqual
409-
{ actual: NESCU.dropRight (-1) (nes (SProxy :: SProxy "ab"))
410-
, expected: Just (nes (SProxy :: SProxy "ab"))
409+
{ actual: NESCU.dropRight (-1) (nes (Proxy :: Proxy "ab"))
410+
, expected: Just (nes (Proxy :: Proxy "ab"))
411411
}
412412

413413
log "countPrefix"
414414
assertEqual
415-
{ actual: NESCU.countPrefix (_ == 'a') (nes (SProxy :: SProxy "ab"))
415+
{ actual: NESCU.countPrefix (_ == 'a') (nes (Proxy :: Proxy "ab"))
416416
, expected: 1
417417
}
418418
assertEqual
419-
{ actual: NESCU.countPrefix (_ == 'a') (nes (SProxy :: SProxy "aaab"))
419+
{ actual: NESCU.countPrefix (_ == 'a') (nes (Proxy :: Proxy "aaab"))
420420
, expected: 3
421421
}
422422
assertEqual
423-
{ actual: NESCU.countPrefix (_ == 'a') (nes (SProxy :: SProxy "abaa"))
423+
{ actual: NESCU.countPrefix (_ == 'a') (nes (Proxy :: Proxy "abaa"))
424424
, expected: 1
425425
}
426426
assertEqual
427-
{ actual: NESCU.countPrefix (_ == 'c') (nes (SProxy :: SProxy "abaa"))
427+
{ actual: NESCU.countPrefix (_ == 'c') (nes (Proxy :: Proxy "abaa"))
428428
, expected: 0
429429
}
430430

431431
log "splitAt"
432432
assertEqual
433-
{ actual: NESCU.splitAt 0 (nes (SProxy :: SProxy "a"))
434-
, expected: { before: Nothing, after: Just (nes (SProxy :: SProxy "a")) }
433+
{ actual: NESCU.splitAt 0 (nes (Proxy :: Proxy "a"))
434+
, expected: { before: Nothing, after: Just (nes (Proxy :: Proxy "a")) }
435435
}
436436
assertEqual
437-
{ actual: NESCU.splitAt 1 (nes (SProxy :: SProxy "ab"))
438-
, expected: { before: Just (nes (SProxy :: SProxy "a")), after: Just (nes (SProxy :: SProxy "b")) }
437+
{ actual: NESCU.splitAt 1 (nes (Proxy :: Proxy "ab"))
438+
, expected: { before: Just (nes (Proxy :: Proxy "a")), after: Just (nes (Proxy :: Proxy "b")) }
439439
}
440440
assertEqual
441-
{ actual: NESCU.splitAt 3 (nes (SProxy :: SProxy "aabcc"))
442-
, expected: { before: Just (nes (SProxy :: SProxy "aab")), after: Just (nes (SProxy :: SProxy "cc")) }
441+
{ actual: NESCU.splitAt 3 (nes (Proxy :: Proxy "aabcc"))
442+
, expected: { before: Just (nes (Proxy :: Proxy "aab")), after: Just (nes (Proxy :: Proxy "cc")) }
443443
}
444444
assertEqual
445-
{ actual: NESCU.splitAt (-1) (nes (SProxy :: SProxy "abc"))
446-
, expected: { before: Nothing, after: Just (nes (SProxy :: SProxy "abc")) }
445+
{ actual: NESCU.splitAt (-1) (nes (Proxy :: Proxy "abc"))
446+
, expected: { before: Nothing, after: Just (nes (Proxy :: Proxy "abc")) }
447447
}
448448

449449
nea :: Array ~> NEA.NonEmptyArray

0 commit comments

Comments
 (0)
Please sign in to comment.