Skip to content

Prelude.undefined with a build executable. #33

@locallycompact

Description

@locallycompact

Hi, I have some bizarre behaviour that I pushed to this repository.

https://github.com/locallycompact/replace-megaparsec-bug

I am on NixOS so my commands are with --nix

If I build with stack --nix build and then run stack --nix exec -- replace-megaparsec-bug-exe I get a callstack with Prelude.undefined.

[I] lc@aiur ~/replace-megaparsec-bug (master)> 
stack --nix build && stack --nix exec -- replace-megaparsec-bug-exe
replace-megaparsec-bug-exe: Prelude.undefined
CallStack (from HasCallStack):
  error, called at libraries/base/GHC/Err.hs:80:14 in base:GHC.Err
  undefined, called at src/Replace/Megaparsec.hs:211:21 in replace-megaparsec-1.4.2.0-8z2kgUAlSuYEyo1NOrKi1C:Replace.Megaparsec

However if I run the executable ./Script.hs as a stack script with the exact same content, it executes and returns.

[I] lc@aiur ~/replace-megaparsec-bug (master)> ./Script.hs 
[]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions