<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mkotha</author_name>
  <author_url>https://blog.hatena.ne.jp/mkotha/</author_url>
  <blog_title>www.kotha.netの裏</blog_title>
  <blog_url>https://mkotha.hatenadiary.org/</blog_url>
  <categories>
    <anon>haskell</anon>
    <anon>game</anon>
  </categories>
  <description>これを書いている時点でAtCoderのHaskell処理系はGHC 7.4であり、これはプログラムに対してデフォルトで8MBのスタック制限を課す。したがって、深さ数十万の再帰を普通に書くと容易にスタック溢れによるREを起こす。このスタック制限値はコンパイル時または実行時にRTSの-Kオプションで変更できるが、AtCoderではGHCにも自分のプログラムにも好きなオプションを渡すことが基本的にはできない*1ので、他の方法を考える。 回避策 以下のコードをコピペした上で、mainの先頭でunlimitStackSizeを呼べば良い。 import Control.Monad import Data…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmkotha.hatenadiary.org%2Fentry%2F20140916%2F1410864841&quot; title=&quot; AtCoderでHaskell解がスタックオーバーフローを起こす問題の回避策 - www.kotha.netの裏&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2014-09-16 19:54:01</published>
  <title> AtCoderでHaskell解がスタックオーバーフローを起こす問題の回避策</title>
  <type>rich</type>
  <url>https://mkotha.hatenadiary.org/entry/20140916/1410864841</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
