Explorer

definy.strings-take

description
The first count items of items from index (acc holds the ones taken so far)
type
Fn(items: List<String>, count: Number, index: Number, acc: List<String>) -> List<String>
expression
fn(items$0, count$1, index$2, acc$3) =>
  match @core.less-than(left: $2, right: $1) {
    false =>
      $3,
    true =>
      match @core.list-get(list: $0, index: $2) {
        #none(_) =>
          $3,
        #some(item$4) =>
          @definy.strings-take(
            items: $0,
            count: $1,
            index: @core.plus(left: $2, right: 1),
            acc: @core.list-append(list: $3, item: $4)
          )
      }
  }
visibility
public
definy.strings-take (project definy, branch main, snapshot l0VFjJZP174d8CbZWFoujAGTYjgsQu4uTq5uWCZaXgo)
id: I_jVeoT1AD53X6YFggmQJaGGtORxveW81q7HPUiQbb0
content hash: xBSttyOqUb_RN1pUBAG6h85JhYSuQwd8euPFGKGdBMs