Use std monadic operators instead of `thenStrictlyST` and friends.
-- fill in packed string from "addr"
fill_in ch_array 0# >>
-- freeze the puppy:
-- fill in packed string from "addr"
fill_in ch_array 0# >>
-- freeze the puppy:
- freeze_ps_array ch_array length# `thenStrictlyST` \ barr ->
- returnStrictlyST barr )
+ freeze_ps_array ch_array length# >>= \ barr ->
+ return barr )
where
fill_in :: MutableByteArray s Int -> Int# -> ST s ()
fill_in arr_in# idx
| idx ==# length#
where
fill_in :: MutableByteArray s Int -> Int# -> ST s ()
fill_in arr_in# idx
| idx ==# length#
- = write_ps_array arr_in# idx (chr# 0#) `seqStrictlyST`
- returnStrictlyST ()
+ = write_ps_array arr_in# idx (chr# 0#) >>
+ return ()
| otherwise
= case (indexCharOffAddr# a idx) of { ch ->
| otherwise
= case (indexCharOffAddr# a idx) of { ch ->
- write_ps_array arr_in# idx ch `seqStrictlyST`
+ write_ps_array arr_in# idx ch >>
fill_in arr_in# (idx +# 1#) }
\end{code}
fill_in arr_in# (idx +# 1#) }
\end{code}
{- allocate an array that will hold the string
(not forgetting the NUL at the end)
-}
{- allocate an array that will hold the string
(not forgetting the NUL at the end)
-}
- new_ps_array (length# +# 1#) `thenStrictlyST` \ ch_array ->
+ new_ps_array (length# +# 1#) >>= \ ch_array ->
-- fill in packed string from "addr"
-- fill in packed string from "addr"
- fill_in ch_array 0# `seqStrictlyST`
-- freeze the puppy:
freeze_ps_array ch_array length#)
where
-- freeze the puppy:
freeze_ps_array ch_array length#)
where
fill_in arr_in# idx
| idx ==# length#
fill_in arr_in# idx
| idx ==# length#
- = write_ps_array arr_in# idx (chr# 0#) `seqStrictlyST`
- returnStrictlyST ()
+ = write_ps_array arr_in# idx (chr# 0#) >>
+ return ()
| otherwise
= case (indexCharOffForeignObj# fo (idx +# start#)) of { ch ->
| otherwise
= case (indexCharOffForeignObj# fo (idx +# start#)) of { ch ->
- write_ps_array arr_in# idx ch `seqStrictlyST`
+ write_ps_array arr_in# idx ch >>
fill_in arr_in# (idx +# 1#) }
-- step on (char *) pointer by x units.
fill_in arr_in# (idx +# 1#) }
-- step on (char *) pointer by x units.
{- allocate an array that will hold the string
(not forgetting the NUL at the end)
-}
{- allocate an array that will hold the string
(not forgetting the NUL at the end)
-}
- new_ps_array (length# +# 1#) `thenStrictlyST` \ ch_array ->
+ new_ps_array (length# +# 1#) >>= \ ch_array ->
-- fill in packed string from "addr"
-- fill in packed string from "addr"
- fill_in ch_array 0# `seqStrictlyST`
-- freeze the puppy:
freeze_ps_array ch_array length#)
where
-- freeze the puppy:
freeze_ps_array ch_array length#)
where
fill_in arr_in# idx
| idx ==# length#
fill_in arr_in# idx
| idx ==# length#
- = write_ps_array arr_in# idx (chr# 0#) `seqStrictlyST`
- returnStrictlyST ()
+ = write_ps_array arr_in# idx (chr# 0#) >>
+ return ()
| otherwise
= case (indexCharArray# barr# (start# +# idx)) of { ch ->
| otherwise
= case (indexCharArray# barr# (start# +# idx)) of { ch ->
- write_ps_array arr_in# idx ch `seqStrictlyST`
+ write_ps_array arr_in# idx ch >>
fill_in arr_in# (idx +# 1#) }
fill_in arr_in# (idx +# 1#) }
\end{code}
(Very :-) ``Specialised'' versions of some CharArray things...
\end{code}
(Very :-) ``Specialised'' versions of some CharArray things...