lcs-0.2: Find longest common sublist of two lists

Copyright(c) Ian Lynagh 2005, 2008
LicenseBSD or GPL v2
Maintainerigloo@earth.li
Stabilityprovisional
Portabilitynon-portable (HuntSzymanski implementation is non-portable)
Safe HaskellNone
LanguageHaskell98

Data.List.LCS

Description

Provides a function lcs that takes two lists and returns a longest common sublist. For example, lcs "abcd" "acbd" is either "abd" or "acd".

Synopsis

Documentation

lcs :: Ord a => [a] -> [a] -> [a]

The lcs function takes two lists and returns a list with a longest common subsequence of the two.