packages feed

relude-0.1.1 / src / Relude / Unsafe.hs

{-# LANGUAGE Unsafe #-}{-Copyright: (c) 2016 Stephen Diehl           (c) 20016-2018 Serokell           (c) 2018 KowainikLicense: MIT-}{- | Unsafe functions to work with lists and 'Maybe'.Sometimes unavoidable but better don't use them. This moduleis intended to be imported qualified and it's not even includedin default prelude exports.@import qualified Relude.Unsafe as Unsafefoo :: [a] -> afoo = Unsafe.head@-}module Relude.Unsafe       ( head       , tail       , init       , last       , at       , (!!)       , fromJust       ) 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 (!!)