diff --git a/src/Data/String/NonEmpty/Internal.purs b/src/Data/String/NonEmpty/Internal.purs index 8722654..6b2a024 100644 --- a/src/Data/String/NonEmpty/Internal.purs +++ b/src/Data/String/NonEmpty/Internal.purs @@ -16,7 +16,7 @@ import Data.String as String import Data.String.Pattern (Pattern) import Data.Symbol (class IsSymbol, reflectSymbol) import Prim.TypeError as TE -import Type.Proxy (Proxy) +import Type.Proxy (Proxy(..)) import Unsafe.Coerce (unsafeCoerce) -- | A string that is known not to be empty. @@ -39,16 +39,16 @@ instance showNonEmptyString :: Show NonEmptyString where -- | -- | ``` purescript -- | something :: NonEmptyString --- | something = nes (Proxy :: Proxy "something") +-- | something = nes @"something" -- | ``` class MakeNonEmpty (s :: Symbol) where - nes :: Proxy s -> NonEmptyString + nes :: NonEmptyString instance makeNonEmptyBad :: TE.Fail (TE.Text "Cannot create an NonEmptyString from an empty Symbol") => MakeNonEmpty "" where - nes _ = NonEmptyString "" + nes = NonEmptyString "" else instance nonEmptyNonEmpty :: IsSymbol s => MakeNonEmpty s where - nes p = NonEmptyString (reflectSymbol p) + nes = NonEmptyString (reflectSymbol (Proxy :: Proxy s)) -- | A newtype used in cases to specify a non-empty replacement for a pattern. newtype NonEmptyReplacement = NonEmptyReplacement NonEmptyString diff --git a/test/Test/Data/String/NonEmpty.purs b/test/Test/Data/String/NonEmpty.purs index a4103ec..254ade7 100644 --- a/test/Test/Data/String/NonEmpty.purs +++ b/test/Test/Data/String/NonEmpty.purs @@ -10,7 +10,6 @@ import Effect (Effect) import Effect.Console (log) import Partial.Unsafe (unsafePartial) import Test.Assert (assert, assertEqual) -import Type.Proxy (Proxy(..)) testNonEmptyString :: Effect Unit testNonEmptyString = do @@ -22,7 +21,7 @@ testNonEmptyString = do } assertEqual { actual: NES.fromString "hello" - , expected: Just (nes (Proxy :: Proxy "hello")) + , expected: Just (nes @"hello") } log "toString" @@ -33,136 +32,136 @@ testNonEmptyString = do log "appendString" assertEqual - { actual: NES.appendString (nes (Proxy :: Proxy "Hello")) " world" - , expected: nes (Proxy :: Proxy "Hello world") + { actual: NES.appendString (nes @"Hello") " world" + , expected: nes @"Hello world" } assertEqual - { actual: NES.appendString (nes (Proxy :: Proxy "Hello")) "" - , expected: nes (Proxy :: Proxy "Hello") + { actual: NES.appendString (nes @"Hello") "" + , expected: nes @"Hello" } log "prependString" assertEqual - { actual: NES.prependString "be" (nes (Proxy :: Proxy "fore")) - , expected: nes (Proxy :: Proxy "before") + { actual: NES.prependString "be" (nes @"fore") + , expected: nes @"before" } assertEqual - { actual: NES.prependString "" (nes (Proxy :: Proxy "fore")) - , expected: nes (Proxy :: Proxy "fore") + { actual: NES.prependString "" (nes @"fore") + , expected: nes @"fore" } log "contains" - assert $ NES.contains (Pattern "") (nes (Proxy :: Proxy "abcd")) - assert $ NES.contains (Pattern "bc") (nes (Proxy :: Proxy "abcd")) - assert $ not NES.contains (Pattern "cb") (nes (Proxy :: Proxy "abcd")) - assert $ NES.contains (Pattern "needle") (nes (Proxy :: Proxy "haystack with needle")) - assert $ not NES.contains (Pattern "needle") (nes (Proxy :: Proxy "haystack")) + assert $ NES.contains (Pattern "") (nes @"abcd") + assert $ NES.contains (Pattern "bc") (nes @"abcd") + assert $ not NES.contains (Pattern "cb") (nes @"abcd") + assert $ NES.contains (Pattern "needle") (nes @"haystack with needle") + assert $ not NES.contains (Pattern "needle") (nes @"haystack") log "localeCompare" assertEqual - { actual: NES.localeCompare (nes (Proxy :: Proxy "a")) (nes (Proxy :: Proxy "a")) + { actual: NES.localeCompare (nes @"a") (nes @"a") , expected: EQ } assertEqual - { actual: NES.localeCompare (nes (Proxy :: Proxy "a")) (nes (Proxy :: Proxy "b")) + { actual: NES.localeCompare (nes @"a") (nes @"b") , expected: LT } assertEqual - { actual: NES.localeCompare (nes (Proxy :: Proxy "b")) (nes (Proxy :: Proxy "a")) + { actual: NES.localeCompare (nes @"b") (nes @"a") , expected: GT } log "replace" assertEqual - { actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abc")) - , expected: nes (Proxy :: Proxy "a!c") + { actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes @"!")) (nes @"abc") + , expected: nes @"a!c" } assertEqual - { actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abbc")) - , expected: nes (Proxy :: Proxy "a!bc") + { actual: NES.replace (Pattern "b") (NES.NonEmptyReplacement (nes @"!")) (nes @"abbc") + , expected: nes @"a!bc" } assertEqual - { actual: NES.replace (Pattern "d") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abc")) - , expected: nes (Proxy :: Proxy "abc") + { actual: NES.replace (Pattern "d") (NES.NonEmptyReplacement (nes @"!")) (nes @"abc") + , expected: nes @"abc" } log "replaceAll" assertEqual - { actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "a[b]c")) - , expected: nes (Proxy :: Proxy "a!c") + { actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes @"!")) (nes @"a[b]c") + , expected: nes @"a!c" } assertEqual - { actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "a[b]c[b]")) - , expected: nes (Proxy :: Proxy "a!c!") + { actual: NES.replaceAll (Pattern "[b]") (NES.NonEmptyReplacement (nes @"!")) (nes @"a[b]c[b]") + , expected: nes @"a!c!" } assertEqual - { actual: NES.replaceAll (Pattern "x") (NES.NonEmptyReplacement (nes (Proxy :: Proxy "!"))) (nes (Proxy :: Proxy "abc")) - , expected: nes (Proxy :: Proxy "abc") + { actual: NES.replaceAll (Pattern "x") (NES.NonEmptyReplacement (nes @"!")) (nes @"abc") + , expected: nes @"abc" } log "stripPrefix" assertEqual - { actual: NES.stripPrefix (Pattern "") (nes (Proxy :: Proxy "abc")) - , expected: Just (nes (Proxy :: Proxy "abc")) + { actual: NES.stripPrefix (Pattern "") (nes @"abc") + , expected: Just (nes @"abc") } assertEqual - { actual: NES.stripPrefix (Pattern "a") (nes (Proxy :: Proxy "abc")) - , expected: Just (nes (Proxy :: Proxy "bc")) + { actual: NES.stripPrefix (Pattern "a") (nes @"abc") + , expected: Just (nes @"bc") } assertEqual - { actual: NES.stripPrefix (Pattern "abc") (nes (Proxy :: Proxy "abc")) + { actual: NES.stripPrefix (Pattern "abc") (nes @"abc") , expected: Nothing } assertEqual - { actual: NES.stripPrefix (Pattern "!") (nes (Proxy :: Proxy "abc")) + { actual: NES.stripPrefix (Pattern "!") (nes @"abc") , expected: Nothing } assertEqual - { actual: NES.stripPrefix (Pattern "http:") (nes (Proxy :: Proxy "http://purescript.org")) - , expected: Just (nes (Proxy :: Proxy "//purescript.org")) + { actual: NES.stripPrefix (Pattern "http:") (nes @"http://purescript.org") + , expected: Just (nes @"//purescript.org") } assertEqual - { actual: NES.stripPrefix (Pattern "http:") (nes (Proxy :: Proxy "https://purescript.org")) + { actual: NES.stripPrefix (Pattern "http:") (nes @"https://purescript.org") , expected: Nothing } assertEqual - { actual: NES.stripPrefix (Pattern "Hello!") (nes (Proxy :: Proxy "Hello!")) + { actual: NES.stripPrefix (Pattern "Hello!") (nes @"Hello!") , expected: Nothing } log "stripSuffix" assertEqual - { actual: NES.stripSuffix (Pattern ".exe") (nes (Proxy :: Proxy "purs.exe")) - , expected: Just (nes (Proxy :: Proxy "purs")) + { actual: NES.stripSuffix (Pattern ".exe") (nes @"purs.exe") + , expected: Just (nes @"purs") } assertEqual - { actual: NES.stripSuffix (Pattern ".exe") (nes (Proxy :: Proxy "purs")) + { actual: NES.stripSuffix (Pattern ".exe") (nes @"purs") , expected: Nothing } assertEqual - { actual: NES.stripSuffix (Pattern "Hello!") (nes (Proxy :: Proxy "Hello!")) + { actual: NES.stripSuffix (Pattern "Hello!") (nes @"Hello!") , expected: Nothing } log "toLower" assertEqual - { actual: NES.toLower (nes (Proxy :: Proxy "bAtMaN")) - , expected: nes (Proxy :: Proxy "batman") + { actual: NES.toLower (nes @"bAtMaN") + , expected: nes @"batman" } log "toUpper" assertEqual - { actual: NES.toUpper (nes (Proxy :: Proxy "bAtMaN")) - , expected: nes (Proxy :: Proxy "BATMAN") + { actual: NES.toUpper (nes @"bAtMaN") + , expected: nes @"BATMAN" } log "trim" assertEqual - { actual: NES.trim (nes (Proxy :: Proxy " abc ")) - , expected: Just (nes (Proxy :: Proxy "abc")) + { actual: NES.trim (nes @" abc ") + , expected: Just (nes @"abc") } assertEqual - { actual: NES.trim (nes (Proxy :: Proxy " \n")) + { actual: NES.trim (nes @" \n") , expected: Nothing } @@ -172,48 +171,48 @@ testNonEmptyString = do , expected: "" } assertEqual - { actual: NES.joinWith "" [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b")] + { actual: NES.joinWith "" [nes @"a", nes @"b"] , expected: "ab" } assertEqual - { actual: NES.joinWith "--" [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b"), nes (Proxy :: Proxy "c")] + { actual: NES.joinWith "--" [nes @"a", nes @"b", nes @"c"] , expected: "a--b--c" } log "join1With" assertEqual - { actual: NES.join1With "" (nea [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b")]) - , expected: nes (Proxy :: Proxy "ab") + { actual: NES.join1With "" (nea [nes @"a", nes @"b"]) + , expected: nes @"ab" } assertEqual - { actual: NES.join1With "--" (nea [nes (Proxy :: Proxy "a"), nes (Proxy :: Proxy "b"), nes (Proxy :: Proxy "c")]) - , expected: nes (Proxy :: Proxy "a--b--c") + { actual: NES.join1With "--" (nea [nes @"a", nes @"b", nes @"c"]) + , expected: nes @"a--b--c" } assertEqual - { actual: NES.join1With ", " (nea [nes (Proxy :: Proxy "apple"), nes (Proxy :: Proxy "banana")]) - , expected: nes (Proxy :: Proxy "apple, banana") + { actual: NES.join1With ", " (nea [nes @"apple", nes @"banana"]) + , expected: nes @"apple, banana" } assertEqual - { actual: NES.join1With "" (nea [nes (Proxy :: Proxy "apple"), nes (Proxy :: Proxy "banana")]) - , expected: nes (Proxy :: Proxy "applebanana") + { actual: NES.join1With "" (nea [nes @"apple", nes @"banana"]) + , expected: nes @"applebanana" } log "joinWith1" assertEqual - { actual: NES.joinWith1 (nes (Proxy :: Proxy " ")) (nea ["a", "b"]) - , expected: nes (Proxy :: Proxy "a b") + { actual: NES.joinWith1 (nes @" ") (nea ["a", "b"]) + , expected: nes @"a b" } assertEqual - { actual: NES.joinWith1 (nes (Proxy :: Proxy "--")) (nea ["a", "b", "c"]) - , expected: nes (Proxy :: Proxy "a--b--c") + { actual: NES.joinWith1 (nes @"--") (nea ["a", "b", "c"]) + , expected: nes @"a--b--c" } assertEqual - { actual: NES.joinWith1 (nes (Proxy :: Proxy ", ")) (nea ["apple", "banana"]) - , expected: nes (Proxy :: Proxy "apple, banana") + { actual: NES.joinWith1 (nes @", ") (nea ["apple", "banana"]) + , expected: nes @"apple, banana" } assertEqual - { actual: NES.joinWith1 (nes (Proxy :: Proxy "/")) (nea ["a", "b", "", "c", ""]) - , expected: nes (Proxy :: Proxy "a/b//c/") + { actual: NES.joinWith1 (nes @"/") (nea ["a", "b", "", "c", ""]) + , expected: nes @"a/b//c/" } nea :: Array ~> NEA.NonEmptyArray diff --git a/test/Test/Data/String/NonEmpty/CodeUnits.purs b/test/Test/Data/String/NonEmpty/CodeUnits.purs index e810dd9..3778832 100644 --- a/test/Test/Data/String/NonEmpty/CodeUnits.purs +++ b/test/Test/Data/String/NonEmpty/CodeUnits.purs @@ -23,7 +23,7 @@ testNonEmptyStringCodeUnits = do } assertEqual { actual: NESCU.fromCharArray ['a', 'b'] - , expected: Just (nes (Proxy :: Proxy "ab")) + , expected: Just (nes @"ab") } log "fromNonEmptyCharArray" @@ -35,415 +35,415 @@ testNonEmptyStringCodeUnits = do log "singleton" assertEqual { actual: NESCU.singleton 'a' - , expected: nes (Proxy :: Proxy "a") + , expected: nes @"a" } log "cons" assertEqual { actual: NESCU.cons 'a' "bc" - , expected: nes (Proxy :: Proxy "abc") + , expected: nes @"abc" } assertEqual { actual: NESCU.cons 'a' "" - , expected: nes (Proxy :: Proxy "a") + , expected: nes @"a" } log "snoc" assertEqual { actual: NESCU.snoc 'c' "ab" - , expected: nes (Proxy :: Proxy "abc") + , expected: nes @"abc" } assertEqual { actual: NESCU.snoc 'a' "" - , expected: nes (Proxy :: Proxy "a") + , expected: nes @"a" } log "fromFoldable1" assertEqual { actual: NESCU.fromFoldable1 (nea ['a']) - , expected: nes (Proxy :: Proxy "a") + , expected: nes @"a" } assertEqual { actual: NESCU.fromFoldable1 (nea ['a', 'b', 'c']) - , expected: nes (Proxy :: Proxy "abc") + , expected: nes @"abc" } log "charAt" assertEqual - { actual: NESCU.charAt 0 (nes (Proxy :: Proxy "a")) + { actual: NESCU.charAt 0 (nes @"a") , expected: Just 'a' } assertEqual - { actual: NESCU.charAt 1 (nes (Proxy :: Proxy "a")) + { actual: NESCU.charAt 1 (nes @"a") , expected: Nothing } assertEqual - { actual: NESCU.charAt 0 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.charAt 0 (nes @"ab") , expected: Just 'a' } assertEqual - { actual: NESCU.charAt 1 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.charAt 1 (nes @"ab") , expected: Just 'b' } assertEqual - { actual: NESCU.charAt 2 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.charAt 2 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.charAt 2 (nes (Proxy :: Proxy "Hello")) + { actual: NESCU.charAt 2 (nes @"Hello") , expected: Just 'l' } assertEqual - { actual: NESCU.charAt 10 (nes (Proxy :: Proxy "Hello")) + { actual: NESCU.charAt 10 (nes @"Hello") , expected: Nothing } log "charCodeAt" assertEqual - { actual: fromEnum <$> NESCU.charAt 0 (nes (Proxy :: Proxy "a")) + { actual: fromEnum <$> NESCU.charAt 0 (nes @"a") , expected: Just 97 } assertEqual - { actual: fromEnum <$> NESCU.charAt 1 (nes (Proxy :: Proxy "a")) + { actual: fromEnum <$> NESCU.charAt 1 (nes @"a") , expected: Nothing } assertEqual - { actual: fromEnum <$> NESCU.charAt 0 (nes (Proxy :: Proxy "ab")) + { actual: fromEnum <$> NESCU.charAt 0 (nes @"ab") , expected: Just 97 } assertEqual - { actual: fromEnum <$> NESCU.charAt 1 (nes (Proxy :: Proxy "ab")) + { actual: fromEnum <$> NESCU.charAt 1 (nes @"ab") , expected: Just 98 } assertEqual - { actual: fromEnum <$> NESCU.charAt 2 (nes (Proxy :: Proxy "ab")) + { actual: fromEnum <$> NESCU.charAt 2 (nes @"ab") , expected: Nothing } assertEqual - { actual: fromEnum <$> NESCU.charAt 2 (nes (Proxy :: Proxy "5 €")) + { actual: fromEnum <$> NESCU.charAt 2 (nes @"5 €") , expected: Just 0x20AC } assertEqual - { actual: fromEnum <$> NESCU.charAt 10 (nes (Proxy :: Proxy "5 €")) + { actual: fromEnum <$> NESCU.charAt 10 (nes @"5 €") , expected: Nothing } log "toChar" assertEqual - { actual: NESCU.toChar (nes (Proxy :: Proxy "a")) + { actual: NESCU.toChar (nes @"a") , expected: Just 'a' } assertEqual - { actual: NESCU.toChar (nes (Proxy :: Proxy "ab")) + { actual: NESCU.toChar (nes @"ab") , expected: Nothing } log "toCharArray" assertEqual - { actual: NESCU.toCharArray (nes (Proxy :: Proxy "a")) + { actual: NESCU.toCharArray (nes @"a") , expected: ['a'] } assertEqual - { actual: NESCU.toCharArray (nes (Proxy :: Proxy "ab")) - , expected: ['a', 'b'] + { actual: NESCU.toCharArray (nes @"ab") + , expected: ['a','b'] } assertEqual - { actual: NESCU.toCharArray (nes (Proxy :: Proxy "Hello☺\n")) + { actual: NESCU.toCharArray (nes @"Hello☺\n") , expected: ['H','e','l','l','o','☺','\n'] } log "toNonEmptyCharArray" assertEqual - { actual: NESCU.toNonEmptyCharArray (nes (Proxy :: Proxy "ab")) + { actual: NESCU.toNonEmptyCharArray (nes @"ab") , expected: nea ['a', 'b'] } log "uncons" assertEqual - { actual: NESCU.uncons (nes (Proxy :: Proxy "a")) + { actual: NESCU.uncons (nes @"a") , expected: { head: 'a', tail: Nothing } } assertEqual - { actual: NESCU.uncons (nes (Proxy :: Proxy "Hello World")) - , expected: { head: 'H', tail: Just (nes (Proxy :: Proxy "ello World")) } + { actual: NESCU.uncons (nes @"Hello World") + , expected: { head: 'H', tail: Just (nes @"ello World") } } log "takeWhile" assertEqual - { actual: NESCU.takeWhile (\_ -> true) (nes (Proxy :: Proxy "abc")) - , expected: Just (nes (Proxy :: Proxy "abc")) + { actual: NESCU.takeWhile (\_ -> true) (nes @"abc") + , expected: Just (nes @"abc") } assertEqual - { actual: NESCU.takeWhile (\_ -> false) (nes (Proxy :: Proxy "abc")) + { actual: NESCU.takeWhile (\_ -> false) (nes @"abc") , expected: Nothing } assertEqual - { actual: NESCU.takeWhile (\c -> c /= 'b') (nes (Proxy :: Proxy "aabbcc")) - , expected: Just (nes (Proxy :: Proxy "aa")) + { actual: NESCU.takeWhile (\c -> c /= 'b') (nes @"aabbcc") + , expected: Just (nes @"aa") } assertEqual - { actual: NESCU.takeWhile (_ /= ':') (nes (Proxy :: Proxy "http://purescript.org")) - , expected: Just (nes (Proxy :: Proxy "http")) + { actual: NESCU.takeWhile (_ /= ':') (nes @"http://purescript.org") + , expected: Just (nes @"http") } assertEqual - { actual: NESCU.takeWhile (_ == 'a') (nes (Proxy :: Proxy "xyz")) + { actual: NESCU.takeWhile (_ == 'a') (nes @"xyz") , expected: Nothing } log "dropWhile" assertEqual - { actual: NESCU.dropWhile (\_ -> true) (nes (Proxy :: Proxy "abc")) + { actual: NESCU.dropWhile (\_ -> true) (nes @"abc") , expected: Nothing } assertEqual - { actual: NESCU.dropWhile (\_ -> false) (nes (Proxy :: Proxy "abc")) - , expected: Just (nes (Proxy :: Proxy "abc")) + { actual: NESCU.dropWhile (\_ -> false) (nes @"abc") + , expected: Just (nes @"abc") } assertEqual - { actual: NESCU.dropWhile (\c -> c /= 'b') (nes (Proxy :: Proxy "aabbcc")) - , expected: Just (nes (Proxy :: Proxy "bbcc")) + { actual: NESCU.dropWhile (\c -> c /= 'b') (nes @"aabbcc") + , expected: Just (nes @"bbcc") } assertEqual - { actual: NESCU.dropWhile (_ /= '.') (nes (Proxy :: Proxy "Test.purs")) - , expected: Just (nes (Proxy :: Proxy ".purs")) + { actual: NESCU.dropWhile (_ /= '.') (nes @"Test.purs") + , expected: Just (nes @".purs") } log "indexOf" assertEqual - { actual: NESCU.indexOf (Pattern "") (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.indexOf (Pattern "") (nes @"abcd") , expected: Just 0 } assertEqual - { actual: NESCU.indexOf (Pattern "bc") (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.indexOf (Pattern "bc") (nes @"abcd") , expected: Just 1 } assertEqual - { actual: NESCU.indexOf (Pattern "cb") (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.indexOf (Pattern "cb") (nes @"abcd") , expected: Nothing } log "indexOf'" assertEqual - { actual: NESCU.indexOf' (Pattern "") (-1) (nes (Proxy :: Proxy "ab")) + { actual: NESCU.indexOf' (Pattern "") (-1) (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.indexOf' (Pattern "") 0 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.indexOf' (Pattern "") 0 (nes @"ab") , expected: Just 0 } assertEqual - { actual: NESCU.indexOf' (Pattern "") 1 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.indexOf' (Pattern "") 1 (nes @"ab") , expected: Just 1 } assertEqual - { actual: NESCU.indexOf' (Pattern "") 2 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.indexOf' (Pattern "") 2 (nes @"ab") , expected: Just 2 } assertEqual - { actual: NESCU.indexOf' (Pattern "") 3 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.indexOf' (Pattern "") 3 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.indexOf' (Pattern "bc") 0 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.indexOf' (Pattern "bc") 0 (nes @"abcd") , expected: Just 1 } assertEqual - { actual: NESCU.indexOf' (Pattern "bc") 1 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.indexOf' (Pattern "bc") 1 (nes @"abcd") , expected: Just 1 } assertEqual - { actual: NESCU.indexOf' (Pattern "bc") 2 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.indexOf' (Pattern "bc") 2 (nes @"abcd") , expected: Nothing } assertEqual - { actual: NESCU.indexOf' (Pattern "cb") 0 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.indexOf' (Pattern "cb") 0 (nes @"abcd") , expected: Nothing } log "lastIndexOf" assertEqual - { actual: NESCU.lastIndexOf (Pattern "") (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.lastIndexOf (Pattern "") (nes @"abcd") , expected: Just 4 } assertEqual - { actual: NESCU.lastIndexOf (Pattern "bc") (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.lastIndexOf (Pattern "bc") (nes @"abcd") , expected: Just 1 } assertEqual - { actual: NESCU.lastIndexOf (Pattern "cb") (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.lastIndexOf (Pattern "cb") (nes @"abcd") , expected: Nothing } log "lastIndexOf'" assertEqual - { actual: NESCU.lastIndexOf' (Pattern "") (-1) (nes (Proxy :: Proxy "ab")) + { actual: NESCU.lastIndexOf' (Pattern "") (-1) (nes @"ab") , expected: Just 0 } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "") 0 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.lastIndexOf' (Pattern "") 0 (nes @"ab") , expected: Just 0 } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "") 1 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.lastIndexOf' (Pattern "") 1 (nes @"ab") , expected: Just 1 } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "") 2 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.lastIndexOf' (Pattern "") 2 (nes @"ab") , expected: Just 2 } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "") 3 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.lastIndexOf' (Pattern "") 3 (nes @"ab") , expected: Just 2 } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "bc") 0 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.lastIndexOf' (Pattern "bc") 0 (nes @"abcd") , expected: Nothing } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "bc") 1 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.lastIndexOf' (Pattern "bc") 1 (nes @"abcd") , expected: Just 1 } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "bc") 2 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.lastIndexOf' (Pattern "bc") 2 (nes @"abcd") , expected: Just 1 } assertEqual - { actual: NESCU.lastIndexOf' (Pattern "cb") 0 (nes (Proxy :: Proxy "abcd")) + { actual: NESCU.lastIndexOf' (Pattern "cb") 0 (nes @"abcd") , expected: Nothing } log "length" assertEqual - { actual: NESCU.length (nes (Proxy :: Proxy "a")) + { actual: NESCU.length (nes @"a") , expected: 1 } assertEqual - { actual: NESCU.length (nes (Proxy :: Proxy "ab")) + { actual: NESCU.length (nes @"ab") , expected: 2 } log "take" assertEqual - { actual: NESCU.take 0 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.take 0 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.take 1 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "a")) + { actual: NESCU.take 1 (nes @"ab") + , expected: Just (nes @"a") } assertEqual - { actual: NESCU.take 2 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.take 2 (nes @"ab") + , expected: Just (nes @"ab") } assertEqual - { actual: NESCU.take 3 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.take 3 (nes @"ab") + , expected: Just (nes @"ab") } assertEqual - { actual: NESCU.take (-1) (nes (Proxy :: Proxy "ab")) + { actual: NESCU.take (-1) (nes @"ab") , expected: Nothing } log "takeRight" assertEqual - { actual: NESCU.takeRight 0 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.takeRight 0 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.takeRight 1 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "b")) + { actual: NESCU.takeRight 1 (nes @"ab") + , expected: Just (nes @"b") } assertEqual - { actual: NESCU.takeRight 2 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.takeRight 2 (nes @"ab") + , expected: Just (nes @"ab") } assertEqual - { actual: NESCU.takeRight 3 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.takeRight 3 (nes @"ab") + , expected: Just (nes @"ab") } assertEqual - { actual: NESCU.takeRight (-1) (nes (Proxy :: Proxy "ab")) + { actual: NESCU.takeRight (-1) (nes @"ab") , expected: Nothing } log "drop" assertEqual - { actual: NESCU.drop 0 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.drop 0 (nes @"ab") + , expected: Just (nes @"ab") } assertEqual - { actual: NESCU.drop 1 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "b")) + { actual: NESCU.drop 1 (nes @"ab") + , expected: Just (nes @"b") } assertEqual - { actual: NESCU.drop 2 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.drop 2 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.drop 3 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.drop 3 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.drop (-1) (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.drop (-1) (nes @"ab") + , expected: Just (nes @"ab") } log "dropRight" assertEqual - { actual: NESCU.dropRight 0 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.dropRight 0 (nes @"ab") + , expected: Just (nes @"ab") } assertEqual - { actual: NESCU.dropRight 1 (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "a")) + { actual: NESCU.dropRight 1 (nes @"ab") + , expected: Just (nes @"a") } assertEqual - { actual: NESCU.dropRight 2 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.dropRight 2 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.dropRight 3 (nes (Proxy :: Proxy "ab")) + { actual: NESCU.dropRight 3 (nes @"ab") , expected: Nothing } assertEqual - { actual: NESCU.dropRight (-1) (nes (Proxy :: Proxy "ab")) - , expected: Just (nes (Proxy :: Proxy "ab")) + { actual: NESCU.dropRight (-1) (nes @"ab") + , expected: Just (nes @"ab") } log "countPrefix" assertEqual - { actual: NESCU.countPrefix (_ == 'a') (nes (Proxy :: Proxy "ab")) + { actual: NESCU.countPrefix (_ == 'a') (nes @"ab") , expected: 1 } assertEqual - { actual: NESCU.countPrefix (_ == 'a') (nes (Proxy :: Proxy "aaab")) + { actual: NESCU.countPrefix (_ == 'a') (nes @"aaab") , expected: 3 } assertEqual - { actual: NESCU.countPrefix (_ == 'a') (nes (Proxy :: Proxy "abaa")) + { actual: NESCU.countPrefix (_ == 'a') (nes @"abaa") , expected: 1 } assertEqual - { actual: NESCU.countPrefix (_ == 'c') (nes (Proxy :: Proxy "abaa")) + { actual: NESCU.countPrefix (_ == 'c') (nes @"abaa") , expected: 0 } log "splitAt" assertEqual - { actual: NESCU.splitAt 0 (nes (Proxy :: Proxy "a")) - , expected: { before: Nothing, after: Just (nes (Proxy :: Proxy "a")) } + { actual: NESCU.splitAt 0 (nes @"a") + , expected: { before: Nothing, after: Just (nes @"a") } } assertEqual - { actual: NESCU.splitAt 1 (nes (Proxy :: Proxy "ab")) - , expected: { before: Just (nes (Proxy :: Proxy "a")), after: Just (nes (Proxy :: Proxy "b")) } + { actual: NESCU.splitAt 1 (nes @"ab") + , expected: { before: Just (nes @"a"), after: Just (nes @"b") } } assertEqual - { actual: NESCU.splitAt 3 (nes (Proxy :: Proxy "aabcc")) - , expected: { before: Just (nes (Proxy :: Proxy "aab")), after: Just (nes (Proxy :: Proxy "cc")) } + { actual: NESCU.splitAt 3 (nes @"aabcc") + , expected: { before: Just (nes @"aab"), after: Just (nes @"cc") } } assertEqual - { actual: NESCU.splitAt (-1) (nes (Proxy :: Proxy "abc")) - , expected: { before: Nothing, after: Just (nes (Proxy :: Proxy "abc")) } + { actual: NESCU.splitAt (-1) (nes @"abc") + , expected: { before: Nothing, after: Just (nes @"abc") } } nea :: Array ~> NEA.NonEmptyArray