mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-25 04:33:45 +03:00
31 lines
631 B
Idris
31 lines
631 B
Idris
{-
|
|
|
|
Test that some library functions don't cause "Maximum call stack size exceeded"
|
|
errors.
|
|
|
|
So far, only Prelude.List.++ is tested.
|
|
|
|
-}
|
|
|
|
module Main
|
|
|
|
import Data.List
|
|
import Data.SnocList
|
|
|
|
values : List Nat
|
|
values = replicate 50000 1
|
|
|
|
seulav : SnocList Nat
|
|
seulav = Lin <>< values
|
|
|
|
main : IO ()
|
|
main = do
|
|
printLn $ length $ values ++ [1]
|
|
printLn $ length $ map Just values
|
|
printLn $ length $ mapMaybe Just values
|
|
printLn $ length $ filter (const True) values
|
|
printLn $ length $ seulav ++ [<1]
|
|
printLn $ length $ map Just seulav
|
|
printLn $ length $ mapMaybe Just seulav
|
|
printLn $ length $ filter (const True) seulav
|