Enumeration type, how to pass parameters

type Pattern = {#char : Char; #text : Text; #predicate : (Char → Bool)}

func split(t : Text, p : Pattern) : Iter.Iter

private func splitText(params:Text) :[Text] {
let retArr :[Text] = ;
Text.split(params, #char:"");
How to write pattern format??????
};

There’s some examples here https://github.com/dfinity/motoko-base/blob/2ac0707502bf7ffd816a37d480861f7a60e65628/test/textTest.mo#L230

1 Like