[a] -> a -> Bool
elem is the list membership predicate, usually written in infix form, e.g., x `elem` xs. For the result to be False, the list must be finite; True, however, results from an element equal to x found at a finite index of a finite or infinite list.
The isInfixOf function takes two lists and returns True iff the first list is contained, wholly and intact, anywhere within the second.
> isInfixOf "Haskell" "I really like Haskell." == True
> isInfixOf "Ial" "I really like Haskell." == False
The isPrefixOf function takes two lists and returns True iff the first list is a prefix of the second.
The isSuffixOf function takes two lists and returns True iff the first list is a suffix of the second. Both lists must be finite.
Does the element occur in the structure?
List index (subscript) operator, starting from 0. It is an instance of the more general Data.List.genericIndex, which takes an index of any integral type.
asTypeOf is a type-restricted version of const. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second.
Generic equality: an alternative to "deriving Eq"
The intersperse function takes an element and a list and `intersperses' that element between the elements of the list. For example,
> intersperse ',' "abcde" == "a,b,c,d,e"
When called, trace outputs the string in its first argument, before returning the second argument as its result. The trace function is not referentially transparent, and should only be used for debugging, or for monitoring execution. Some implementations of trace may decorate the string that's output to indicate that you're tracing. The function is implemented on top of putTraceMsg.
Show more results