Very cool post!
I think the problem with repl.it is, that you have to have a "main :: IO ()" function that is being executed when running. You could do a short demonstration of your defined functions like this:
-- create list of x-steps n-times-- e.g. 2 3 => [2,4,6]countByxn=[x|x<-[x,2*x..n*x]]-- create sum of all positive input numbers-- e.g. [1, 2, -3] => 1 + 2 => 3positiveSumxs=sum[x|x<-xs,x>0]main::IO()main=doputStrLn"countBy: Create list of x-steps n-times"putStrLn"e.g. 2 3 => [2,4,6]"print(countBy23)putStrLn"positiveSum: Create sum of all positive input numbers"putStrLn"e.g. [1, 2, -3] => 1 + 2 => 3"print(positiveSum[1,2,-3])
Very cool post!
I think the problem with repl.it is, that you have to have a "main :: IO ()" function that is being executed when running. You could do a short demonstration of your defined functions like this:
Thanks,
I will have a look at it!
I currently use
:l main
all the time.