@@ -502,167 +502,4 @@ instance monadPlusArray :: MonadPlus Prim.Array
502502
503503
504504
505- ## Module Data.Array.ST
506-
507-
508- Helper functions for working with mutable arrays using the ` ST ` effect.
509-
510- This module can be used when performance is important and mutation is a local effect.
511-
512- #### ` STArray `
513-
514- ``` purescript
515- data STArray :: * -> * -> *
516- ```
517-
518- A reference to a mutable array.
519-
520- The first type parameter represents the memory region which the array belongs to.
521- The second type parameter defines the type of elements of the mutable array.
522-
523- The runtime representation of a value of type ` STArray h a ` is the same as that of ` [a] ` ,
524- except that mutation is allowed.
525-
526- #### ` Assoc `
527-
528- ``` purescript
529- type Assoc a = { index :: Int, value :: a }
530- ```
531-
532- An element and its index
533-
534- #### ` runSTArray `
535-
536- ``` purescript
537- runSTArray :: forall a r. (forall h. Eff (st :: ST h | r) (STArray h a)) -> Eff r [a]
538- ```
539-
540- Freeze a mutable array, creating an immutable array. Use this function as you would use
541- ` runST ` to freeze a mutable reference.
542-
543- The rank-2 type prevents the reference from escaping the scope of ` runSTArray ` .
544-
545- #### ` emptySTArray `
546-
547- ``` purescript
548- emptySTArray :: forall a h r. Eff (st :: ST h | r) (STArray h a)
549- ```
550-
551- Create an empty mutable array.
552-
553- #### ` peekSTArray `
554-
555- ``` purescript
556- peekSTArray :: forall a h r. STArray h a -> Int -> Eff (st :: ST h | r) (Maybe a)
557- ```
558-
559- Read the value at the specified index in a mutable array.
560-
561- #### ` pokeSTArray `
562-
563- ``` purescript
564- pokeSTArray :: forall a h r. STArray h a -> Int -> a -> Eff (st :: ST h | r) Boolean
565- ```
566-
567- Change the value at the specified index in a mutable array.
568-
569- #### ` pushAllSTArray `
570-
571- ``` purescript
572- pushAllSTArray :: forall a h r. STArray h a -> [a] -> Eff (st :: ST h | r) Int
573- ```
574-
575- Append the values in an immutable array to the end of a mutable array.
576-
577- #### ` pushSTArray `
578-
579- ``` purescript
580- pushSTArray :: forall a h r. STArray h a -> a -> Eff (st :: ST h | r) Int
581- ```
582-
583- Append an element to the end of a mutable array.
584-
585- #### ` spliceSTArray `
586-
587- ``` purescript
588- spliceSTArray :: forall a h r. STArray h a -> Int -> Int -> [a] -> Eff (st :: ST h | r) [a]
589- ```
590-
591- Remove and/or insert elements from/into a mutable array at the specified index.
592-
593- #### ` freeze `
594-
595- ``` purescript
596- freeze :: forall a h r. STArray h a -> Eff (st :: ST h | r) [a]
597- ```
598-
599- Create an immutable copy of a mutable array.
600-
601- #### ` thaw `
602-
603- ``` purescript
604- thaw :: forall a h r. [a] -> Eff (st :: ST h | r) (STArray h a)
605- ```
606-
607- Create a mutable copy of an immutable array.
608-
609- #### ` toAssocArray `
610-
611- ``` purescript
612- toAssocArray :: forall a h r. STArray h a -> Eff (st :: ST h | r) [Assoc a]
613- ```
614-
615- Create an immutable copy of a mutable array, where each element
616- is labelled with its index in the original array.
617-
618-
619- ## Module Data.Array.Unsafe
620-
621-
622- Unsafe helper functions for working with immutable arrays.
623-
624- _ Note_ : these functions should be used with care, and may result in unspecified
625- behavior, including runtime exceptions.
626-
627- #### ` head `
628-
629- ``` purescript
630- head :: forall a. [a] -> a
631- ```
632-
633- Get the first element of a non-empty array.
634-
635- Running time: ` O(1) ` .
636-
637- #### ` tail `
638-
639- ``` purescript
640- tail :: forall a. [a] -> [a]
641- ```
642-
643- Get all but the first element of a non-empty array.
644-
645- Running time: ` O(n) ` , where ` n ` is the length of the array.
646-
647- #### ` last `
648-
649- ``` purescript
650- last :: forall a. [a] -> a
651- ```
652-
653- Get the last element of a non-empty array.
654-
655- Running time: ` O(1) ` .
656-
657- #### ` init `
658-
659- ``` purescript
660- init :: forall a. [a] -> [a]
661- ```
662-
663- Get all but the last element of a non-empty array.
664-
665- Running time: ` O(n) ` , where ` n ` is the length of the array.
666-
667-
668505
0 commit comments