google / google/codeworld

Add a `Text` substring function in codeworld-base

Open
#446 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.