1
2
3
4
5
6
7
8
USING: kernel sequences combinators.lib math ;

: uniq-only ( seq -- newseq )
    dup [ [ = ] curry ] swap [ slip swap count 1 = ] 2curry subset ;

! example
USE: prettyprint
{ 3 1 4 1 5 9 2 6 5 } uniq-only .