I can also reproduce this with your example. Simply load the file into ghci and run,
$ ghci tinychess.hs GHCi, version 7.10.2.20151118: http://www.haskell.org/ghc/ :? for help[1 of 1] Compiling Main ( tinychess.hs, interpreted )Ok, modules loaded: Main.λ> import Control.Monad (forever)λ> forever $ playGame 6... D---+---+---C | | K | | \---A---A---/[-2,3,-3,5,-3,3]<interactive>: internal error: evacuate: strange closure type 1195407224 (GHC version 7.10.2.20151118 for x86_64_unknown_linux) Please report this as a GHC bug: http://www.haskell.org/ghc/reportabugAborted$
The problem is evidently still lurking as I see segmentation faults if I run the same test with a recent ghc-8.0 snapshot.
(gdb) bt#0 0x00007fffecd46507 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:55#1 0x00007fffecd478da in __GI_abort () at abort.c:89#2 0x00007fffed2f4302 in rtsFatalInternalErrorFn (s=<optimized out>, ap=0x7fffeb38dba8) at rts/RtsMessages.c:182#3 0x00007fffed2f4460 in barf (s=s@entry=0x7fffed31ab80 "evacuate: strange closure type %d") at rts/RtsMessages.c:46#4 0x00007fffed2df88e in evacuate (p=p@entry=0x204ed00a8) at rts/dist/build/sm/Evac_thr.c:740#5 0x00007fffed2fe711 in tidyWeakList (gen=<optimized out>) at rts/sm/MarkWeak.c:270#6 0x00007fffed2fea08 in traverseWeakPtrList () at rts/sm/MarkWeak.c:130#7 0x00007fffed300332 in GarbageCollect (collect_gen=collect_gen@entry=1, do_heap_census=do_heap_census@entry=rtsFalse, gc_type=gc_type@entry=2, cap=cap@entry=0x7fffed52ad00 <MainCapability>) at rts/sm/GC.c:409#8 0x00007fffed2f1d51 in scheduleDoGC (pcap=pcap@entry=0x7fffeb38deb0, task=task@entry=0x7af4f0, force_major=force_major@entry=rtsFalse) at rts/Schedule.c:1652#9 0x00007fffed2f294e in schedule (initialCapability=<optimized out>, task=task@entry=0x7af4f0) at rts/Schedule.c:551#10 0x00007fffed2f3a5c in scheduleWorker (cap=<optimized out>, task=0x7af4f0) at rts/Schedule.c:2378#11 0x00007ffff738c284 in start_thread (arg=0x7fffeb38e700) at pthread_create.c:333#12 0x00007fffecdfba4d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
would exhaust memory on my machine and I had to kill it. The argument 0 determines the depth of moves that are considered for evaluating the possible next positions. Without profiling this completes instantly as one would expect.