Module Daml.Finance.Util.Common

Functions

groupBy

: Ord k => (a -> k) -> [a] -> Map k [a]

Like List.groupOn, but returns the output in a Map.

mapWithIndex

: (a -> Int -> b) -> [a] -> [b]

Like map, but the mapping function includes the zero-based index of the item.

notNull

: [a] -> Bool

Checks if the input list is not empty.

sortAndGroupOn

: Ord k => (a -> k) -> [a] -> [[a]]

Like List.groupOn, but sorts the list first.