ogma-extra-1.15.0: Ogma: Helper tool to interoperate between Copilot and other languages.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.List.Extra

Description

Auxiliary functions for working with values of type '[]'.

Synopsis

- headEither :: [a] -> Either String a
- toHead :: (a -> a) -> [a] -> [a]
- toTail :: (a -> a) -> [a] -> [a]
- stripSuffix :: String -> String -> String

# Documentation

headEither :: [a] -> Either String a Source #

Safely extract the head of a list.

toHead :: (a -> a) -> [a] -> [a] Source #

Apply a transformation only to the head of a list.

toTail :: (a -> a) -> [a] -> [a] Source #

Apply a transformation only to the tail of a list.

stripSuffix :: String -> String -> String Source #

Remove a suffix from a string, if present.