Is it possible to use hyphenation costs without justification?

I’m writing a document without justification, and would still like to occasionally use hyphenation. I could #set text(hyphenate: false) and then manually insert #{sym.hyph.soft} wherever I want a long word to be breakable, but that’s hard to read and a lot of trouble. The docs indicate that hyphenation can be tuned, but that doesn’t seem to apply for unjustified text – or am I missing something?

#set page(width: 200pt)

#let example = [This text illustrates how enabling hyphenation can improve justification.]

#set par(justify: true)
#example

#set text(hyphenate: false)
#example

#set par(justify: false)
#set text(hyphenate: true, costs: (hyphenation: 1%))
#example

#set text(hyphenate: true, costs: (hyphenation: 100000%))
#example

Yeah indeed. Seems like a bug to me. Maybe @PgBiel knows more?

You can set par(linebreaks: "optimized") for unjustified text. Without it, the costs will indeed have no effect.