Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,313
    • Issues 4,313
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 385
    • Merge Requests 385
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17306

Closed
Open
Opened Oct 04, 2019 by Jakob Brünker@JakobBruenker

:kind! should adhere to -freduction-depth

Summary

:kind! consumes gigabytes of memory for a while and then fails with *** Exception: stack overflow (GHCi itself does not crash, as long as enough memory is available) if given a non-terminating type-level expression, while using such a type elsewhere will immediately result in ghc announcing that it has reached the limit of it's reduction stack (with size 200 by default, specified by -freduction-depth). I can't be sure if this is intended, since -freduction-depth doesn't appear to be documented in the user guide, but it's not something I would have expected.

Steps to reproduce

Type the following in GHCi:

:set -XTypeFamilies -XUndecidableInstances
type family F where F = F
:kind! F

Typing something like undefined :: F works as expected, with an error message about having reached a reduction stack size of 201.

Expected behavior

I would expect to get the current error message from undefined :: F for both undefined :: F and :kind! F.

Environment

  • GHC version used:

8.6.5, 8.8.1, HEAD (8.9.0.20191001)

  • Operating System:

Windows, nixos

  • System Architecture:

x86_64

Edited Oct 04, 2019 by Jakob Brünker
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#17306