value
ordinalNub Return the the subset of given ordinals within a given bound and in order of the first occurrence seen.
Bound: 0 <= x < l
ordinalNub 3 [-1,2,1,4,2,3][2,1]
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Modulelens-5.3.5Haskell2010
This module provides utility functions on lists used by the library implementation.
ordinalNub Return the the subset of given ordinals within a given bound and in order of the first occurrence seen.
Bound: 0 <= x < l
ordinalNub 3 [-1,2,1,4,2,3][2,1]
\mathcal{O}(\min(m,n)). The stripSuffix function drops the given
suffix from a list. It returns Nothing if the list did not end with the
suffix given, or Just the list after the suffix, if it does.
stripSuffix "bar" "foobar"Just "foo"
stripSuffix "foo" "foo"Just ""
stripSuffix "bar" "barfoo"Nothing
stripSuffix "foo" "barfoobaz"Nothing