[a] -> a -> Maybe Int

elemIndex :: Eq a => a -> [a] -> Maybe Int
base Data.List
The elemIndex function returns the index of the first element in the given list which is equal (by ==) to the query element, or Nothing if there is no such element.
findSubstring :: ByteString -> ByteString -> Maybe Int
bytestring Data.ByteString
Deprecated: findSubstring is deprecated in favour of breakSubstring.
findSubstring :: ByteString -> ByteString -> Maybe Int
bytestring Data.ByteString.Char8
Get the first index of a substring in another string, or Nothing if the string is not found. findSubstring p s is equivalent to listToMaybe (findSubstrings p s).
lookupIndex :: Ord a => a -> Set a -> Maybe Int
containers Data.Set
O(log n). Lookup the index of an element, which is its zero-based index in the sorted sequence of elements. The index is a number from 0 up to, but not including, the size of the set. > isJust (lookupIndex 2 (fromList [5,3])) == False > fromJust (lookupIndex 3 (fromList [5,3])) == 0 > fromJust (lookupIndex 5 (fromList [5,3])) == 1 > isJust (lookupIndex 6 (fromList [5,3])) == False
elemIndexL :: Eq a => a -> Seq a -> Maybe Int
containers Data.Sequence
elemIndexL finds the leftmost index of the specified element, if it is present, and otherwise Nothing.
elemIndexR :: Eq a => a -> Seq a -> Maybe Int
containers Data.Sequence
elemIndexR finds the rightmost index of the specified element, if it is present, and otherwise Nothing.
monthAndDayToDayOfYearValid :: Bool -> Int -> Int -> Maybe Int
time Data.Time.Calendar.MonthDay
convert month and day in the Gregorian or Julian calendars to day of year. First arg is leap year flag
ignore :: OnError a b
text Data.Text.Encoding.Error
Ignore an invalid input, substituting nothing in the output.
asTypeOf :: a -> a -> a
base Prelude
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.
(!!) :: [a] -> Int -> a
base Prelude, base Data.List
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.
buf_concat :: BufferOp a -> [a] -> a
HTTP Network.BufferType
trace :: String -> a -> a
base Debug.Trace
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.
count :: Text -> Text -> Int
text Data.Text
O(n+m) The count function returns the number of times the query string appears in the given Text. An empty query string is invalid, and will cause an error to be raised. In (unlikely) bad cases, this function's time complexity degrades towards O(n*m).
foldM :: Monad m => (a -> b -> m a) -> a -> [b] -> m a
base Control.Monad
The foldM function is analogous to foldl, except that its result is encapsulated in a monad. Note that foldM works from left-to-right over the list arguments. This could be an issue commutative. > foldM f a1 [x1, x2, ..., xm] == > do > a2 <- f a1 x1 > a3 <- f a2 x2 > ... > f am xm If right-to-left evaluation is required, the input list should be reversed.
buf_append :: BufferOp a -> a -> a -> a
HTTP Network.BufferType
findIndex :: Ord a => a -> Set a -> Int
containers Data.Set
O(log n). Return the index of an element, which is its zero-based index in the sorted sequence of elements. The index is a number from 0 up to, but not including, the size of the set. Calls error when the element is not a member of the set. > findIndex 2 (fromList [5,3]) Error: element is not in the set > findIndex 3 (fromList [5,3]) == 0 > findIndex 5 (fromList [5,3]) == 1 > findIndex 6 (fromList [5,3]) Error: element is not in the set
foldl :: (a -> b -> a) -> a -> [b] -> a
base Prelude, base Data.List
foldl, applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right: > foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn The list must be finite.
foldl' :: (a -> b -> a) -> a -> [b] -> a
base Data.List
A strict version of foldl.
(.&.) :: Bits a => a -> a -> a
base Data.Bits
(.|.) :: Bits a => a -> a -> a
base Data.Bits

Show more results