-
-
Save Lysxia/d6f76ae009dfb387fd573e89412e34f1 to your computer and use it in GitHub Desktop.
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, GADTs, UndecidableInstances, TypeFamilies #-} | |
data Nat = Z | S Nat | |
type family Infinite :: Nat where Infinite = S Infinite | |
data Vec (n :: Nat) where VZ :: Vec Z ; VS :: Vec n -> Vec (S n) | |
x :: Vec Infinite | |
x = VS x | |
main = main | |
{- | |
A.hs:10:5: error: | |
• Reduction stack overflow; size = 201 | |
When simplifying the following type: Infinite | |
Use -freduction-depth=0 to disable this check | |
(any upper bound you could choose might fail unpredictably with | |
minor updates to GHC, so disabling the check is recommended if | |
you're sure that type checking should terminate) | |
• In the expression: VS x | |
In an equation for ‘x’: x = VS x | |
| | |
10 | x = VS x | |
| ^^^^ | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment