name stringclasses 161
values | language stringclasses 22
values | prompt stringlengths 40 2.27k | doctests stringclasses 3
values | original stringclasses 956
values | prompt_terminology stringclasses 2
values | tests stringlengths 125 5.35k | stop_tokens listlengths 1 7 |
|---|---|---|---|---|---|---|---|
HumanEval_4_mean_absolute_deviation | hs | -- | For a given list of input numbers, calculate Mean Absolute Deviation
-- around the mean of this dataset.
-- Mean Absolute Deviation is the average absolute difference between each
-- element and a centerpoint (mean in this case):
-- MAD = average | x - x_mean |
meanAbsoluteDeviation :: [Float] -> Float
meanAbs... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_4_mean_absolute_deviation.py | verbatim |
main :: IO ()
main = do
let candidate = meanAbsoluteDeviation
if candidate [1.0,2.0] == 0.5 then pure () else error "assertion failed"
if candidate [1.0,2.0,3.0,4.0] == 1.0 then pure () else error "assertion failed"
if candidate [1.0,2.0,3.0,4.0,5.0] == 1.2 then pure () else error "assertion failed"
pure () | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_51_remove_vowels | hs | -- | remove_vowels is a function that takes string and returns string without vowels.
removeVowels :: String -> String
removeVowels text = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_51_remove_vowels.py | verbatim |
main :: IO ()
main = do
let candidate = removeVowels
if candidate "" == "" then pure () else error "assertion failed"
if candidate "abcdef
ghijklm" == "bcdf
ghjklm" then pure () else error "assertion failed"
if candidate "fedcba" == "fdcb" then pure () else error "assertion failed"
if candidate "eeeee" == ""... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_52_below_threshold | hs | -- | Return True if all numbers in the list l are below threshold t.
belowThreshold :: [Int] -> Int -> Bool
belowThreshold l t = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_52_below_threshold.py | verbatim |
main :: IO ()
main = do
let candidate = belowThreshold
if candidate [1,2,4,10] 100 == True then pure () else error "assertion failed"
if candidate [1,20,4,10] 5 == False then pure () else error "assertion failed"
if candidate [1,20,4,10] 21 == True then pure () else error "assertion failed"
if candidate [1,2... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_53_add | hs | -- | Add two numbers x and y
add :: Int -> Int -> Int
add x y = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_53_add.py | verbatim |
main :: IO ()
main = do
let candidate = add
if candidate 0 1 == 1 then pure () else error "assertion failed"
if candidate 1 0 == 1 then pure () else error "assertion failed"
if candidate 2 3 == 5 then pure () else error "assertion failed"
if candidate 5 7 == 12 then pure () else error "assertion failed"
if... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_54_same_chars | hs | -- | Check if two words have the same characters.
sameChars :: String -> String -> Bool
sameChars s0 s1 = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_54_same_chars.py | verbatim |
main :: IO ()
main = do
let candidate = sameChars
if candidate "eabcdzzzz" "dddzzzzzzzddeddabc" == True then pure () else error "assertion failed"
if candidate "abcd" "dddddddabc" == True then pure () else error "assertion failed"
if candidate "dddddddabc" "abcd" == True then pure () else error "assertion fail... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_55_fib | hs | -- | Return n-th Fibonacci number.
fib :: Int -> Int
fib n = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_55_fib.py | verbatim |
main :: IO ()
main = do
let candidate = fib
if candidate 10 == 55 then pure () else error "assertion failed"
if candidate 1 == 1 then pure () else error "assertion failed"
if candidate 8 == 21 then pure () else error "assertion failed"
if candidate 11 == 89 then pure () else error "assertion failed"
if can... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_56_correct_bracketing | hs | -- | brackets is a string of "<" and ">".
-- return True if every opening bracket has a corresponding closing bracket.
correctBracketing :: String -> Bool
correctBracketing brackets = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_56_correct_bracketing.py | verbatim |
main :: IO ()
main = do
let candidate = correctBracketing
if candidate "<>" == True then pure () else error "assertion failed"
if candidate "<<><>>" == True then pure () else error "assertion failed"
if candidate "<><><<><>><>" == True then pure () else error "assertion failed"
if candidate "<><><<<><><>><>>... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_57_monotonic | hs | -- | Return True is list elements are monotonically increasing or decreasing.
monotonic :: [Int] -> Bool
monotonic l = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_57_monotonic.py | verbatim |
main :: IO ()
main = do
let candidate = monotonic
if candidate [1,2,4,10] == True then pure () else error "assertion failed"
if candidate [1,2,4,20] == True then pure () else error "assertion failed"
if candidate [1,20,4,10] == False then pure () else error "assertion failed"
if candidate [4,1,0,(-10)] == Tr... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_58_common | hs | -- | Return sorted unique common elements for two lists.
common :: [Int] -> [Int] -> [Int]
common l1 l2 = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_58_common.py | verbatim |
main :: IO ()
main = do
let candidate = common
if candidate [1,4,3,34,653,2,5] [5,7,1,5,9,653,121] == [1,5,653] then pure () else error "assertion failed"
if candidate [5,3,2,8] [3,2] == [2,3] then pure () else error "assertion failed"
if candidate [4,3,2,8] [3,2,4] == [2,3,4] then pure () else error "assertio... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_59_largest_prime_factor | hs | -- | Return the largest prime factor of n. Assume n > 1 and is not a prime.
largestPrimeFactor :: Int -> Int
largestPrimeFactor n = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_59_largest_prime_factor.py | verbatim |
main :: IO ()
main = do
let candidate = largestPrimeFactor
if candidate 15 == 5 then pure () else error "assertion failed"
if candidate 27 == 3 then pure () else error "assertion failed"
if candidate 63 == 7 then pure () else error "assertion failed"
if candidate 330 == 11 then pure () else error "assertion ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_5_intersperse | hs | -- | Insert a number 'delimeter' between every two consecutive elements of input list `numbers'
intersperse :: [Int] -> Int -> [Int]
intersperse numbers delimeter = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_5_intersperse.py | verbatim |
main :: IO ()
main = do
let candidate = intersperse
if candidate [] 7 == [] then pure () else error "assertion failed"
if candidate [5,6,3,2] 8 == [5,8,6,8,3,8,2] then pure () else error "assertion failed"
if candidate [2,2,2] 2 == [2,2,2,2,2] then pure () else error "assertion failed"
pure () | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_60_sum_to_n | hs | -- | sum_to_n is a function that sums numbers from 1 to n.
sumToN :: Int -> Int
sumToN n = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_60_sum_to_n.py | verbatim |
main :: IO ()
main = do
let candidate = sumToN
if candidate 1 == 1 then pure () else error "assertion failed"
if candidate 6 == 21 then pure () else error "assertion failed"
if candidate 11 == 66 then pure () else error "assertion failed"
if candidate 30 == 465 then pure () else error "assertion failed"
if... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_61_correct_bracketing | hs | -- | brackets is a string of "(" and ")".
-- return True if every opening bracket has a corresponding closing bracket.
correctBracketing :: String -> Bool
correctBracketing brackets = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_61_correct_bracketing.py | verbatim |
main :: IO ()
main = do
let candidate = correctBracketing
if candidate "()" == True then pure () else error "assertion failed"
if candidate "(()())" == True then pure () else error "assertion failed"
if candidate "()()(()())()" == True then pure () else error "assertion failed"
if candidate "()()((()()())())... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_62_derivative | hs | -- | xs represent coefficients of a polynomial.
-- xs[0] + xs[1] * x + xs[2] * x^2 + ....
-- Return derivative of this polynomial in the same form.
derivative :: [Int] -> [Int]
derivative xs = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_62_derivative.py | verbatim |
main :: IO ()
main = do
let candidate = derivative
if candidate [3,1,2,4,5] == [1,4,12,20] then pure () else error "assertion failed"
if candidate [1,2,3] == [2,6] then pure () else error "assertion failed"
if candidate [3,2,1] == [2,2] then pure () else error "assertion failed"
if candidate [3,2,1,0,4] == [... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_63_fibfib | hs | -- | The FibFib number sequence is a sequence similar to the Fibbonacci sequnece that's defined as follows:
-- fibfib(0) == 0
-- fibfib(1) == 0
-- fibfib(2) == 1
-- fibfib(n) == fibfib(n-1) + fibfib(n-2) + fibfib(n-3).
-- Please write a function to efficiently compute the n-th element of the fibfib number sequence... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_63_fibfib.py | verbatim |
main :: IO ()
main = do
let candidate = fibfib
if candidate 2 == 1 then pure () else error "assertion failed"
if candidate 1 == 0 then pure () else error "assertion failed"
if candidate 5 == 4 then pure () else error "assertion failed"
if candidate 8 == 24 then pure () else error "assertion failed"
if cand... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_64_vowels_count | hs | -- | Write a function vowels_count which takes a string representing
-- a word as input and returns the number of vowels in the string.
-- Vowels in this case are 'a', 'e', 'i', 'o', 'u'. Here, 'y' is also a
-- vowel, but only when it is at the end of the given word.
-- Example:
vowelsCount :: String -> Int
vowelsC... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_64_vowels_count.py | verbatim |
main :: IO ()
main = do
let candidate = vowelsCount
if candidate "abcde" == 2 then pure () else error "assertion failed"
if candidate "Alone" == 3 then pure () else error "assertion failed"
if candidate "key" == 2 then pure () else error "assertion failed"
if candidate "bye" == 1 then pure () else error "ass... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_65_circular_shift | hs | -- | Circular shift the digits of the integer x, shift the digits right by shift
-- and return the result as a string.
-- If shift > number of digits, return digits reversed.
circularShift :: Int -> Int -> String
circularShift x shift = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_65_circular_shift.py | verbatim |
main :: IO ()
main = do
let candidate = circularShift
if candidate 100 2 == "001" then pure () else error "assertion failed"
if candidate 12 2 == "12" then pure () else error "assertion failed"
if candidate 97 8 == "79" then pure () else error "assertion failed"
if candidate 12 1 == "21" then pure () else er... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_66_digitSum | hs | -- | Task
-- Write a function that takes a string as input and returns the sum of the upper characters only'
-- ASCII codes.
-- Examples:
digitsum :: String -> Int
digitsum s = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_66_digitSum.py | verbatim |
main :: IO ()
main = do
let candidate = digitsum
if candidate "" == 0 then pure () else error "assertion failed"
if candidate "abAB" == 131 then pure () else error "assertion failed"
if candidate "abcCd" == 67 then pure () else error "assertion failed"
if candidate "helloE" == 69 then pure () else error "ass... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_67_fruit_distribution | hs | -- | In this task, you will be given a string that represents a number of apples and oranges
-- that are distributed in a basket of fruit this basket contains
-- apples, oranges, and mango fruits. Given the string that represents the total number of
-- the oranges and apples and an integer that represent the tota... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_67_fruit_distribution.py | verbatim |
main :: IO ()
main = do
let candidate = fruitDistribution
if candidate "5 apples and 6 oranges" 19 == 8 then pure () else error "assertion failed"
if candidate "5 apples and 6 oranges" 21 == 10 then pure () else error "assertion failed"
if candidate "0 apples and 1 oranges" 3 == 2 then pure () else error "asse... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_68_pluck | hs | -- | "Given an array representing a branch of a tree that has non-negative integer nodes
-- your task is to pluck one of the nodes and return it.
-- The plucked node should be the node with the smallest even value.
-- If multiple nodes with the same smallest even value are found return the node that has smallest ind... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_68_pluck.py | verbatim |
main :: IO ()
main = do
let candidate = pluck
if candidate [4,2,3] == [2,1] then pure () else error "assertion failed"
if candidate [1,2,3] == [2,1] then pure () else error "assertion failed"
if candidate [] == [] then pure () else error "assertion failed"
if candidate [5,0,3,0,4,2] == [0,1] then pure () els... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_69_search | hs | -- | You are given a non-empty list of positive integers. Return the greatest integer that is greater than
-- zero, and has a frequency greater than or equal to the value of the integer itself.
-- The frequency of an integer is the number of times it appears in the list.
-- If no such a value exist, return -1.
-- ... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_69_search.py | verbatim |
main :: IO ()
main = do
let candidate = search
if candidate [5,5,5,5,1] == 1 then pure () else error "assertion failed"
if candidate [4,1,4,1,4,4] == 4 then pure () else error "assertion failed"
if candidate [3,3] == (-1) then pure () else error "assertion failed"
if candidate [8,8,8,8,8,8,8,8] == 8 then pur... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_6_parse_nested_parens | hs | -- | Input to this function is a string represented multiple groups for nested parentheses separated by spaces.
-- For each of the group, output the deepest level of nesting of parentheses.
-- E.g. (()()) has maximum two levels of nesting while ((())) has three.
parseNestedParens :: String -> [Int]
parseNestedParens ... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_6_parse_nested_parens.py | verbatim |
main :: IO ()
main = do
let candidate = parseNestedParens
if candidate "(()()) ((())) () ((())()())" == [2,3,1,3] then pure () else error "assertion failed"
if candidate "() (()) ((())) (((())))" == [1,2,3,4] then pure () else error "assertion failed"
if candidate "(()(())((())))" == [4] then pure () else erro... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_70_strange_sort_list | hs | -- | Given list of integers, return list in strange order.
-- Strange sorting, is when you start with the minimum value,
-- then maximum of the remaining integers, then minimum and so on.
-- Examples:
strangeSortList :: [Int] -> [Int]
strangeSortList lst = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_70_strange_sort_list.py | verbatim |
main :: IO ()
main = do
let candidate = strangeSortList
if candidate [1,2,3,4] == [1,4,2,3] then pure () else error "assertion failed"
if candidate [5,6,7,8,9] == [5,9,6,8,7] then pure () else error "assertion failed"
if candidate [1,2,3,4,5] == [1,5,2,4,3] then pure () else error "assertion failed"
if candi... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_71_triangle_area | hs | -- | Given the lengths of the three sides of a triangle. Return the area of
-- the triangle rounded to 2 decimal points if the three sides form a valid triangle.
-- Otherwise return -1
-- Three sides make a valid triangle when the sum of any two sides is greater
-- than the third side.
-- Example:
triangleArea :... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_71_triangle_area.py | verbatim |
main :: IO ()
main = do
let candidate = triangleArea
if candidate 3 4 5 == 6.0 then pure () else error "assertion failed"
if candidate 1 2 10 == (-1).0 then pure () else error "assertion failed"
if candidate 4 8 5 == 8.18 then pure () else error "assertion failed"
if candidate 2 2 2 == 1.73 then pure () else... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_72_will_it_fly | hs | -- | Write a function that returns True if the object q will fly, and False otherwise.
-- The object q will fly if it's balanced (it is a palindromic list) and the sum of its elements is less than or equal the maximum possible weight w.
-- Example:
-- # 1+2 is less than the maximum possible weight, but it's unbalanc... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_72_will_it_fly.py | verbatim |
main :: IO ()
main = do
let candidate = willItFly
if candidate [3,2,3] 9 == True then pure () else error "assertion failed"
if candidate [1,2] 5 == False then pure () else error "assertion failed"
if candidate [3] 5 == True then pure () else error "assertion failed"
if candidate [3,2,3] 1 == False then pure ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_73_smallest_change | hs | -- | Given an array arr of integers, find the minimum number of elements that
-- need to be changed to make the array palindromic. A palindromic array is an array that
-- is read the same backwards and forwards. In one change, you can change one element to any other element.
-- For example:
smallestChange :: [Int] -... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_73_smallest_change.py | verbatim |
main :: IO ()
main = do
let candidate = smallestChange
if candidate [1,2,3,5,4,7,9,6] == 4 then pure () else error "assertion failed"
if candidate [1,2,3,4,3,2,2] == 1 then pure () else error "assertion failed"
if candidate [1,4,2] == 1 then pure () else error "assertion failed"
if candidate [1,4,4,2] == 1 t... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_74_total_match | hs | -- | Write a function that accepts two lists of strings and returns the list that has
-- total number of chars in the all strings of the list less than the other list.
-- if the two lists have the same number of chars, return the first list.
-- Examples
totalMatch :: [String] -> [String] -> [String]
totalMatch lst1... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_74_total_match.py | verbatim |
main :: IO ()
main = do
let candidate = totalMatch
if candidate [] [] == [] then pure () else error "assertion failed"
if candidate ["hi","admin"] ["hi","hi"] == ["hi","hi"] then pure () else error "assertion failed"
if candidate ["hi","admin"] ["hi","hi","admin","project"] == ["hi","admin"] then pure () else ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_75_is_multiply_prime | hs | -- | Write a function that returns true if the given number is the multiplication of 3 prime numbers
-- and false otherwise.
-- Knowing that (a) is less then 100.
-- Example:
-- 30 = 2 * 3 * 5
isMultiplyPrime :: Int -> Bool
isMultiplyPrime a = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_75_is_multiply_prime.py | verbatim |
main :: IO ()
main = do
let candidate = isMultiplyPrime
if candidate 5 == False then pure () else error "assertion failed"
if candidate 30 == True then pure () else error "assertion failed"
if candidate 8 == True then pure () else error "assertion failed"
if candidate 10 == False then pure () else error "ass... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_76_is_simple_power | hs | -- | Your task is to write a function that returns true if a number x is a simple
-- power of n and false in other cases.
-- x is a simple power of n if n**int=x
-- For example:
isSimplePower :: Int -> Int -> Bool
isSimplePower x n = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_76_is_simple_power.py | verbatim |
main :: IO ()
main = do
let candidate = isSimplePower
if candidate 16 2 == True then pure () else error "assertion failed"
if candidate 143214 16 == False then pure () else error "assertion failed"
if candidate 4 2 == True then pure () else error "assertion failed"
if candidate 9 3 == True then pure () else ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_77_iscube | hs | -- | Write a function that takes an integer a and returns True
-- if this ingeger is a cube of some integer number.
-- Note: you may assume the input is always valid.
-- Examples:
iscube :: Int -> Bool
iscube a = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_77_iscube.py | verbatim |
main :: IO ()
main = do
let candidate = iscube
if candidate 1 == True then pure () else error "assertion failed"
if candidate 2 == False then pure () else error "assertion failed"
if candidate (-1) == True then pure () else error "assertion failed"
if candidate 64 == True then pure () else error "assertion f... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_78_hex_key | hs | -- | You have been tasked to write a function that receives
-- a hexadecimal number as a string and counts the number of hexadecimal
-- digits that are primes (prime number, or a prime, is a natural number
-- greater than 1 that is not a product of two smaller natural numbers).
-- Hexadecimal digits are 0, 1, 2,... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_78_hex_key.py | verbatim |
main :: IO ()
main = do
let candidate = hexKey
if candidate "AB" == 1 then pure () else error "assertion failed"
if candidate "1077E" == 2 then pure () else error "assertion failed"
if candidate "ABED1A33" == 4 then pure () else error "assertion failed"
if candidate "2020" == 2 then pure () else error "asser... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_79_decimal_to_binary | hs | -- | You will be given a number in decimal form and your task is to convert it to
-- binary format. The function should return a string, with each character representing a binary
-- number. Each character in the string will be '0' or '1'.
-- There will be an extra couple of characters 'db' at the beginning and at th... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_79_decimal_to_binary.py | verbatim |
main :: IO ()
main = do
let candidate = decimalToBinary
if candidate 0 == "db0db" then pure () else error "assertion failed"
if candidate 32 == "db100000db" then pure () else error "assertion failed"
if candidate 103 == "db1100111db" then pure () else error "assertion failed"
if candidate 15 == "db1111db" th... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_7_filter_by_substring | hs | -- | Filter an input list of strings only for ones that contain given substring
filterBySubstring :: [String] -> String -> [String]
filterBySubstring strings substring = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_7_filter_by_substring.py | verbatim |
main :: IO ()
main = do
let candidate = filterBySubstring
if candidate [] "john" == [] then pure () else error "assertion failed"
if candidate ["xxx","asd","xxy","john doe","xxxAAA","xxx"] "xxx" == ["xxx","xxxAAA","xxx"] then pure () else error "assertion failed"
if candidate ["xxx","asd","aaaxxy","john doe","... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_80_is_happy | hs | -- | You are given a string s.
-- Your task is to check if the string is happy or not.
-- A string is happy if its length is at least 3 and every 3 consecutive letters are distinct
-- For example:
isHappy :: String -> Bool
isHappy s = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_80_is_happy.py | verbatim |
main :: IO ()
main = do
let candidate = isHappy
if candidate "a" == False then pure () else error "assertion failed"
if candidate "aa" == False then pure () else error "assertion failed"
if candidate "abcd" == True then pure () else error "assertion failed"
if candidate "aabb" == False then pure () else erro... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_81_numerical_letter_grade | hs | -- | It is the last week of the semester and the teacher has to give the grades
-- to students. The teacher has been making her own algorithm for grading.
-- The only problem is, she has lost the code she used for grading.
-- She has given you a list of GPAs for some students and you have to write
-- a function th... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_81_numerical_letter_grade.py | verbatim |
main :: IO ()
main = do
let candidate = numericalLetterGrade
if candidate [4.0,3,1.7,2,3.5] == ["A+","B","C-","C","A-"] then pure () else error "assertion failed"
if candidate [1.2] == ["D+"] then pure () else error "assertion failed"
if candidate [0.5] == ["D-"] then pure () else error "assertion failed"
if... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_82_prime_length | hs | -- | Write a function that takes a string and returns True if the string
-- length is a prime number or False otherwise
-- Examples
primeLength :: String -> Bool
primeLength string = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_82_prime_length.py | verbatim |
main :: IO ()
main = do
let candidate = primeLength
if candidate "Hello" == True then pure () else error "assertion failed"
if candidate "abcdcba" == True then pure () else error "assertion failed"
if candidate "kittens" == True then pure () else error "assertion failed"
if candidate "orange" == False then p... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_84_solve | hs | -- | Given a positive integer N, return the total sum of its digits in binary.
-- Example
-- Variables:
-- @N integer
-- Constraints: 0 ≤ N ≤ 10000.
-- Output:
-- a string of binary number
solve :: Int -> String
solve N = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_84_solve.py | verbatim |
main :: IO ()
main = do
let candidate = solve
if candidate 1000 == "1" then pure () else error "assertion failed"
if candidate 150 == "110" then pure () else error "assertion failed"
if candidate 147 == "1100" then pure () else error "assertion failed"
if candidate 333 == "1001" then pure () else error "asse... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_85_add | hs | -- | Given a non-empty list of integers lst. add the even elements that are at odd indices..
-- Examples:
add :: [Int] -> Int
add lst = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_85_add.py | verbatim |
main :: IO ()
main = do
let candidate = add
if candidate [4,88] == 88 then pure () else error "assertion failed"
if candidate [4,5,6,7,2,122] == 122 then pure () else error "assertion failed"
if candidate [4,0,6,7] == 0 then pure () else error "assertion failed"
if candidate [4,4,6,8] == 12 then pure () else... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_86_anti_shuffle | hs | -- | Write a function that takes a string and returns an ordered version of it.
-- Ordered version of string, is a string where all words (separated by space)
-- are replaced by a new word where all the characters arranged in
-- ascending order based on ascii value.
-- Note: You should keep the order of words and b... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_86_anti_shuffle.py | verbatim |
main :: IO ()
main = do
let candidate = antiShuffle
if candidate "Hi" == "Hi" then pure () else error "assertion failed"
if candidate "hello" == "ehllo" then pure () else error "assertion failed"
if candidate "number" == "bemnru" then pure () else error "assertion failed"
if candidate "abcd" == "abcd" then p... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_87_get_row | hs | -- | You are given a 2 dimensional data, as a nested lists,
-- which is similar to matrix, however, unlike matrices,
-- each row may contain a different number of columns.
-- Given lst, and integer x, find integers x in the list,
-- and return list of tuples, [(x1, y1), (x2, y2) ...] such that
-- each tuple is a c... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_87_get_row.py | verbatim |
main :: IO ()
main = do
let candidate = getRow
if candidate [[1,2,3,4,5,6],[1,2,3,4,1,6],[1,2,3,4,5,1]] 1 == [(0, 0),(1, 4),(1, 0),(2, 5),(2, 0)] then pure () else error "assertion failed"
if candidate [[1,2,3,4,5,6],[1,2,3,4,5,6],[1,2,3,4,5,6],[1,2,3,4,5,6],[1,2,3,4,5,6],[1,2,3,4,5,6]] 2 == [(0, 1),(1, 1),(2, 1... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_88_sort_array | hs | -- | Given an array of non-negative integers, return a copy of the given array after sorting,
-- you will sort the given array in ascending order if the sum( first index value, last index value) is odd,
-- or sort it in descending order if the sum( first index value, last index value) is even.
-- Note:
-- * don't c... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_88_sort_array.py | verbatim |
main :: IO ()
main = do
let candidate = sortArray
if candidate [] == [] then pure () else error "assertion failed"
if candidate [5] == [5] then pure () else error "assertion failed"
if candidate [2,4,3,0,1,5] == [0,1,2,3,4,5] then pure () else error "assertion failed"
if candidate [2,4,3,0,1,5,6] == [6,5,4,3... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_89_encrypt | hs | -- | Create a function encrypt that takes a string as an argument and
-- returns a string encrypted with the alphabet being rotated.
-- The alphabet should be rotated in a manner such that the letters
-- shift down by two multiplied to two places.
-- For example:
encrypt :: String -> String
encrypt s = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_89_encrypt.py | verbatim |
main :: IO ()
main = do
let candidate = encrypt
if candidate "hi" == "lm" then pure () else error "assertion failed"
if candidate "asdfghjkl" == "ewhjklnop" then pure () else error "assertion failed"
if candidate "gf" == "kj" then pure () else error "assertion failed"
if candidate "et" == "ix" then pure () e... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_8_sum_product | hs | -- | For a given list of integers, return a tuple consisting of a sum and a product of all the integers in a list.
-- Empty sum should be equal to 0 and empty product should be equal to 1.
sumProduct :: [Int] -> (Int, Int)
sumProduct numbers = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_8_sum_product.py | verbatim |
main :: IO ()
main = do
let candidate = sumProduct
if candidate [] == (0, 1) then pure () else error "assertion failed"
if candidate [1,1,1] == (3, 1) then pure () else error "assertion failed"
if candidate [100,0] == (100, 0) then pure () else error "assertion failed"
if candidate [3,5,7] == (15, 105) then ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_90_next_smallest | hs | -- | You are given a list of integers.
-- Write a function next_smallest() that returns the 2nd smallest element of the list.
-- Return None if there is no such element.
nextSmallest :: [Int] -> Maybe Int
nextSmallest lst = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_90_next_smallest.py | verbatim |
main :: IO ()
main = do
let candidate = nextSmallest
if candidate [1,2,3,4,5] == Just (2) then pure () else error "assertion failed"
if candidate [5,1,4,3,2] == Just (2) then pure () else error "assertion failed"
if candidate [] == Just (Nothing) then pure () else error "assertion failed"
if candidate [1,1] ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_91_is_bored | hs | -- | You'll be given a string of words, and your task is to count the number
-- of boredoms. A boredom is a sentence that starts with the word "I".
-- Sentences are delimited by '.', '?' or '!'.
-- For example:
isBored :: String -> Int
isBored S = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_91_is_bored.py | verbatim |
main :: IO ()
main = do
let candidate = isBored
if candidate "Hello world" == 0 then pure () else error "assertion failed"
if candidate "Is the sky blue?" == 0 then pure () else error "assertion failed"
if candidate "I love It !" == 1 then pure () else error "assertion failed"
if candidate "bIt" == 0 then pu... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_92_any_int | hs | -- | Create a function that takes 3 numbers.
-- Returns true if one of the numbers is equal to the sum of the other two, and all numbers are integers.
-- Returns false in any other cases.
-- Examples
anyInt :: Float -> Float -> Float -> Bool
anyInt x y z = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_92_any_int.py | verbatim |
main :: IO ()
main = do
let candidate = anyInt
if candidate 2.0 3.0 1.0 == True then pure () else error "assertion failed"
if candidate 2.5 2.0 3.0 == False then pure () else error "assertion failed"
if candidate 1.5 5.0 3.5 == False then pure () else error "assertion failed"
if candidate 2.0 6.0 2.0 == Fals... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_93_encode | hs | -- | Write a function that takes a message, and encodes in such a
-- way that it swaps case of all letters, replaces all vowels in
-- the message with the letter that appears 2 places ahead of that
-- vowel in the english alphabet.
-- Assume only letters.
-- Examples:
encode :: String -> String
encode message... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_93_encode.py | verbatim |
main :: IO ()
main = do
let candidate = encode
if candidate "TEST" == "tgst" then pure () else error "assertion failed"
if candidate "Mudasir" == "mWDCSKR" then pure () else error "assertion failed"
if candidate "YES" == "ygs" then pure () else error "assertion failed"
if candidate "This is a message" == "tH... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_94_skjkasdkd | hs | -- | You are given a list of integers.
-- You need to find the largest prime value and return the sum of its digits.
-- Examples:
skjkasdkd :: [Int] -> Int
skjkasdkd lst = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_94_skjkasdkd.py | verbatim |
main :: IO ()
main = do
let candidate = skjkasdkd
if candidate [0,3,2,1,3,5,7,4,5,5,5,2,181,32,4,32,3,2,32,324,4,3] == 10 then pure () else error "assertion failed"
if candidate [1,0,1,8,2,4597,2,1,3,40,1,2,1,2,4,2,5,1] == 25 then pure () else error "assertion failed"
if candidate [1,3,1,32,5107,34,83278,109,1... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_95_check_dict_case | hs | -- | Given a dictionary, return True if all keys are strings in lower
-- case or all keys are strings in upper case, else return False.
-- The function should return False is the given dictionary is empty.
-- Examples:
checkDictCase :: [(String, String)] -> Bool
checkDictCase dict = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_95_check_dict_case.py | verbatim |
main :: IO ()
main = do
let candidate = checkDictCase
if candidate [("p", "pineapple"), ("b", "banana")] == True then pure () else error "assertion failed"
if candidate [("p", "pineapple"), ("A", "banana"), ("B", "banana")] == False then pure () else error "assertion failed"
if candidate [("p", "pineapple"), (... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_96_count_up_to | hs | -- | Implement a function that takes an non-negative integer and returns an array of the first n
-- integers that are prime numbers and less than n.
-- for example:
countUpTo :: Int -> [Int]
countUpTo n = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_96_count_up_to.py | verbatim |
main :: IO ()
main = do
let candidate = countUpTo
if candidate 5 == [2,3] then pure () else error "assertion failed"
if candidate 6 == [2,3,5] then pure () else error "assertion failed"
if candidate 7 == [2,3,5] then pure () else error "assertion failed"
if candidate 10 == [2,3,5,7] then pure () else error "... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_97_multiply | hs | -- | Complete the function that takes two integers and returns
-- the product of their unit digits.
-- Assume the input is always valid.
-- Examples:
multiply :: Int -> Int -> Int
multiply a b = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_97_multiply.py | verbatim |
main :: IO ()
main = do
let candidate = multiply
if candidate 148 412 == 16 then pure () else error "assertion failed"
if candidate 19 28 == 72 then pure () else error "assertion failed"
if candidate 2020 1851 == 0 then pure () else error "assertion failed"
if candidate 14 (-15) == 20 then pure () else error... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_98_count_upper | hs | -- | Given a string s, count the number of uppercase vowels in even indices.
-- For example:
countUpper :: String -> Int
countUpper s = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_98_count_upper.py | verbatim |
main :: IO ()
main = do
let candidate = countUpper
if candidate "aBCdEf" == 1 then pure () else error "assertion failed"
if candidate "abcdefg" == 0 then pure () else error "assertion failed"
if candidate "dBBE" == 0 then pure () else error "assertion failed"
if candidate "B" == 0 then pure () else error "as... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_99_closest_integer | hs | -- | Create a function that takes a value (string) representing a number
-- and returns the closest integer to it. If the number is equidistant
-- from two integers, round it away from zero.
-- Examples
-- Note:
-- Rounding away from zero means that if the given number is equidistant
-- from two integers, the one... | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_99_closest_integer.py | verbatim |
main :: IO ()
main = do
let candidate = closestInteger
if candidate "10" == 10 then pure () else error "assertion failed"
if candidate "14.5" == 15 then pure () else error "assertion failed"
if candidate "-15.5" == (-16) then pure () else error "assertion failed"
if candidate "15.3" == 15 then pure () else e... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_9_rolling_max | hs | -- | From a given list of integers, generate a list of rolling maximum element found until given moment
-- in the sequence.
rollingMax :: [Int] -> [Int]
rollingMax numbers = | remove | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_9_rolling_max.py | verbatim |
main :: IO ()
main = do
let candidate = rollingMax
if candidate [] == [] then pure () else error "assertion failed"
if candidate [1,2,3,4] == [1,2,3,4] then pure () else error "assertion failed"
if candidate [4,3,2,1] == [4,4,4,4] then pure () else error "assertion failed"
if candidate [3,2,3,100,3] == [3,3,... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_0_has_close_elements | hs | -- | Check if in given list of numbers, are any two numbers closer to each other than
-- given threshold.
-- >>> hasCloseElements [1.0,2.0,3.0] 0.5
-- False
-- >>> hasCloseElements [1.0,2.8,3.0,4.0,5.0,2.0] 0.3
-- True
hasCloseElements :: [Float] -> Float -> Bool
hasCloseElements numbers threshold = | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_0_has_close_elements.py | reworded |
main :: IO ()
main = do
let candidate = hasCloseElements
if candidate [1.0,2.0,3.9,4.0,5.0,2.2] 0.3 == True then pure () else error "assertion failed"
if candidate [1.0,2.0,3.9,4.0,5.0,2.2] 0.05 == False then pure () else error "assertion failed"
if candidate [1.0,2.0,5.9,4.0,5.0] 0.95 == True then pure () els... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_100_make_a_pile | hs | -- | Given a positive integer n, you have to make a pile of n levels of stones.
-- The first level has n stones.
-- The number of stones in the next level is:
-- - the next odd number if n is odd.
-- - the next even number if n is even.
-- Return the number of stones in each level in a list, where element at index... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_100_make_a_pile.py | reworded |
main :: IO ()
main = do
let candidate = makeAPile
if candidate 3 == [3,5,7] then pure () else error "assertion failed"
if candidate 4 == [4,6,8,10] then pure () else error "assertion failed"
if candidate 5 == [5,7,9,11,13] then pure () else error "assertion failed"
if candidate 6 == [6,8,10,12,14,16] then pu... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_101_words_string | hs | -- | You will be given a string of words separated by commas or spaces. Your task is
-- to split the string into words and return a list of the words.
-- For example:
-- >>> wordsString "Hi, my name is John"
-- ["Hi","my","name","is","John"]
-- >>> wordsString "One, two, three, four, five, six"
-- ["One","two","t... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_101_words_string.py | reworded |
main :: IO ()
main = do
let candidate = wordsString
if candidate "Hi, my name is John" == ["Hi","my","name","is","John"] then pure () else error "assertion failed"
if candidate "One, two, three, four, five, six" == ["One","two","three","four","five","six"] then pure () else error "assertion failed"
if candidat... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_102_choose_num | hs | -- | This function takes two positive numbers x and y and returns the
-- biggest even integer number that is in the range [x, y] inclusive. If
-- there's no such number, then the function should return -1.
-- For example:
-- >>> chooseNum 12 15
-- 14
-- >>> chooseNum 13 12
-- (-1)
chooseNum :: Int -> Int -> Int... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_102_choose_num.py | reworded |
main :: IO ()
main = do
let candidate = chooseNum
if candidate 12 15 == 14 then pure () else error "assertion failed"
if candidate 13 12 == (-1) then pure () else error "assertion failed"
if candidate 33 12354 == 12354 then pure () else error "assertion failed"
if candidate 5234 5233 == (-1) then pure () els... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_104_unique_digits | hs | -- | Given a list of positive integers x. return a sorted list of all
-- elements that hasn't any even digit.
-- Note: Returned list should be sorted in increasing order.
-- For example:
-- >>> uniqueDigits [15,33,1422,1]
-- [1,15,33]
-- >>> uniqueDigits [152,323,1422,10]
-- []
uniqueDigits :: [Int] -> [Int]
un... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_104_unique_digits.py | reworded |
main :: IO ()
main = do
let candidate = uniqueDigits
if candidate [15,33,1422,1] == [1,15,33] then pure () else error "assertion failed"
if candidate [152,323,1422,10] == [] then pure () else error "assertion failed"
if candidate [12345,2033,111,151] == [111,151] then pure () else error "assertion failed"
if... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_105_by_length | hs | -- | Given a list of integers, sort the integers that are between 1 and 9 inclusive,
-- reverse the resulting list, and then replace each digit by its corresponding name from
-- "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine".
-- For example:
-- >>> byLength [2,1,1,4,5,8,2,3]
-- ["Eight","Fi... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_105_by_length.py | reworded |
main :: IO ()
main = do
let candidate = byLength
if candidate [2,1,1,4,5,8,2,3] == ["Eight","Five","Four","Three","Two","Two","One","One"] then pure () else error "assertion failed"
if candidate [] == [] then pure () else error "assertion failed"
if candidate [1,(-1),55] == ["One"] then pure () else error "ass... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_106_f | hs | -- | Implement the function f that takes n as a parameter,
-- and returns a list of size n, such that the value of the element at index i is the factorial of i if i is even
-- or the sum of numbers from 1 to i otherwise.
-- i starts from 1.
-- the factorial of i is the multiplication of the numbers from 1 to i (1 *... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_106_f.py | reworded |
main :: IO ()
main = do
let candidate = f
if candidate 5 == [1,2,6,24,15] then pure () else error "assertion failed"
if candidate 7 == [1,2,6,24,15,720,28] then pure () else error "assertion failed"
if candidate 1 == [1] then pure () else error "assertion failed"
if candidate 3 == [1,2,6] then pure () else e... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_107_even_odd_palindrome | hs | -- | Given a positive integer n, return a tuple that has the number of even and odd
-- integer palindromes that fall within the range(1, n), inclusive.
-- Example 1:
-- >>> evenOddPalindrome 3
-- (1, 2)
-- Explanation:
-- Integer palindrome are 1, 2, 3. one of them is even, and two of them are odd.
-- Example 2:... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_107_even_odd_palindrome.py | reworded |
main :: IO ()
main = do
let candidate = evenOddPalindrome
if candidate 123 == (8, 13) then pure () else error "assertion failed"
if candidate 12 == (4, 6) then pure () else error "assertion failed"
if candidate 3 == (1, 2) then pure () else error "assertion failed"
if candidate 63 == (6, 8) then pure () else... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_108_count_nums | hs | -- | Write a function count_nums which takes a list of integers and returns
-- the number of elements which has a sum of digits > 0.
-- If a number is negative, then its first signed digit will be negative:
-- e.g. -123 has signed digits -1, 2, and 3.
-- >>> countNums []
-- 0
-- >>> countNums [(-1),11,(-11)]
-- ... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_108_count_nums.py | reworded |
main :: IO ()
main = do
let candidate = countNums
if candidate [] == 0 then pure () else error "assertion failed"
if candidate [(-1),(-2),0] == 0 then pure () else error "assertion failed"
if candidate [1,1,2,(-2),3,4,5] == 6 then pure () else error "assertion failed"
if candidate [1,6,9,(-6),0,1,5] == 5 the... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_109_move_one_ball | hs | -- | We have a list 'arr' of N integers arr[1], arr[2], ..., arr[N].The
-- numbers in the list will be randomly ordered. Your task is to determine if
-- it is possible to get a list sorted in non-decreasing order by performing
-- the following operation on the given list:
-- You are allowed to perform right shift ... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_109_move_one_ball.py | reworded |
main :: IO ()
main = do
let candidate = moveOneBall
if candidate [3,4,5,1,2] == True then pure () else error "assertion failed"
if candidate [3,5,10,1,2] == True then pure () else error "assertion failed"
if candidate [4,3,1,2] == False then pure () else error "assertion failed"
if candidate [3,5,4,1,2] == F... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_10_make_palindrome | hs | -- | Find the shortest palindrome that begins with a supplied string.
-- Algorithm idea is simple:
-- - Find the longest postfix of supplied string that is a palindrome.
-- - Append to the end of the string reverse of a string prefix that comes before the palindromic suffix.
-- >>> makePalindrome ""
-- ""
-- >>> ... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_10_make_palindrome.py | reworded |
main :: IO ()
main = do
let candidate = makePalindrome
if candidate "" == "" then pure () else error "assertion failed"
if candidate "x" == "x" then pure () else error "assertion failed"
if candidate "xyz" == "xyzyx" then pure () else error "assertion failed"
if candidate "xyx" == "xyx" then pure () else err... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_110_exchange | hs | -- | In this problem, you will implement a function that takes two lists of numbers,
-- and determines whether it is possible to perform an exchange of elements
-- between them to make lst1 a list of only even numbers.
-- There is no limit on the number of exchanged elements between lst1 and lst2.
-- If it is possi... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_110_exchange.py | reworded |
main :: IO ()
main = do
let candidate = exchange
if candidate [1,2,3,4] [1,2,3,4] == "YES" then pure () else error "assertion failed"
if candidate [1,2,3,4] [1,5,3,4] == "NO" then pure () else error "assertion failed"
if candidate [1,2,3,4] [2,1,4,3] == "YES" then pure () else error "assertion failed"
if can... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_111_histogram | hs | -- | Given a string representing a space separated lowercase letters, return an association list
-- of the letter with the most repetition and containing the corresponding count.
-- If several letters have the same occurrence, return all of them.
-- Example:
-- >>> histogram "a b c"
-- [("a", 1), ("b", 1), ("c", 1... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_111_histogram.py | reworded |
main :: IO ()
main = do
let candidate = histogram
if candidate "a b b a" == [("a", 2), ("b", 2)] then pure () else error "assertion failed"
if candidate "a b c a b" == [("a", 2), ("b", 2)] then pure () else error "assertion failed"
if candidate "a b c d g" == [("a", 1), ("b", 1), ("c", 1), ("d", 1), ("g", 1)] ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_112_reverse_delete | hs | -- | Task
-- We are given two strings s and c, you have to deleted all the characters in s that are equal to any character in c
-- then check if the result string is palindrome.
-- A string is called palindrome if it reads the same backward as forward.
-- You should return a tuple containing the result string and T... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_112_reverse_delete.py | reworded |
main :: IO ()
main = do
let candidate = reverseDelete
if candidate "abcde" "ae" == ("bcd", False) then pure () else error "assertion failed"
if candidate "abcdef" "b" == ("acdef", False) then pure () else error "assertion failed"
if candidate "abcdedcba" "ab" == ("cdedc", True) then pure () else error "asserti... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_113_odd_count | hs | -- | Given a list of strings, where each string consists of only digits, return a list.
-- Each element i of the output should be "the number of odd elements in the
-- string i of the input." where all the i's should be replaced by the number
-- of odd digits in the i'th string of the input.
-- >>> oddCount ["12345... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_113_odd_count.py | reworded |
main :: IO ()
main = do
let candidate = oddCount
if candidate ["1234567"] == ["the number of odd elements 4n the str4ng 4 of the 4nput."] then pure () else error "assertion failed"
if candidate ["3","11111111"] == ["the number of odd elements 1n the str1ng 1 of the 1nput.","the number of odd elements 8n the str8... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_114_minSubArraySum | hs | -- | Given a list of integers nums, find the minimum sum of any non-empty sub-list
-- of nums.
-- Example
-- >>> minsubarraysum [2,3,4,1,2,4]
-- 1
-- >>> minsubarraysum [(-1),(-2),(-3)]
-- (-6)
minsubarraysum :: [Int] -> Int
minsubarraysum nums = | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_114_minSubArraySum.py | reworded |
main :: IO ()
main = do
let candidate = minsubarraysum
if candidate [2,3,4,1,2,4] == 1 then pure () else error "assertion failed"
if candidate [(-1),(-2),(-3)] == (-6) then pure () else error "assertion failed"
if candidate [(-1),(-2),(-3),2,(-10)] == (-14) then pure () else error "assertion failed"
if candi... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_115_max_fill | hs | -- | You are given a rectangular grid of wells. Each row represents a single well,
-- and each 1 in a row represents a single unit of water.
-- Each well has a corresponding bucket that can be used to extract water from it,
-- and all buckets have the same capacity.
-- Your task is to use the buckets to empty the ... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_115_max_fill.py | reworded |
main :: IO ()
main = do
let candidate = maxFill
if candidate [[0,0,1,0],[0,1,0,0],[1,1,1,1]] 1 == 6 then pure () else error "assertion failed"
if candidate [[0,0,1,1],[0,0,0,0],[1,1,1,1],[0,1,1,1]] 2 == 5 then pure () else error "assertion failed"
if candidate [[0,0,0],[0,0,0]] 5 == 0 then pure () else error "... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_116_sort_array | hs | -- | In this Kata, you have to sort a list of non-negative integers according to
-- number of ones in their binary representation in ascending order.
-- For similar number of ones, sort based on decimal value.
-- It must be implemented like this:
-- >>> sortArray [1,5,2,3,4]
-- [1,2,3,4,5]
-- >>> sortArray [(-2),... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_116_sort_array.py | reworded |
main :: IO ()
main = do
let candidate = sortArray
if candidate [1,5,2,3,4] == [1,2,4,3,5] then pure () else error "assertion failed"
if candidate [(-2),(-3),(-4),(-5),(-6)] == [(-4),(-2),(-6),(-5),(-3)] then pure () else error "assertion failed"
if candidate [1,0,2,3,4] == [0,1,2,4,3] then pure () else error "... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_117_select_words | hs | -- | Given a string s and a natural number n, you have been tasked to implement
-- a function that returns a list of all words from string s that contain exactly
-- n consonants, in order these words appear in the string s.
-- If the string s is empty then the function should return an empty list.
-- Note: you ma... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_117_select_words.py | reworded |
main :: IO ()
main = do
let candidate = selectWords
if candidate "Mary had a little lamb" 4 == ["little"] then pure () else error "assertion failed"
if candidate "Mary had a little lamb" 3 == ["Mary","lamb"] then pure () else error "assertion failed"
if candidate "simple white space" 2 == [] then pure () else ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_118_get_closest_vowel | hs | -- | You are given a word. Your task is to find the closest vowel that stands between
-- two consonants from the right side of the word (case sensitive).
-- Vowels in the beginning and ending doesn't count. Return empty string if you didn't
-- find any vowel met the above condition.
-- You may assume that the giv... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_118_get_closest_vowel.py | reworded |
main :: IO ()
main = do
let candidate = getClosestVowel
if candidate "yogurt" == "u" then pure () else error "assertion failed"
if candidate "full" == "u" then pure () else error "assertion failed"
if candidate "easy" == "" then pure () else error "assertion failed"
if candidate "eAsy" == "" then pure () els... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_119_match_parens | hs | -- | You are given a list of two strings, both strings consist of open
-- parentheses '(' or close parentheses ')' only.
-- Your job is to check if it is possible to concatenate the two strings in
-- some order, that the resulting string will be good.
-- A string S is considered to be good if and only if all parent... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_119_match_parens.py | reworded |
main :: IO ()
main = do
let candidate = matchParens
if candidate ["()(",")"] == "Yes" then pure () else error "assertion failed"
if candidate [")",")"] == "No" then pure () else error "assertion failed"
if candidate ["(()(())","())())"] == "No" then pure () else error "assertion failed"
if candidate [")())",... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_11_string_xor | hs | -- | Input are two strings a and b consisting only of 1s and 0s.
-- Perform binary XOR on these inputs and return result also as a string.
-- >>> stringXor "010" "110"
-- "100"
stringXor :: String -> String -> String
stringXor a b = | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_11_string_xor.py | reworded |
main :: IO ()
main = do
let candidate = stringXor
if candidate "111000" "101010" == "010010" then pure () else error "assertion failed"
if candidate "1" "1" == "0" then pure () else error "assertion failed"
if candidate "0101" "0000" == "0101" then pure () else error "assertion failed"
pure () | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_120_maximum | hs | -- | Given a list arr of integers and a positive integer k, return a sorted list
-- of length k with the maximum k numbers in arr.
-- Example 1:
-- >>> maximum [(-3),(-4),5] 3
-- [(-4),(-3),5]
-- Example 2:
-- >>> maximum [4,(-4),4] 2
-- [4,4]
-- Example 3:
-- >>> maximum [(-3),2,1,2,(-1),(-2),1] 1
-- [2]
--... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_120_maximum.py | reworded |
main :: IO ()
main = do
let candidate = maximum
if candidate [(-3),(-4),5] 3 == [(-4),(-3),5] then pure () else error "assertion failed"
if candidate [4,(-4),4] 2 == [4,4] then pure () else error "assertion failed"
if candidate [(-3),2,1,2,(-1),(-2),1] 1 == [2] then pure () else error "assertion failed"
if c... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_121_solution | hs | -- | Given a non-empty list of integers, return the sum of all of the odd elements that are in even positions.
-- Examples
-- >>> solution [5,8,7,1]
-- 12
-- >>> solution [3,3,3,3,3]
-- 9
-- >>> solution [30,13,24,321]
-- 0
solution :: [Int] -> Int
solution lst = | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_121_solution.py | reworded |
main :: IO ()
main = do
let candidate = solution
if candidate [5,8,7,1] == 12 then pure () else error "assertion failed"
if candidate [3,3,3,3,3] == 9 then pure () else error "assertion failed"
if candidate [30,13,24,321] == 0 then pure () else error "assertion failed"
if candidate [5,9] == 5 then pure () el... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_122_add_elements | hs | -- | Given a non-empty list of integers arr and an integer k, return
-- the sum of the elements with at most two digits from the first k elements of arr.
-- Example:
-- >>> addElements [111,21,3,4000,5,6,7,8,9] 4
-- 24
-- Constraints:
-- 1. 1 <= len(arr) <= 100
-- 2. 1 <= k <= len(arr)
addElements :: [Int] -> In... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_122_add_elements.py | reworded |
main :: IO ()
main = do
let candidate = addElements
if candidate [1,(-2),(-3),41,57,76,87,88,99] 3 == (-4) then pure () else error "assertion failed"
if candidate [111,121,3,4000,5,6] 2 == 0 then pure () else error "assertion failed"
if candidate [11,21,3,90,5,6,7,8,9] 4 == 125 then pure () else error "asserti... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_123_get_odd_collatz | hs | -- | Given a positive integer n, return a sorted list that has the odd numbers in collatz sequence.
-- The Collatz conjecture is a conjecture in mathematics that concerns a sequence defined
-- as follows: start with any positive integer n. Then each term is obtained from the
-- previous term as follows: if the prev... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_123_get_odd_collatz.py | reworded |
main :: IO ()
main = do
let candidate = getOddCollatz
if candidate 14 == [1,5,7,11,13,17] then pure () else error "assertion failed"
if candidate 5 == [1,5] then pure () else error "assertion failed"
if candidate 12 == [1,3,5] then pure () else error "assertion failed"
if candidate 1 == [1] then pure () else... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_124_valid_date | hs | -- | You have to write a function which validates a given date string and
-- returns True if the date is valid otherwise False.
-- The date is valid if all of the following rules are satisfied:
-- 1. The date string is not empty.
-- 2. The number of days is not less than 1 or higher than 31 days for months 1,3,5,7,... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_124_valid_date.py | reworded |
main :: IO ()
main = do
let candidate = validDate
if candidate "03-11-2000" == True then pure () else error "assertion failed"
if candidate "15-01-2012" == False then pure () else error "assertion failed"
if candidate "04-0-2040" == False then pure () else error "assertion failed"
if candidate "06-04-2020" =... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_126_is_sorted | hs | -- | Given a list of numbers, return whether or not they are sorted
-- in ascending order. If list has more than 1 duplicate of the same
-- number, return False. Assume no negative numbers and only integers.
-- Examples
-- >>> isSorted [5]
-- True
-- >>> isSorted [1,2,3,4,5]
-- True
-- >>> isSorted [1,3,2,4,5]
... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_126_is_sorted.py | reworded |
main :: IO ()
main = do
let candidate = isSorted
if candidate [5] == True then pure () else error "assertion failed"
if candidate [1,2,3,4,5] == True then pure () else error "assertion failed"
if candidate [1,3,2,4,5] == False then pure () else error "assertion failed"
if candidate [1,2,3,4,5,6] == True then... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_127_intersection | hs | -- | You are given two intervals,
-- where each interval is a pair of integers. For example, interval = (start, end) = (1, 2).
-- The given intervals are closed which means that the interval (start, end)
-- includes both start and end.
-- For each given interval, it is assumed that its start is less or equal its en... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_127_intersection.py | reworded |
main :: IO ()
main = do
let candidate = intersection
if candidate (1, 2) (2, 3) == "NO" then pure () else error "assertion failed"
if candidate ((-1), 1) (0, 4) == "NO" then pure () else error "assertion failed"
if candidate ((-3), (-1)) ((-5), 5) == "YES" then pure () else error "assertion failed"
if candid... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_128_prod_signs | hs | -- | You are given a list arr of integers and you need to return
-- sum of magnitudes of integers multiplied by product of all signs
-- of each number in the list, represented by 1, -1 or 0.
-- Note: return Nothing for empty arr.
-- Example:
-- >>> prodSigns [1,2,2,(-4)]
-- Just (9)
-- >>> prodSigns [0,1]
-- Ju... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_128_prod_signs.py | reworded |
main :: IO ()
main = do
let candidate = prodSigns
if candidate [1,2,2,(-4)] == Just ((-9)) then pure () else error "assertion failed"
if candidate [0,1] == Just (0) then pure () else error "assertion failed"
if candidate [1,1,1,2,3,(-1),1] == Just ((-10)) then pure () else error "assertion failed"
if candida... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_129_minPath | hs | -- | Given a grid with N rows and N columns (N >= 2) and a positive integer k,
-- each cell of the grid contains a value. Every integer in the range [1, N * N]
-- inclusive appears exactly once on the cells of the grid.
-- You have to find the minimum path of length k in the grid. You can start
-- from any cell, a... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_129_minPath.py | reworded |
main :: IO ()
main = do
let candidate = minpath
if candidate [[1,2,3],[4,5,6],[7,8,9]] 3 == [1,2,1] then pure () else error "assertion failed"
if candidate [[5,9,3],[4,1,6],[7,8,2]] 1 == [1] then pure () else error "assertion failed"
if candidate [[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]] 4 == [1,2,1,2] ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_12_longest | hs | -- | Out of list of strings, return the longest one. Return the first one in case of multiple
-- strings of the same length. Return Nothing in case the input list is empty.
-- >>> longest []
-- Just (Nothing)
-- >>> longest ["a","b","c"]
-- Just ("a")
-- >>> longest ["a","bb","ccc"]
-- Just ("ccc")
longest :: [S... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_12_longest.py | reworded |
main :: IO ()
main = do
let candidate = longest
if candidate [] == Just (Nothing) then pure () else error "assertion failed"
if candidate ["x","y","z"] == Just ("x") then pure () else error "assertion failed"
if candidate ["x","yyy","zzzz","www","kkkk","abc"] == Just ("zzzz") then pure () else error "assertion... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_130_tri | hs | -- | Everyone knows Fibonacci sequence, it was studied deeply by mathematicians in
-- the last couple centuries. However, what people don't know is Tribonacci sequence.
-- Tribonacci sequence is defined by the recurrence:
-- tri(1) = 3
-- tri(n) = 1 + n / 2, if n is even.
-- tri(n) = tri(n - 1) + tri(n - 2) + tr... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_130_tri.py | reworded |
main :: IO ()
main = do
let candidate = tri
if candidate 3 == [1,3,2,8] then pure () else error "assertion failed"
if candidate 4 == [1,3,2,8,3] then pure () else error "assertion failed"
if candidate 5 == [1,3,2,8,3,15] then pure () else error "assertion failed"
if candidate 6 == [1,3,2,8,3,15,4] then pure ... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_131_digits | hs | -- | Given a positive integer n, return the product of the odd digits.
-- Return 0 if all digits are even.
-- For example:
-- >>> digits 1
-- 1
-- >>> digits 4
-- 0
-- >>> digits 235
-- 15
digits :: Int -> Int
digits n = | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_131_digits.py | reworded |
main :: IO ()
main = do
let candidate = digits
if candidate 5 == 5 then pure () else error "assertion failed"
if candidate 54 == 5 then pure () else error "assertion failed"
if candidate 120 == 1 then pure () else error "assertion failed"
if candidate 5014 == 5 then pure () else error "assertion failed"
if... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_132_is_nested | hs | -- | Create a function that takes a string as input which contains only square brackets.
-- The function should return True if and only if there is a valid subsequence of brackets
-- where at least one bracket in the subsequence is nested.
-- >>> isNested "[[]]"
-- True
-- >>> isNested "[]]]]]]][[[[[]"
-- False
... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_132_is_nested.py | reworded |
main :: IO ()
main = do
let candidate = isNested
if candidate "[[]]" == True then pure () else error "assertion failed"
if candidate "[]]]]]]][[[[[]" == False then pure () else error "assertion failed"
if candidate "[][]" == False then pure () else error "assertion failed"
if candidate "[]" == False then pur... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_133_sum_squares | hs | -- | You are given a list of numbers.
-- You need to return the sum of squared numbers in the given list,
-- round each element in the list to the upper int(Ceiling) first.
-- Examples:
-- >>> lst [1.0,2.0,3.0]
-- 14
-- >>> lst [1.0,4.0,9.0]
-- 98
-- >>> lst [1.0,3.0,5.0,7.0]
-- 84
-- >>> lst [1.4,4.2,0.0]
--... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_133_sum_squares.py | reworded |
main :: IO ()
main = do
let candidate = sumSquares
if candidate [1.0,2.0,3.0] == 14 then pure () else error "assertion failed"
if candidate [1.0,2.0,3.0] == 14 then pure () else error "assertion failed"
if candidate [1.0,3.0,5.0,7.0] == 84 then pure () else error "assertion failed"
if candidate [1.4,4.2,0.0]... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_134_check_if_last_char_is_a_letter | hs | -- | Create a function that returns True if the last character
-- of a given string is an alphabetical character and is not
-- a part of a word, and False otherwise.
-- Note: "word" is a group of characters separated by space.
-- Examples:
-- >>> checkIfLastCharIsALetter "apple pie"
-- False
-- >>> checkIfLastCh... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_134_check_if_last_char_is_a_letter.py | reworded |
main :: IO ()
main = do
let candidate = checkIfLastCharIsALetter
if candidate "apple" == False then pure () else error "assertion failed"
if candidate "apple pi e" == True then pure () else error "assertion failed"
if candidate "eeeee" == False then pure () else error "assertion failed"
if candidate "A" == T... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_135_can_arrange | hs | -- | Create a function which returns the largest index of an element which
-- is not greater than or equal to the element immediately preceding it. If
-- no such element exists then return -1. The given list will not contain
-- duplicate values.
-- Examples:
-- >>> canArrange [1,2,4,3,5]
-- 3
-- >>> canArrange [... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_135_can_arrange.py | reworded |
main :: IO ()
main = do
let candidate = canArrange
if candidate [1,2,4,3,5] == 3 then pure () else error "assertion failed"
if candidate [1,2,4,5] == (-1) then pure () else error "assertion failed"
if candidate [1,4,2,5,6,7,8,9,10] == 2 then pure () else error "assertion failed"
if candidate [4,8,5,7,3] == 4... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_136_largest_smallest_integers | hs | -- | Create a function that returns a tuple (a, b), where 'a' is
-- the largest of negative integers, and 'b' is the smallest
-- of positive integers in a list.
-- If there is no negative or positive integers, return them as Nothing.
-- Examples:
-- >>> largestSmallestIntegers [2,4,1,3,5,7]
-- (Nothing, 1)
-- >>... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_136_largest_smallest_integers.py | reworded |
main :: IO ()
main = do
let candidate = largestSmallestIntegers
if candidate [2,4,1,3,5,7] == (Nothing, 1) then pure () else error "assertion failed"
if candidate [2,4,1,3,5,7,0] == (Nothing, 1) then pure () else error "assertion failed"
if candidate [1,3,2,4,5,6,(-2)] == ((-2), 1) then pure () else error "ass... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_138_is_equal_to_sum_even | hs | -- | Evaluate whether the given number n can be written as the sum of exactly 4 positive even numbers
-- Example
-- >>> isEqualToSumEven 4
-- False
-- >>> isEqualToSumEven 6
-- False
-- >>> isEqualToSumEven 8
-- True
isEqualToSumEven :: Int -> Bool
isEqualToSumEven n = | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_138_is_equal_to_sum_even.py | reworded |
main :: IO ()
main = do
let candidate = isEqualToSumEven
if candidate 4 == False then pure () else error "assertion failed"
if candidate 6 == False then pure () else error "assertion failed"
if candidate 8 == True then pure () else error "assertion failed"
if candidate 10 == True then pure () else error "ass... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_139_special_factorial | hs | -- | The Brazilian factorial is defined as:
-- brazilian_factorial(n) = n! * (n-1)! * (n-2)! * ... * 1!
-- where n > 0
-- For example:
-- >>> specialFactorial 4
-- 288
-- The function will receive an integer as input and should return the special
-- factorial of this integer.
specialFactorial :: Int -> Int
speci... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_139_special_factorial.py | reworded |
main :: IO ()
main = do
let candidate = specialFactorial
if candidate 4 == 288 then pure () else error "assertion failed"
if candidate 5 == 34560 then pure () else error "assertion failed"
if candidate 7 == 125411328000 then pure () else error "assertion failed"
if candidate 1 == 1 then pure () else error "a... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_13_greatest_common_divisor | hs | -- | Return a greatest common divisor of two integers a and b
-- >>> greatestCommonDivisor 3 5
-- 1
-- >>> greatestCommonDivisor 25 15
-- 5
greatestCommonDivisor :: Int -> Int -> Int
greatestCommonDivisor a b = | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_13_greatest_common_divisor.py | reworded |
main :: IO ()
main = do
let candidate = greatestCommonDivisor
if candidate 3 7 == 1 then pure () else error "assertion failed"
if candidate 10 15 == 5 then pure () else error "assertion failed"
if candidate 49 14 == 7 then pure () else error "assertion failed"
if candidate 144 60 == 12 then pure () else erro... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_140_fix_spaces | hs | -- | Given a string text, replace all spaces in it with underscores,
-- and if a string has more than 2 consecutive spaces,
-- then replace all consecutive spaces with -
-- >>> fixSpaces " Example"
-- "Example"
-- >>> fixSpaces " Example 1"
-- "Example_1"
-- >>> fixSpaces " Example 2"
-- "_Example_2"
-- >>>... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_140_fix_spaces.py | reworded |
main :: IO ()
main = do
let candidate = fixSpaces
if candidate "Example" == "Example" then pure () else error "assertion failed"
if candidate "Mudasir Hanif " == "Mudasir_Hanif_" then pure () else error "assertion failed"
if candidate "Yellow Yellow Dirty Fellow" == "Yellow_Yellow__Dirty__Fellow" then pure (... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_141_file_name_check | hs | -- | Create a function which takes a string representing a file's name, and returns
-- 'Yes' if the the file's name is valid, and returns 'No' otherwise.
-- A file's name is considered to be valid if and only if all the following conditions
-- are met:
-- - There should not be more than three digits ('0'-'9') in t... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_141_file_name_check.py | reworded |
main :: IO ()
main = do
let candidate = fileNameCheck
if candidate "example.txt" == "Yes" then pure () else error "assertion failed"
if candidate "1example.dll" == "No" then pure () else error "assertion failed"
if candidate "s1sdf3.asd" == "No" then pure () else error "assertion failed"
if candidate "K.dll"... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_142_sum_squares | hs | -- | "
-- This function will take a list of integers. For all entries in the list, the function shall square the integer entry if its index is a
-- multiple of 3 and will cube the integer entry if its index is a multiple of 4 and not a multiple of 3. The function will not
-- change the entries in the list whose in... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_142_sum_squares.py | reworded |
main :: IO ()
main = do
let candidate = sumSquares
if candidate [1,2,3] == 6 then pure () else error "assertion failed"
if candidate [1,4,9] == 14 then pure () else error "assertion failed"
if candidate [] == 0 then pure () else error "assertion failed"
if candidate [1,1,1,1,1,1,1,1,1] == 9 then pure () else... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
HumanEval_143_words_in_sentence | hs | -- | You are given a string representing a sentence,
-- the sentence contains some words separated by a space,
-- and you have to return a string that contains the words from the original sentence,
-- whose lengths are prime numbers,
-- the order of the words in the new string should be the same as the original one... | transform | C:\Users\Thomas\PycharmProjects\MultiPL-E\datasets\..\datasets\originals-with-cleaned-doctests\HumanEval_143_words_in_sentence.py | reworded |
main :: IO ()
main = do
let candidate = wordsInSentence
if candidate "This is a test" == "is" then pure () else error "assertion failed"
if candidate "lets go for swimming" == "go for" then pure () else error "assertion failed"
if candidate "there is no place available here" == "there is no place" then pure ()... | [
"\n\n",
"\n{-",
"\n-- |",
"\n--",
"\ntype",
"\ndata",
"\nnewtype"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.