Find Jobs
Hire Freelancers

Build some functions

$10-30 AUD

Completed
Posted about 5 years ago

$10-30 AUD

Paid on delivery
It is a simple project which needs to build functions using Haskell.
Project ID: 18951984

About the project

1 proposal
Remote project
Active 5 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
This project is really easy. I've already done it. Here are the first two functions, and the output of main: subst :: Eq t => t -> t -> [t] -> [t] subst pat rep l = go l [] where go [] acc = acc go (x:xs) acc = v : go xs acc where v = if x == pat then rep else x interleave :: [t] -> [t] -> [t] interleave a b = go a b [] False where go [] l2 acc _ = acc ++ l2 go l1 [] acc _ = acc ++ l1 go (x:xs) (y:ys) acc False = x : go xs (y:ys) acc True go (x:xs) (y:ys) acc True = y : go (x:xs) ys acc False main = do print $ subst 0 1 [0,1,2,3] print $ subst 'e' 'o' "dog" print $ subst 'e' 'o' "elephant" print $ interleave [1,2,3,4] [11,12,13,14] print $ interleave "" "dog" print $ interleave "wl" "arus" print $ interleave "tlpone" "eeh" print $ unroll 3 [1,2,3,4,5] print $ unroll 8 [1,2,3] print $ unroll 4 "ski" ------------------------------------------ [1,1,2,3] "dog" "olophant" [1,11,2,12,3,13,4,14] "dog" "walrus" "telephone" [1,2,3] [1,2,3,1,2,3,1,2] "skis"
$15 AUD in 1 day
5.0 (9 reviews)
3.2
3.2

About the client

Flag of AUSTRALIA
Melbourne, Australia
5.0
4
Payment method verified
Member since Aug 25, 2018

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.