gf-3.6: Grammatical Framework

Safe HaskellSafe-Inferred

PGF.Utilities

Description

Basic utilities

Synopsis

Documentation

nub' :: Ord a => [a] -> [a]Source

Like nub, but O(n log n) instead of O(n^2), since it uses a set to lookup previous things. The result list is stable (the elements are returned in the order they occur), and lazy. Requires that the list elements can be compared by Ord. Code ruthlessly taken from http://hpaste.org/54411

replace :: Eq a => a -> a -> [a] -> [a]Source

Replace all occurences of an element by another element.