Sep 16, 2010

More about list

Dot Dot notation
You can get a sequence of integer numbers like;
[1..10] it will give the result as [1,2,3,4,5,6,7,8,9,10]
And also if you type it as
[1,3..10] it will be like
And also on the other way around too.

Never ending list
This is like a never ending loop;

loop n=n: loop(n+1)
runLoop = loop 1

If the user type;
The haskell will give a never ending loop.

Head and tali
If you type;
let list = [1,2,3,4,5,6]
head list
it will give the output as
tail list
it will give the output as

This will devide a list to two parts like (x:sx)

No comments:

Post a Comment

Your comments are always welcome ...