Skip to content

Commit

Permalink
Undo the Eta expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Jan 18, 2024
1 parent d55b09f commit 0237521
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Safe.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,15 @@ at_ xs o | o < 0 = Left $ "index must not be negative, index=" ++ show o
-- > tailErr [] = error "Prelude.tail: empty list"
-- > tailErr [1,2,3] = [2,3]
tailErr :: Partial => [a] -> [a]
tailErr x = tail x
tailErr = tail

-- | Identical to 'head', namely that fails on an empty list.
-- Useful to avoid the @x-partial@ warning introduced in GHC 9.8.
--
-- > headErr [] = error "Prelude.head: empty list"
-- > headErr [1,2,3] = 1
headErr :: Partial => [a] -> a
headErr x = head x
headErr = head

-- |
-- > tailMay [] = Nothing
Expand Down

0 comments on commit 0237521

Please sign in to comment.