Add a `Text` substring function in codeworld-base
Open
enhancement
- Dominant language
- Haskell
- Stars
- 1.3k
- Forks
- 201
- PR merge metrics
- No merged PRs in 30d
Description
It would be great to add a function to get a subrange of a `Text` value in `codeworld-base`. Something like:
subtext :: (Text, Number, Number) -> Text
subtext (t, a, b) = T.take (b - a) (T.drop a t)
but with appropriate validation for non-integer parameters, etc.
Contributor guide
Research direction
Start by locating the Text API in codeworld-base and reviewing how its existing functions handle numeric arguments; the issue points to T.take and T.drop as the relevant operations. Clarify and implement the requested subtext behavior, including validation for non-integer parameters, then verify the resulting Text ranges and invalid-input cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100