Scrapbook-0.4.0: code examples
Copyright© Frank Jung 2020
LicenseGPL-3
Safe HaskellSafe-Inferred
LanguageHaskell2010

MyReverse

Description

Reverse a list using foldl and foldr.

Synopsis

Documentation

myRevl :: [a] -> [a] Source #

Reverse a list using foldl.

myRevr :: [a] -> [a] Source #

Reverse a list using foldr. This is the best performing version.

This pointfree form is the same as:

myRevr xs = foldr (\ x acc -> (x :) >>> acc) id xs []

myRevRec :: [a] -> [a] Source #

Reverse using recursion and reverse operation.