import { List } from '../types' ; import { arrayFrom } from '../arrayFrom' ; import { curry2 } from '@typed/functions' ; name export const sort = curry2 ( __sort ) ; export type Sort = { < A > ( comparator , list ) : Array < A > ; < A > ( comparator ) : ( list : List < A > ) => Array < A > ; } ; function __sort < A > ( comparator , list ) { return arrayFrom ( list ) . slice ( 0 ) . sort ( comparator ) ; }