cookbook-3.0.1.1: Tiered general-purpose libraries with domain-specific applications.

Copyright(c) 2015 by Nate Pisarski
LicenseBSD3
Maintainernathanpisarski@gmail.com
StabilityStable
PortabilityPortable (Standalone - ghc)
Safe HaskellSafe
LanguageHaskell98

Cookbook.Essential.Common

Description

"global" functions for the entirety of the Cookbook library. Common is the potpourri of Cookbook, with no category except "everything uses me!"

Synopsis

Documentation

sub :: Eq a => [a] -> Int -> [a] Source #

Return a list starting at an index. Indices start at 0.

positions :: Eq a => [a] -> a -> [Int] Source #

Find the occurrences of an element in a list.

pos :: Eq a => [a] -> a -> Int Source #

C-style wrapper for positions. Returns the first occurrence in a list, or -1 on notElem.

apply :: [a -> a] -> a -> a Source #

Reversal of map function. Chains calls of functions over a parameter, starting with head.

flt :: [[a]] -> [a] Source #

Flatten a list one level.

fromLast :: ([a] -> [a]) -> [a] -> [a] Source #

Execute a function from the end of a list to the front.

afterX :: Eq a => [a] -> a -> Int -> [a] Source #

After a certain number of an element, return the list.

iSp :: [a] -> a -> [a] Source #

Internal implementation of "intersperse".