{-# LANGUAGE FlexibleContexts #-}

-- |
-- Module     : Simulation.Aivika.Trans.Array
-- Copyright  : Copyright (c) 2009-2017, David Sorokin <david.sorokin@gmail.com>
-- License    : BSD3
-- Maintainer : David Sorokin <david.sorokin@gmail.com>
-- Stability  : experimental
-- Tested with: GHC 8.0.1
--
-- The module defines helper functions for creating mutable arrays.
--
module Simulation.Aivika.Trans.Array
       (newIOArray_,
        newIOUArray_) where

import Data.Array.IO.Safe
import Data.Array.MArray.Safe

-- | Create a new 'IOArray'.
newIOArray_ :: Ix i => (i, i) -> IO (IOArray i e)
newIOArray_ :: forall i e. Ix i => (i, i) -> IO (IOArray i e)
newIOArray_ = (i, i) -> IO (IOArray i e)
forall i. Ix i => (i, i) -> IO (IOArray i e)
forall (a :: * -> * -> *) e (m :: * -> *) i.
(MArray a e m, Ix i) =>
(i, i) -> m (a i e)
newArray_

-- | Create a new 'IOUArray'.
newIOUArray_ :: (Ix i, MArray IOUArray e IO) => (i, i) -> IO (IOUArray i e)
newIOUArray_ :: forall i e.
(Ix i, MArray IOUArray e IO) =>
(i, i) -> IO (IOUArray i e)
newIOUArray_ = (i, i) -> IO (IOUArray i e)
forall i. Ix i => (i, i) -> IO (IOUArray i e)
forall (a :: * -> * -> *) e (m :: * -> *) i.
(MArray a e m, Ix i) =>
(i, i) -> m (a i e)
newArray_