 ! Copyright (c) 2007, 2008 Slava Pestov, Doug Coleman, Aaron Schaefer.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs kernel math math.order math.ranges mirrors
-namespaces sequences sorting ;
+namespaces sequences sequences.lib sorting ;
 IN: math.combinatorics
 
 <PRIVATE

    twiddle [ nPk ] keep factorial / ;

: permutation ( n seq -- seq )
    tuck permutation-indices reorder ;

: all-permutations ( seq -- seq )
    [

: permutation-indices ( n seq -- permutation )
    length [ factoradic ] dip 0 pad-left >permutation ;

PRIVATE>

: factorial ( n -- n! )
