| Copyright | Copyright (c) Patrick Perry <patperry@stanford.edu> |
|---|---|
| License | BSD3 |
| Maintainer | Patrick Perry <patperry@stanford.edu> |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell98 |
Data.Choose.ST
Description
Mutable combinations in the ST monad.
Synopsis
- data STChoose s
- runSTChoose :: (forall s. ST s (STChoose s)) -> Choose
- module Data.Choose.MChoose
Combinations
A mutable combination that can be manipulated in the ST monad. The
type argument s is the state variable argument for the ST type.
Instances
| Eq (STChoose s) Source # | |
| MChoose (STChoose s) (ST s) Source # | |
Defined in Data.Choose.MChoose Methods getPossible :: STChoose s -> ST s Int Source # getSize :: STChoose s -> ST s Int Source # newChoose :: Int -> Int -> ST s (STChoose s) Source # newChoose_ :: Int -> Int -> ST s (STChoose s) Source # unsafeGetElem :: STChoose s -> Int -> ST s Int Source # unsafeSetElem :: STChoose s -> Int -> Int -> ST s () Source # getElems :: STChoose s -> ST s [Int] Source # setElems :: STChoose s -> [Int] -> ST s () Source # | |
runSTChoose :: (forall s. ST s (STChoose s)) -> Choose Source #
A safe way to create and work with a mutable combination before returning an immutable one for later perusal. This function avoids copying the combination before returning it - it uses unsafeFreeze internally, but this wrapper is a safe interface to that function.
Overloaded mutable combination interface
module Data.Choose.MChoose