drasil-utils-0.1.1.0: A framework for code and document generation for scientific software - Utils SubPackage
Safe HaskellSafe-Inferred
LanguageHaskell2010

Utils.Drasil.Lists

Description

Functions for working with lists.

Synopsis

Documentation

atLeast2 :: [a] -> Bool Source #

Check if list has at least 2 elements.

replaceAll :: Eq a => [a] -> a -> [a] -> [a] Source #

Replaces all elements of a target list that belong to a provided "bad" input list.

subsetOf :: Eq a => [a] -> [a] -> Bool Source #

Checks if the first set is a subset of the second.

nubSort :: Ord a => [a] -> [a] Source #

Sort a list, removing all duplicates

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

Interweaves two lists together [[a,b,c],[d,e,f]] -> [a,d,b,e,c,f].

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

Fold helper function that applies f to all but the last element, applies g to last element and the accumulator.

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

Fold helper function that applies f to all but last element, applies g to last element and accumulator without starting value, does not work for empty list.

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

Convert "row" of elements into "column" of elements.