{"action":"created","issue":{"url":"https://api.github.com/repos/fable-compiler/Fable/issues/459","repository_url":"https://api.github.com/repos/fable-compiler/Fable","labels_url":"https://api.github.com/repos/fable-compiler/Fable/issues/459/labels{/name}","comments_url":"https://api.github.com/repos/fable-compiler/Fable/issues/459/comments","events_url":"https://api.github.com/repos/fable-compiler/Fable/issues/459/events","html_url":"https://github.com/fable-compiler/Fable/issues/459","id":181385575,"number":459,"title":"Seq.filter on big array fails with maximum call stack size error","user":{"login":"whitetigle","id":883207,"avatar_url":"https://avatars.githubusercontent.com/u/883207?v=3","gravatar_id":"","url":"https://api.github.com/users/whitetigle","html_url":"https://github.com/whitetigle","followers_url":"https://api.github.com/users/whitetigle/followers","following_url":"https://api.github.com/users/whitetigle/following{/other_user}","gists_url":"https://api.github.com/users/whitetigle/gists{/gist_id}","starred_url":"https://api.github.com/users/whitetigle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitetigle/subscriptions","organizations_url":"https://api.github.com/users/whitetigle/orgs","repos_url":"https://api.github.com/users/whitetigle/repos","events_url":"https://api.github.com/users/whitetigle/events{/privacy}","received_events_url":"https://api.github.com/users/whitetigle/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-06T11:03:02Z","updated_at":"2016-10-07T13:04:42Z","closed_at":"2016-10-07T10:37:48Z","body":"### Description\r\n\r\nEncountered problem: on big arrays, Seq.filter may never stops if condition is never met and wll reach maximum call stack threshold.\r\n\r\nOn my PC, maximum call stack size allowed is for an array with 31327 ints.\r\n\r\n### Repro steps\r\n\r\n\r\n```f#\r\nlet testA =\r\n  let max = 1000000\r\n  let a = [| for i in 1 .. max -> 100 |> int  |]\r\n  console.log(a.Length)\r\n  let b = a |> Seq.filter( fun x -> x > 10) |> Seq.toArray\r\n  console.log(b.Length)\r\n  \r\nlet testB =\r\n  let max = 1000000\r\n  let a = [| for i in 1 .. max -> (Math.random() * 100.) |> int  |]\r\n  console.log(a.Length)\r\n  let b = a |> Seq.filter( fun x -> x > 10) |> Seq.toArray\r\n  console.log(b.Length)\r\n\r\nlet testC =\r\n  let max = 1000000\r\n  let a = [| for i in 1 .. max -> 0  |] // init with 0\r\n  console.log(a.Length)\r\n  let b = a |> Seq.filter( fun x -> x > 10) |> Seq.toArray\r\n  console.log(b.Length)\r\n\r\ntestA // will never fail, condition will be met\r\ntestB // may fail if condition is never met\r\ntestC // fails with a maximum call stack size error since there aren't any value superior to 10\r\n\r\n```\r\n* Fable Version 0.6.5\r\n* Operating system windows 10 / chrome browser\r\n"},"comment":{"url":"https://api.github.com/repos/fable-compiler/Fable/issues/comments/252246660","html_url":"https://github.com/fable-compiler/Fable/issues/459#issuecomment-252246660","issue_url":"https://api.github.com/repos/fable-compiler/Fable/issues/459","id":252246660,"user":{"login":"whitetigle","id":883207,"avatar_url":"https://avatars.githubusercontent.com/u/883207?v=3","gravatar_id":"","url":"https://api.github.com/users/whitetigle","html_url":"https://github.com/whitetigle","followers_url":"https://api.github.com/users/whitetigle/followers","following_url":"https://api.github.com/users/whitetigle/following{/other_user}","gists_url":"https://api.github.com/users/whitetigle/gists{/gist_id}","starred_url":"https://api.github.com/users/whitetigle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitetigle/subscriptions","organizations_url":"https://api.github.com/users/whitetigle/orgs","repos_url":"https://api.github.com/users/whitetigle/repos","events_url":"https://api.github.com/users/whitetigle/events{/privacy}","received_events_url":"https://api.github.com/users/whitetigle/received_events","type":"User","site_admin":false},"created_at":"2016-10-07T13:04:42Z","updated_at":"2016-10-07T13:04:42Z","body":"I confirm it works! Bravo 👍 "}}
{"actor":{"display_login":"whitetigle"}}