Created
May 6, 2024 19:36
-
-
Save ramirez7/3f671cb455310c5c3d41ab0c9f3a0eab to your computer and use it in GitHub Desktop.
Make an arbitrarily large Haskell error message (and make your computer very warm)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# OPTIONS_GHC -freduction-depth-0 #-} | |
import GHC.TypeLits | |
data N = Z | S N | |
type F :: Nat -> N | |
type family F n where | |
F 0 = Z | |
F n = S (F (n - 1)) | |
data P a = P | |
x :: P Z | |
x = P @(F 10000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
spew-error.hs
is 311 + the length of the typelit10000
results in a40202
character error message for a316
character file. Ratio =127.2
.100000
results in a400276
character error message for a317
character file (and took hours to finish). Ratio =1262.7
.