I am new in Haskell, could guys help me how to generating list from 1 to 10.
I tried to make like this:
seqList :: Integer -> [Integer]
seqList 1 = [1]
seqList n = n : seqList(n-1)
The result 10 to 1, not 1 to 10
And second question can we make function as value.
numList :: [Integer]
numList = [1,2..10]
totJum :: Int
totJum = length numList
takeNum :: Int->[Integer]
takeNum totJum
| totJum >= 10 = take 5 numList
| totJum == 10 = numList
With this code, i want to call output if the length from numlist matches the condition.