Sign in to follow this  
Followers 0
boba22

Haskell programs - beginer need help

6 posts in this topic

Can someone write me the program for this: insert' 111 2 1 [[2..4],[3..5],[7..9]] = [[2, 3, 4],[3, 4, 111],[7, 8, 9]]

And a program for rotating the list for i places. Positive i rotates left for i places and negative rotates right for i places. Don't use Data.Bits

And also this: And also a function that is inserting an element on a i position in list , counting from 0, so that it replaces the existing element in the position i. If i is negative then the counting starts from the end of the list. The result must look like this:

insert2' "fine" 2 ["I","am","great"] = ["I","am","fine"] insert2i 3 (-7) [1..4] = [1,3,3,4]

 

Share this post


Link to post
Share on other sites



Welcome..

 

Can someone write me the program for

 

As this is a support forum, Your sentence is starting with the wrong words.

The intent is you code the script yourself and ask for help. ;)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i tried to do the codes a hunderd times but they dont work:

for the third one i have this:

insert2' :: a -> Int -> [a] -> [a]
insert2' x n [] = []
insert2' x n xs = f ++ [x] ++ drop (length xs - n) xs
 where f = (take (length xs - n) xs)

and for the first one i have this:

insert' xs ys = [[x y | x <- xs] | y <- ys]

Edited by boba22

Share this post


Link to post
Share on other sites

Maybe it would be a good idea for you to start looking at the helpfile and get yourself familiarized with the AutoIt3 syntax, since what you posted doesn't make much sense.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Maybe it would be a good idea for you to start looking at the helpfile and get yourself familiarized with the AutoIt3 syntax, since what you posted doesn't make much sense.

 

Because he's after Haskell.

Share this post


Link to post
Share on other sites

Because he's after Haskell.

understood and can only assume the OP wants to convert it to AutoIt3 syntax since he posted here. So a good start would be to understand the basics before asking questions. ;)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0