Skip to content

Conversation

@zeme-wana
Copy link
Collaborator

@zeme-wana zeme-wana commented Apr 22, 2025

  • Expand the BuiltinList API, bringing near feature parity between PlutusTx.Data.List and PlutusTx.BuiltinList.
  • Add 1 test case for each new API function
  • Add mayMaybe function to PlutusTx.List
  • Add new "PT23", "PT24", "PT25" error codes

@zeme-wana zeme-wana marked this pull request as ready for review May 27, 2025 08:12
@zeme-wana zeme-wana requested a review from Unisay May 29, 2025 10:35
Comment on lines 8 to 12
\(xs : list integer) ->
let
!x : Unit = trace {Unit} "PT21" Unit
in
error {integer}
Copy link
Contributor

@Unisay Unisay May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What an optimisation!

However, you might want to switch optimisations off, as they go too far reducing this test to the form where its not testing what you want in runtime, instead eliminating the whole problem (test setup) in compile time.

(constr 0 [])
(constr 0 []))))
(\str -> (\x -> error) (force trace str (constr 0 []))))) No newline at end of file
(program 1.1.0 (\xs -> (\x -> error) (force trace "PT21" (constr 0 [])))) No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: the aspect you're trying to test (how are negative indexes handled) got optimised away.

let
!x : Unit = trace {Unit} "PT22" Unit
in
error {Unit -> integer})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like error here is unconditional too...

((\x xs ds _ann -> x) (force headList l) (force tailList l))))
(constr 0 [])
(constr 0 []))
(force dropList 10 xs)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ifThenElse got eliminated...

@zeme-wana zeme-wana requested a review from Unisay June 4, 2025 07:50
@zeme-wana zeme-wana merged commit 56a2677 into master Jun 5, 2025
14 of 15 checks passed
@zeme-wana zeme-wana deleted the list-api branch June 5, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants