Safe Haskell | None |
---|---|

Language | Haskell2010 |

This module reexports most of the definitions from the "base" package, which are meant to be imported unqualified.

For details check out the source.

- map :: Functor f => (a -> b) -> f a -> f b
- bool :: a -> a -> Bool -> a
- (&) :: a -> (a -> b) -> b
- ($>) :: Functor f => f a -> b -> f b
- isSubsequenceOf :: Eq a => [a] -> [a] -> Bool
- sortOn :: Ord b => (a -> b) -> [a] -> [a]
- uncons :: [a] -> Maybe (a, [a])
- traceShowId :: Show a => a -> a
- traceM :: Monad m => String -> m ()
- traceShowM :: (Show a, Monad m) => a -> m ()

# Reimplementations of functions presented in versions of "base" newer than 4.6

## Prelude and Data.List

## Data.Bool

bool :: a -> a -> Bool -> a Source

Case analysis for the `Bool`

type.
`bool a b p`

evaluates to `a`

when `p`

is `False`

, and evaluates to `b`

when `p`

is `True`

.

## Data.Function

## Data.Functor

## Data.List

isSubsequenceOf :: Eq a => [a] -> [a] -> Bool Source

The `isSubsequenceOf`

function takes two lists and returns `True`

if the
first list is a subsequence of the second list.

is equivalent to `isSubsequenceOf`

x y

.`elem`

x (`subsequences`

y)

#### Examples

`>>>`

True`isSubsequenceOf "GHC" "The Glorious Haskell Compiler"`

`>>>`

True`isSubsequenceOf ['a','d'..'z'] ['a'..'z']`

`>>>`

False`isSubsequenceOf [1..10] [10,9..0]`

sortOn :: Ord b => (a -> b) -> [a] -> [a] Source

Sort a list by comparing the results of a key function applied to each
element. `sortOn f`

is equivalent to `sortBy . comparing f`

, but has the
performance advantage of only evaluating `f`

once for each element in the
input list. This is called the decorate-sort-undecorate paradigm, or
Schwartzian transform.

## Debug.Trace

traceShowId :: Show a => a -> a Source

Like `traceShow`

but returns the shown value instead of a third value.