<commit_before>module Problems where

import Test.Hspec
import Test.QuickCheck

myLast :: [a] -> a
myLast (x:[]) = x
myLast (_:xs) = myLast xs

main :: IO ()
main = hspec $ do
  describe "List functions" $ do
    it "should find the last element of the list" $ do
      myLast [1,2,3,4] `shouldBe` 4
    it "last of an empty list should be an error" $ do
      myLast [] `shouldThrow` anyException
<commit_msg>failing test<commit_after>module Problems where

import Test.Hspec
import Test.QuickCheck

myLast :: [a] -> a
myLast (x:[]) = x
myLast (_:xs) = myLast xs

myButLast = undefined

main :: IO ()
main = hspec $ do
  describe "List functions" $ do
    it "should find the last element of the list" $ do
      myLast [1,2,3,4] `shouldBe` 4
    it "last of an empty list should be an error" $ do
      myLast [] `shouldThrow` anyException
    it "should find last but one element of the list" $ do
      myButLast [1,2,3,4] `shouldBe` 3

{'fraction_non_alphanumeric': 0.11170212765957446, 'fraction_numerical': 0.015957446808510637, 'mean_word_length': 3.2772727272727273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1432752', 'n_tokens_mistral': 328, 'n_tokens_neox': 318, 'n_words': 126}