Find Jobs
Hire Freelancers

Haskell functions simple

€30-250 EUR

Slutfört
Publicerad över fyra år sedan

€30-250 EUR

Betalning vid leverans
[login to view URL] a function count_odds that produces the number of odds in a list of numbers. For example, count_odds [1,2,3,4,7,8] should return 3. 2. Write a function remove_last_two that removes the last two elements in a list. If the list contains two or less elements, then it should return the list unchanged. For example, remove_last [1,2,3,4,5,6] should return [1,2,3,4]. 3. Using library functions, define a function halve :: [a ] → ([a ], [a ]) that splits an even-length list into two halves. For example, halve [1, 2, 3, 4, 5, 6] should return ([1, 2, 3], [4, 5, 6]). 4. Write a function min_max that takes a list of numbers and returns the minimum, as well as the maximum element in the list as a pair. For example, min_max [4,3,6,5,9,10,8] should return (3,10) as the answer. 5. Redefine the function mult x y z = x * y * z using lambda expressions. 6. Write a function primes_before that takes a natural number n and returns in a list the prime numbers that are smaller than n. For example, primes_before 10 should return [2,3,5,7]. 7. Write a function sum_average_count that takes a list of numbers and returns as a triple the sum, average and count of the numbers. For example, sum_average_count [2,4,12] should return (18,6,3). 8. Write a function to_list that takes a tuple of three components and returns the list of those components. For example, to_list (3,4,5) should return [3,4,5].
Project ID: 21814116

Om projektet

1 anbud
Distansprojekt
Senaste aktivitet fem år sedan

Ute efter att tjäna lite pengar?

Fördelar med att lägga anbud hos Freelancer

Ange budget och tidsram
Få betalt för ditt arbete
Beskriv ditt förslag
Det är gratis att registrera sig och att lägga anbud på uppdrag
Tilldelad till:
Använd avatar
.................................................................................................................................................................................................................................
€40 EUR Om 3 dagar
5,0 (4 omdömen)
3,1
3,1

Om kunden

Flagga för UNITED KINGDOM
Preston, United Kingdom
0,0
0
Verifierad betalningsmetod
Medlem sedan okt. 16, 2019

Kundverifikation

Tack! Vi har skickat en länk för aktivering av gratis kredit.
Något gick fel med ditt e-postmeddelande. Vänligen försök igen.
Registrerade Användare Totalt antal jobb publicerade
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Laddar förhandsgranskning
Tillstånd beviljat för geolokalisering.
Din inloggningssession har löpt ut och du har blivit utloggad. Logga in igen.