| Safe Haskell | Safe-Inferred | 
|---|---|
| Language | Haskell2010 | 
HaskellWorks.Data.BalancedParens.Internal.Slow.FindCloseN.Generic
Documentation
findCloseN :: (BitLength a, CloseAt a, TestBit a) => a -> Count -> Count -> Maybe Count Source #
Find the position of the corresponding close parenthesis carrying in a number of open parentheses starting from a given position.
All positions are one based.
This is a reference implementation.
>>>:set -XTypeApplications>>>import HaskellWorks.Data.Bits.BitRead>>>import Data.Maybe>>>import Data.Word>>>findCloseN (fromJust (bitRead @Word64 "1100000")) 0 1Just 4>>>findCloseN (fromJust (bitRead @Word64 "1100000")) 0 2Just 3>>>findCloseN (fromJust (bitRead @Word64 "1100000")) 1 1Just 5>>>findCloseN (fromJust (bitRead @Word64 "1100000")) 1 2Just 4