Purescript: Internal error due to old docs.json files

Created on 12 Jul 2020  路  3Comments  路  Source: purescript/purescript

Summary

I've just encountered a crash that happened due to presence of old docs.json files in the output/ directory (removing output/ solved the problem).

Proposal

Include compiler version in all (or some) artifacts, to invalidate them when it does not match the actual version.

bug

Most helpful comment

I think the problem is that the compiler does not realise that the docs.json file needs to be regenerated if the externs file is already up to date (but docs were not produced at the same time that externs file was generated). This can be observed as follows:

  1. First, write the following into src/Main.purs:
module Main where
x = 1
  1. Then run
purs compile src/Main.purs
purs docs src/Main.purs

Note that generated-docs/html/Main.html exists and mentions that Main exports a value x :: Int.

  1. Now, add a new value to the Main module:
echo 'y = 1' >> src/Main.purs
  1. and compile it again:
purs compile src/Main.purs
  1. and then ask for docs to be regenerated:
purs docs src/Main.purs

and note that generated-docs/html/Main.html does not mention any exported value y. However, if you skip step 4, the HTML docs are updated correctly.

All 3 comments

If it's causing a crash, I'd consider that a bug. Can you provide reproduction steps please?

$ spago docs
[info] Generating documentation for the project. This might take a while...
purs: An internal error occurred during compilation: Docs.Convert.ReExports: while collecting re-exports for module: Data.Lens, lookupValueDeclaration: unexpected result:
other: []
ident: Ident "lensStore"
decls: [Declaration {declTitle = "lens", declComments = Just "Create a `Lens` from a getter/setter pair.\n\n```purescript\n> species = lens _.species $ _ {species = _}\n> view species {species : \"bovine\"}\n\"bovine\"\n\n> _2 = lens Tuple.snd $ \\(Tuple keep _) new -> Tuple keep new\n```\n\nNote: `_2` is predefined in `Data.Lens.Tuple`.\n", declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 39, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 39, sourcePosColumn = 66}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeVar () "a")))) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "b")) (TypeVar () "t"))))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "Lens"}))) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b")))) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "lens'", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 42, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 42, sourcePosColumn = 65}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Tuple")) (ProperName {runProperName = "Tuple"}))) (TypeVar () "a")) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "b")) (TypeVar () "t"))))))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "Lens"}))) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "withLens", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 45, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 45, sourcePosColumn = 85}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "r" Nothing (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "ALens"}))) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeVar () "a")))) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "b")) (TypeVar () "t"))))) (TypeVar () "r"))))) (TypeVar () "r"))) Nothing) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "cloneLens", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 48, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 48, sourcePosColumn = 59}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "ALens"}))) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "Lens"}))) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "ilens", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 57, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 58, sourcePosColumn = 61}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (ForAll () "i" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Tuple")) (ProperName {runProperName = "Tuple"}))) (TypeVar () "i")) (TypeVar () "a"))))) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "b")) (TypeVar () "t"))))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "IndexedLens"}))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b")))) Nothing) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "ilens'", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 52, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 53, sourcePosColumn = 61}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (ForAll () "i" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Tuple")) (ProperName {runProperName = "Tuple"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Tuple")) (ProperName {runProperName = "Tuple"}))) (TypeVar () "i")) (TypeVar () "a")))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "b")) (TypeVar () "t"))))))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "IndexedLens"}))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) Nothing) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "withIndexedLens", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 61, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 62, sourcePosColumn = 79}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "r" Nothing (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (ForAll () "i" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "AnIndexedLens"}))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b")))) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Tuple")) (ProperName {runProperName = "Tuple"}))) (TypeVar () "i")) (TypeVar () "a")))))) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "s")) (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeVar () "b")) (TypeVar () "t"))))) (TypeVar () "r"))))) (TypeVar () "r"))) Nothing) Nothing) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "cloneIndexedLens", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Lens.purs", spanStart = SourcePos {sourcePosLine = 65, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 65, sourcePosColumn = 87}}), declChildren = [], declInfo = ValueDeclaration (ForAll () "b" Nothing (ForAll () "a" Nothing (ForAll () "t" Nothing (ForAll () "s" Nothing (ForAll () "i" Nothing (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Prim")) (ProperName {runProperName = "Function"}))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "AnIndexedLens"}))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "IndexedLens"}))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) Nothing) Nothing) Nothing) Nothing) Nothing)},Declaration {declTitle = "Lens'", declComments = Just "`Lens'` is a specialization of `Lens`. An optic of type `Lens'`\ncan change only the value of its focus,\nnot its type. As an example, consider the `Lens` `_2`, which has this type:\n\n```purescript\n_2 :: forall s t a b. Lens (Tuple s a) (Tuple t b) a b \n```\n\n`_2` can produce a `Tuple Int String` from a `Tuple Int Int`:\n\n```purescript\nset _2 \"NEW\" (Tuple 1 2) == (Tuple 1 \"NEW\")\n```\n\nIf we specialize `_2`'s type with `Lens'`, the following will not\ntype check:\n\n```purescript\nset (_2 :: Lens' (Tuple Int Int) Int) \"NEW\" (Tuple 1 2)\n           ^^^^^^^^^^^^^^^^^^^^^^^^^\n```\n\nSee `Data.Lens.Getter` and `Data.Lens.Setter` for functions and operators\nfrequently used with lenses.\n", declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 79, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 79, sourcePosColumn = 30}}), declChildren = [], declInfo = TypeSynonymDeclaration [("s",Nothing),("a",Nothing)] (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "Lens"}))) (TypeVar () "s")) (TypeVar () "s")) (TypeVar () "a")) (TypeVar () "a"))},Declaration {declTitle = "Lens", declComments = Just "Given a type whose \"focus element\" always exists,\na lens provides a convenient way to view, set, and transform\nthat element. \n\nFor example, `_2` is a tuple-specific `Lens` available from `Data.Lens`, so:\n```purescript\nover _2 String.length $ Tuple \"ignore\" \"four\" == Tuple \"ignore\" 4\n```\nNote the result has a different type than the original tuple.\nThat is, the four `Lens` type variables have been narrowed to:\n\n* `s` is `Tuple String String`\n* `t` is `Tuple String Int`\n* `a` is `String`\n* `b` is `Int`\n\nSee `Data.Lens.Getter` and `Data.Lens.Setter` for functions and operators\nfrequently used with lenses.\n", declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 52, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 52, sourcePosColumn = 58}}), declChildren = [], declInfo = TypeSynonymDeclaration [("s",Nothing),("t",Nothing),("a",Nothing),("b",Nothing)] (ForAll () "p" Nothing (ConstrainedType () (Constraint {constraintAnn = (), constraintClass = Qualified (Just (ModuleName "Data.Profunctor.Strong")) (ProperName {runProperName = "Strong"}), constraintArgs = [TypeVar () "p"], constraintData = Nothing}) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "Optic"}))) (TypeVar () "p")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) Nothing)},Declaration {declTitle = "IndexedLens'", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 108, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 108, sourcePosColumn = 48}}), declChildren = [], declInfo = TypeSynonymDeclaration [("i",Nothing),("s",Nothing),("a",Nothing)] (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "IndexedLens"}))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "s")) (TypeVar () "a")) (TypeVar () "a"))},Declaration {declTitle = "IndexedLens", declComments = Just "An indexed lens.\n", declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 107, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 107, sourcePosColumn = 76}}), declChildren = [], declInfo = TypeSynonymDeclaration [("i",Nothing),("s",Nothing),("t",Nothing),("a",Nothing),("b",Nothing)] (ForAll () "p" Nothing (ConstrainedType () (Constraint {constraintAnn = (), constraintClass = Qualified (Just (ModuleName "Data.Profunctor.Strong")) (ProperName {runProperName = "Strong"}), constraintArgs = [TypeVar () "p"], constraintData = Nothing}) (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "IndexedOptic"}))) (TypeVar () "p")) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))) Nothing)},Declaration {declTitle = "AnIndexedLens'", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 111, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 111, sourcePosColumn = 52}}), declChildren = [], declInfo = TypeSynonymDeclaration [("i",Nothing),("s",Nothing),("a",Nothing)] (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "AnIndexedLens"}))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "s")) (TypeVar () "a")) (TypeVar () "a"))},Declaration {declTitle = "AnIndexedLens", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 110, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 110, sourcePosColumn = 75}}), declChildren = [], declInfo = TypeSynonymDeclaration [("i",Nothing),("s",Nothing),("t",Nothing),("a",Nothing),("b",Nothing)] (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "IndexedOptic"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Internal.Shop")) (ProperName {runProperName = "Shop"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Tuple")) (ProperName {runProperName = "Tuple"}))) (TypeVar () "i")) (TypeVar () "a")))) (TypeVar () "b")))) (TypeVar () "i")) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))},Declaration {declTitle = "ALens'", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 104, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 104, sourcePosColumn = 32}}), declChildren = [], declInfo = TypeSynonymDeclaration [("s",Nothing),("a",Nothing)] (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "ALens"}))) (TypeVar () "s")) (TypeVar () "s")) (TypeVar () "a")) (TypeVar () "a"))},Declaration {declTitle = "ALens", declComments = Nothing, declSourceSpan = Just (SourceSpan {spanName = ".spago/profunctor-lenses/v6.2.0/src/Data/Lens/Types.purs", spanStart = SourcePos {sourcePosLine = 103, sourcePosColumn = 1}, spanEnd = SourcePos {sourcePosLine = 103, sourcePosColumn = 46}}), declChildren = [], declInfo = TypeSynonymDeclaration [("s",Nothing),("t",Nothing),("a",Nothing),("b",Nothing)] (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Types")) (ProperName {runProperName = "Optic"}))) (ParensInType () (TypeApp () (TypeApp () (TypeConstructor () (Qualified (Just (ModuleName "Data.Lens.Internal.Shop")) (ProperName {runProperName = "Shop"}))) (TypeVar () "a")) (TypeVar () "b")))) (TypeVar () "s")) (TypeVar () "t")) (TypeVar () "a")) (TypeVar () "b"))}]
Please report this at https://github.com/purescript/purescript/issues
CallStack (from HasCallStack):
  error, called at src/Language/PureScript/Crash.hs:24:3 in purescript-0.13.8-COscWkGZ6j0FifhWjtk8mz:Language.PureScript.Crash
  internalError, called at src/Language/PureScript/Docs/Convert/ReExports.hs:513:17 in purescript-0.13.8-COscWkGZ6j0FifhWjtk8mz:Language.PureScript.Docs.Convert.ReExports

To Reproduce

I am unable to reproduce it anymore :(

I was running spago docs against this commit. I'm using PS tooling from easy-purescript-nix (47507b27e15a9c3b929111cf43d2e9c0e4b97f4c).

The previous purs version was 0.13.6, but I am not sure about the exact commit.

The problem appeared after I switched versions, but it may be caused by some other reason.

I think the problem is that the compiler does not realise that the docs.json file needs to be regenerated if the externs file is already up to date (but docs were not produced at the same time that externs file was generated). This can be observed as follows:

  1. First, write the following into src/Main.purs:
module Main where
x = 1
  1. Then run
purs compile src/Main.purs
purs docs src/Main.purs

Note that generated-docs/html/Main.html exists and mentions that Main exports a value x :: Int.

  1. Now, add a new value to the Main module:
echo 'y = 1' >> src/Main.purs
  1. and compile it again:
purs compile src/Main.purs
  1. and then ask for docs to be regenerated:
purs docs src/Main.purs

and note that generated-docs/html/Main.html does not mention any exported value y. However, if you skip step 4, the HTML docs are updated correctly.

Was this page helpful?
0 / 5 - 0 ratings