CakeML/cakeml

Add contains to Char module

Aperta

#1433 aperta il 18 lug 2026

 (0 commenti) (0 reazioni) (0 assegnatari)Standard ML (98 fork)auto 404
basis extensionsgood first issuelow effort

Metriche repository

Star
 (1169 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

It would be useful to have Char.contains in part of the basis. One simple implementation is the following:

fun contains s c = List.member c (String.explode s)

However, I would suspect that it would be better to avoid the explode and iterate over the string instead for the definition that ends up being translated. It might be neat to prove a theorem of equivalence between them, though.

Guida contributor