feldspar-language-0.2: A functional embedded language for DSP and parallelism



General utility functions



allEqual :: Eq a => [a] -> BoolSource

Checks if all elements in the list are equal.

showSeq :: String -> [String] -> String -> StringSource

showSeq open strs close:

Shows the strings strs separated by commas and enclosed within the open and close strings.

appendFirstLine :: String -> String -> StringSource

Append the first argument to the first line of the second argument.

(!!!) :: Ord a => Map a [b] -> a -> [b]Source

A Map lookup that treats undefined keys as mapping to empty lists.

invertMap :: (Ord a, Ord b) => Map a b -> Map b [a]Source

Inverts a Map. The argument map may have several keys mapping to the same element, so the inverted map has a list of elements for each key.

topSort :: Ord a => Map a [a] -> [a]Source

Topological sort. Lists the nodes in the map such that each node appears before its children. The function only terminates for acyclic maps.