list-extras-0.4.1.6: Common not-so-common functions for lists
CopyrightCopyright (c) 2007--2021 wren gayle romano
LicenseBSD3
Maintainerwren@cpan.org
Stabilitystable
PortabilityHaskell98
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.List.Extras

Description

This module provides a single header for all Data.List.Extras.* modules and provides a small number of other utility functions.

Synopsis

Documentation

list :: (a -> [a] -> b) -> b -> [a] -> b Source #

Pattern matching for lists, as a first-class function. (Could also be considered as a non-recursive foldr.) If the list argument is [] then the default argument is returned; otherwise the function is called with the head and tail of the list.