CurryInfo: base-3.4.0 / Data.List.permutations

definition: Info
 
permutations           :: [a] -> [[a]]
permutations xs0       =  xs0 : perms xs0 []
 where
  perms []     _  = []
  perms (t:ts) is = foldr interleave (perms ts (t:is)) (permutations is)
    where interleave    xs     r = let (_, zs) = interleave' id xs r in zs
          interleave' _ []     r = (ts, r)
          interleave' f (y:ys) r = let (us, zs) = interleave' (f . (y:)) ys r
                                   in (y:us, f (t:y:us) : zs)
demand: Info
 no demanded arguments
deterministic: Info
 deterministic operation
documentation: Info
 
Returns the list of all permutations of the argument.
failfree: Info
 _
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_) |-> {:}}
name: Info
 permutations
precedence: Info
 no precedence defined
result-values: Info
 {:}
signature: Info
 [a] -> [[a]]
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 reducible on all ground data terms