Open
Description
Running the dhall-docs
executable from the 1.42.0 release on the following file:
let isZero = \(x : Natural) -> x === 0
let errorGeneratingDocs
= \(n : Natural) -> \(p : isZero n) ->
True
in errorGeneratingDocs
results in:
dhall-docs: Prelude.head: empty list
A binary I compiled myself reveals some more detail:
CallStack (from HasCallStack):
error, called at libraries/base/GHC/List.hs:1646:3 in base:GHC.List
errorEmptyList, called at libraries/base/GHC/List.hs:85:11 in base:GHC.List
badHead, called at libraries/base/GHC/List.hs:81:28 in base:GHC.List
head, called at src/Dhall/Docs/CodeRenderer.hs:378:127 in dhall-docs-1.0.11-inplace:Dhall.Docs.CodeRenderer
The relevant code is:
dhall-haskell/dhall-docs/src/Dhall/Docs/CodeRenderer.hs
Lines 375 to 379 in 4d21a18
What I found out is that the bug seems somehow related to whitespace (e.g. removing the indentation or even replacing tabs with spaces makes the error disappear).
Activity