Idris2/tests/node/tailrec001/tailrec.idr

23 lines
453 B
Idris
Raw Normal View History

2020-07-05 13:53:45 +03:00
module Main
2020-07-12 12:13:45 +03:00
import Data.Vect
2020-10-05 16:39:38 +03:00
import Data.Stream
foo : List Char
foo = unpack $ pack $ take 4000 (repeat 'a')
2020-07-12 12:13:45 +03:00
2020-07-05 13:53:45 +03:00
factorialAux : Integer -> Integer -> Integer
factorialAux 0 a = a
factorialAux n a = factorialAux (n-1) (a*n)
factorial : Integer -> Integer
factorial n = factorialAux n 1
main : IO ()
main =
do
2020-07-12 12:13:45 +03:00
printLn $ factorial 100
2020-07-05 13:53:45 +03:00
printLn $ factorial 10000
printLn $ the (Vect 3 String) ["red", "green", "blue"]
2020-10-05 16:39:38 +03:00
printLn foo