Copyright | (c) Joãoo Saraiva 20012002200320042005 |
---|---|

License | LGPL |

Maintainer | jas@di.uminho.pt |

Stability | provisional |

Portability | portable |

Safe Haskell | Safe |

Language | Haskell98 |

HaLeX Utility Functions

Code Included in the Lecture Notes on Language Processing (with a functional flavour).

- (<->) :: Eq a => [a] -> [a] -> [a]
- limit :: Eq a => (a -> a) -> a -> a
- permutations :: [a] -> [[a]]

# Documentation

(<->) :: Eq a => [a] -> [a] -> [a] Source #

List Function: l1 - l2. Unlike List.(\), this function removes duplicates as well.

limit :: Eq a => (a -> a) -> a -> a Source #

Apply a function repeatedly, until a fix point is reached, i.e. until the result of the function is the same as the argument.

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

Compute the permutations of a given list. For instance,

permutations [1,2,3] = [[1,2,3],[2,1,3],[2,3,1],[1,3,2],[3,1,2],[3,2,1]]