Search results
split :: Pattern -> String -> Array String
Returns the substrings of the second string separated along occurences of the first string.
split (Pattern " ") "hello world" == ["hello", "world"]
split :: Regex -> String -> Array String
Split the string into an array of substrings along occurrences of the Regex
.
split :: forall f a b x. (a -> x) -> (x -> b) -> f x -> Split f a b
Split :: forall v k. (Maybe v) -> (Map k v) -> (Map k v) -> Split k v
split :: forall m. MonadEffect m => Pattern -> Pipe (Maybe String) (Maybe String) m Unit
Accumulate string chunks until pat
is seen, then yield
the buffered
string up to (and not including) the pattern.
When end-of-stream is reached, yields the remaining buffered string then Nothing
.
toList $ yield "foo,bar,baz" >-> split ","
-- "foo" : "bar" : "baz" : Nil
Split :: forall f a. (f a) -> a -> (f a) -> Split f a
split :: forall a v. Monoid v => Measured a v => Partial => (v -> Boolean) -> FingerTree v a -> Tuple (Lazy (FingerTree v a)) (Lazy (FingerTree v a))
Split a finger tree according to which elements satisfy a predicate. This function is partial because it requires that the result of applying the predicate to mempty is false; if this is not the case, the behaviour is undefined.
A value of type @Split m@ is either a single @m@, or a pair of
Split :: forall m. m -> m -> Split m
split :: forall m. Monoid m => Split m
A convenient name for @mempty :| mempty@, so @M a <> split <>
split :: forall a. BusRW a -> Tuple (BusR a) (BusW a)
Splits a bidirectional Bus into separate read and write Buses.
split :: forall a. (a -> Boolean) -> Stream a -> { fail :: Stream a, pass :: Stream a }
Takes a predicate and a stream. A record of to streams is returned. The first stream includes all occurrences from the original stream which pass the predicate test and the second stream includes all occurrences which fail to pass the predicate.
{ pass: smallNumbers, fail: largeNumbers } = split (_ < 100) streamOfNumbers
split :: forall d c b a. Iso a b -> Iso c d -> Iso (Tuple a c) (Tuple b d)
The product type constructor Tuple
is a bifunctor from Iso
x Iso
to
Iso
, so that we have the bifunctorial map ***
which allows two separate
isomorphisms to work on the two components of a tuple.
split :: forall a. Channel a -> Tuple (Input a) (Output a)
Split :: Tag -> Tag -> Tag
split :: Tag -> Tag -> Tag
split :: forall action state2 state1 props. Prism' state1 state2 -> Spec state2 props action -> Spec state1 props action
Create a component which renders an optional subcomponent.
split :: forall e. Events e => e -> EventId /\ (Array Json)
Split :: Split -> MathboxPrimitive
split :: forall f a. Applicative f => f a -> f (f a)
Split :: Cookie
split :: P5 -> String -> String -> (Array String)
p5js.org documentation
split :: forall op r t s a u. Op op => Pattern u a (Tuple s t) -> (s -> t -> r) -> op u a r
Split a functor into a Day convolution.
This is an implementation detail of the lowerOf
function.
Split :: forall f g r. (f ~> g ⊗ r) -> Split r f g
split :: forall str a. SodiumStream str => str (Array a) -> Stream a
Push each event in the list onto a newly created transaction guaranteed to come before the next externally initiated transaction. Note that the semantics are such that two different invocations of split() can put events into the same new transaction, so the resulting stream's events could be simultaneous with events output by split() or 'defer' invoked elsewhere in the code.
Purescript port of byorgey/split
split :: SMGen -> Tuple SMGen SMGen
Split a generator into a two uncorrelated generators.
split' :: forall r t s a u. Pattern u a (Tuple s t) -> (s -> t -> r) -> Pattern u a r
split2 :: forall a s. Supply s a -> Tuple (Supply s a) (Supply s a)
Split a supply into two different supplies.
split3 :: forall a s. Supply s a -> Tuple3 (Supply s a) (Supply s a) (Supply s a)
Split a supply into three different supplies.
split4 :: forall a s. Supply s a -> Tuple4 (Supply s a) (Supply s a) (Supply s a) (Supply s a)
Split a supply into four different supplies.
splitAt :: forall a. Int -> Array a -> { after :: Array a, before :: Array a }
Splits an array into two subarrays, where before
contains the elements
up to (but not including) the given index, and after
contains the rest
of the elements, from that index on.
>>> splitAt 3 [1, 2, 3, 4, 5]
{ before: [1, 2, 3], after: [4, 5] }
Thus, the length of (splitAt i arr).before
will equal either i
or
length arr
, if that is shorter. (Or if i
is negative the length will
be 0.)
splitAt 2 ([] :: Array Int) == { before: [], after: [] }
splitAt 3 [1, 2, 3, 4, 5] == { before: [1, 2, 3], after: [4, 5] }
splitAt :: forall a. Int -> NonEmptyArray a -> { after :: Array a, before :: Array a }
splitAt :: Int -> String -> { after :: String, before :: String }
Splits a string into two substrings, where before
contains the code
points up to (but not including) the given index, and after
contains the
rest of the string, from that index on.
>>> splitAt 3 "b 𝐀𝐀 c 𝐀"
{ before: "b 𝐀", after: "𝐀 c 𝐀" }
Thus the length of (splitAt i s).before
will equal either i
or
length s
, if that is shorter. (Or if i
is negative the length will be
0.)
In code:
length (splitAt i s).before == min (max i 0) (length s)
(splitAt i s).before <> (splitAt i s).after == s
splitAt i s == {before: take i s, after: drop i s}
splitAt :: Int -> String -> { after :: String, before :: String }
Splits a string into two substrings, where before
contains the
characters up to (but not including) the given index, and after
contains
the rest of the string, from that index on.
splitAt 2 "Hello World" == { before: "He", after: "llo World"}
splitAt 10 "Hi" == { before: "Hi", after: ""}
Thus the length of (splitAt i s).before
will equal either i
or
length s
, if that is shorter. (Or if i
is negative the length will be
0.)
In code:
length (splitAt i s).before == min (max i 0) (length s)
(splitAt i s).before <> (splitAt i s).after == s
splitAt i s == {before: take i s, after: drop i s}
splitAt :: Int -> NonEmptyString -> { after :: Maybe NonEmptyString, before :: Maybe NonEmptyString }
splitAt :: Int -> NonEmptyString -> { after :: Maybe NonEmptyString, before :: Maybe NonEmptyString }
Returns the substrings of a split at the given index, if the index is within bounds.
splitAt 2 (NonEmptyString "Hello World") == Just { before: Just (NonEmptyString "He"), after: Just (NonEmptyString "llo World") }
splitAt 10 (NonEmptyString "Hi") == Nothing
Split the Vect
into two sub vectors before
and after
, where before contains up to m
elements.
vect :: Vect 10 String
vect = replicate (term :: _ 10) "a"
split ::
{ after :: Vect 7 String
, before :: Vect 3 String
}
split = splitAt (term :: _ 3) vect
splitAt :: forall m n m_plus_n elem. SplitAt Vect m n m_plus_n elem
Split the Vect
into two sub vectors before
and after
, where before contains up to m
elements.
vect :: Vect 10 String
vect = replicate (Common.term :: _ 10) "a"
split ::
{ after :: Vect 7 String
, before :: Vect 3 String
}
split = splitAt (Common.term :: _ 3) vect
splitAt :: forall m n m_plus_n elem. SplitAt MinLenVect m n m_plus_n elem
Split the MinLenVect
into two sub minLenVectors before
and after
, where before contains up to m
elements.
minLenVect :: MinLenVect 10 String
minLenVect = replicate (Common.term :: _ 10) "a"
split ::
{ after :: MinLenVect 7 String
, before :: MinLenVect 3 String
}
split = splitAt (Common.term :: _ 3) minLenVect
splitAt :: forall m n m_plus_n elem. SplitAt Vect m n m_plus_n elem
Split the Vect
into two sub vectors before
and after
, where before contains up to m
elements.
vect :: Vect 10 String
vect = replicate (Common.term :: _ 10) "a"
split ::
{ after :: Vect 7 String
, before :: Vect 3 String
}
split = splitAt (Common.term :: _ 3) vect
splitAt :: forall m n m_plus_n elem. SplitAt Vect m n m_plus_n elem
Split the Vect
into two sub vectors before
and after
, where before contains up to m
elements.
vect :: Vect 10 String
vect = replicate (Common.term :: _ 10) "a"
split ::
{ after :: Vect 7 String
, before :: Vect 3 String
}
split = splitAt (Common.term :: _ 3) vect
splitAt :: forall a. Int -> Seq a -> Tuple (Seq a) (Seq a)
O(log(min(i,n-i))). Split the sequence into two subsequences. The first subsequence will have i elements (unless there are not that many in the whole sequence, in which case the first element is the same sequence, unchanged).
splitAt :: forall a. Int -> Seq a -> Tuple (Seq a) (Seq a)
O(log(min(i,n-i))). Split the sequence into two (possibly empty) subsequences. The first subsequence will have i elements (unless there are not that many in the whole sequence, in which case the first element is the same sequence, unchanged).