Skip to content
This repository has been archived by the owner on Aug 23, 2018. It is now read-only.

probably infinite type causing loop #191

Open
ghost opened this issue Mar 30, 2018 · 1 comment
Open

probably infinite type causing loop #191

ghost opened this issue Mar 30, 2018 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 30, 2018

type Zipper a
  = Zipper (List a) a (List a)


alwaysEmpty : Zipper a -> List a
alwaysEmpty _ = []


map f (Zipper before current after) =
  let g = alwaysEmpty >> f in

  Zipper
    (List.map g before)
    g
    after
    (List.map g after)

Causes elm-lang.org/try to run out of memory as well. I assume this is because the compiler gets stuck in a loop while trying to resolve type information for map.

abecker@eldin-laptop:~$ elm --version
0.18.0
abecker@eldin-laptop:~$ uname -a
Linux 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3 (2018-03-02) x86_64 GNU/Linux
@process-bot
Copy link

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

@evancz evancz changed the title 16 lines of code that can crash elm-make and/or your computer probably infinite type causing loop Mar 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant