Module
Data.ArrayView.Internal
- Package
- purescript-array-views
- Repository
- klntsky/purescript-array-views
#ArrayView Source
newtype ArrayView a
Constructors
Instances
Newtype (ArrayView a) _
Generic (ArrayView a) _
(Show a) => Show (ArrayView a)
(Eq a) => Eq (ArrayView a)
Eq1 ArrayView
(Ord a) => Ord (ArrayView a)
Ord1 ArrayView
Functor ArrayView
Apply ArrayView
Bind ArrayView
Applicative ArrayView
Monad ArrayView
FunctorWithIndex Int ArrayView
FoldableWithIndex Int ArrayView
TraversableWithIndex Int ArrayView
Foldable ArrayView
Traversable ArrayView
Unfoldable1 ArrayView
Unfoldable ArrayView
Semigroup (ArrayView a)
Monoid (ArrayView a)
Alt ArrayView
Plus ArrayView
Alternative ArrayView
Extend ArrayView
MonadZero ArrayView
MonadPlus ArrayView
(ArrayToView a b) => ArrayToView (Array a) (ArrayView b)
(ArrayToView a b) => ArrayToView (ArrayView a) (Array b)
#NonEmptyArrayView Source
newtype NonEmptyArrayView a
Constructors
Instances
Newtype (NonEmptyArrayView a) _
(Show a) => Show (NonEmptyArrayView a)
(Eq a) => Eq (NonEmptyArrayView a)
Eq1 NonEmptyArrayView
(Ord a) => Ord (NonEmptyArrayView a)
Ord1 NonEmptyArrayView
Functor NonEmptyArrayView
Semigroup (NonEmptyArrayView a)
FunctorWithIndex Int NonEmptyArrayView
Apply NonEmptyArrayView
Bind NonEmptyArrayView
Applicative NonEmptyArrayView
Monad NonEmptyArrayView
Foldable NonEmptyArrayView
FoldableWithIndex Int NonEmptyArrayView
Foldable1 NonEmptyArrayView
Unfoldable1 NonEmptyArrayView
Traversable NonEmptyArrayView
TraversableWithIndex Int NonEmptyArrayView
Traversable1 NonEmptyArrayView
Alt NonEmptyArrayView
(ArrayToView a b) => ArrayToView (NonEmptyArray a) (NonEmptyArrayView b)
(ArrayToView a b) => ArrayToView (NonEmptyArrayView a) (NonEmptyArray b)
#ArrayToView Source
class ArrayToView a b where
This typeclass allows to convert any function that operates on Array
to a
function that operates on ArrayView
and vice versa. use
only inserts
fromArray
and toArray
in the right places, so don't expect it to
increase performance.
Note: either type annotation or partial application of some number of arguments is needed, because otherwise the type inference will not be able to guess the correct type.
import Data.Array as A
-- OK
zipWith :: forall a b c. (a -> b -> c) -> ArrayView a -> ArrayView b -> ArrayView c
zipWith = use (A.zipWith :: (a -> b -> c) -> Array a -> Array b -> Array c)
-- OK
zipWith :: forall a b c. (a -> b -> c) -> ArrayView a -> ArrayView b -> ArrayView c
zipWith f = use (A.zipWith f) -- all three type parameters are tied to `f`
-- Type error
zipWith :: forall a b c. (a -> b -> c) -> ArrayView a -> ArrayView b -> ArrayView c
zipWith = use A.zipWith
Members
use :: a -> b
Instances
ArrayToView a a
(ArrayToView b a, ArrayToView c d) => ArrayToView (a -> c) (b -> d)
(ArrayToView a b) => ArrayToView (Array a) (ArrayView b)
(ArrayToView a b) => ArrayToView (ArrayView a) (Array b)
(ArrayToView a b) => ArrayToView (NonEmptyArray a) (NonEmptyArrayView b)
(ArrayToView a b) => ArrayToView (NonEmptyArrayView a) (NonEmptyArray b)
(ArrayToView a b, ArrayToView c d) => ArrayToView (Tuple a c) (Tuple b d)
(Functor f, ArrayToView a b) => ArrayToView (f a) (f b)
#toArrayView Source
toArrayView :: forall a. NonEmptyArrayView a -> ArrayView a