packages feed

relude-0.3.0 / src / Relude / Unsafe.hs

{-# LANGUAGE Unsafe #-}{- |Copyright: (c) 2016 Stephen Diehl           (c) 20016-2018 Serokell           (c) 2018 KowainikLicense:    MITMaintainer: Kowainik <xrom.xkov@gmail.com>Unsafe functions to work with lists and 'Maybe'. Sometimes unavoidable but it'sbetter not to use them. This module is intended to be imported qualified andit's not even included in default prelude exports.@import qualified Relude.Unsafe as Unsafefoo :: [a] -> afoo = Unsafe.head@-}module Relude.Unsafe       ( module Data.List       , module Data.Maybe       , at       ) whereimport Data.List (head, init, last, tail, (!!))import Data.Maybe (fromJust)import Relude.Base (Int)import Relude.Function (flip)-- | Similar to '!!' but with flipped arguments.at :: Int -> [a] -> aat = flip (!!)