[Haskell-cafe] problems with stack, config.yaml

Ben hyarion at iinet.net.au
Fri May 26 23:46:15 UTC 2017


On 27 May 2017 9:27:29 am AEST, Dennis Raddle <dennis.raddle at gmail.com> wrote:
>A year ago I tried to install stack on my MacBook. Just recently I
>tried
>again, and it asked me if I wanted to upgrade rather than install. I
>did
>so, but got an error (some message from GHC saying 'the thing that
>should
>never happen, happened' or something like that). So I thought, okay let
>me
>try uninstalling stack first, then installing it, and going from there.
>
>So I did that, and I'm working the stack tutorial, and upon doing
>"stack
>setup" I got a parse error in config.yaml.
>
>  "Error in $.params: failed to parse field 'params', expected Map k a,
>encountered String"
>
>As far as the question of where I got my config.yaml from, I edited
>something that was there to add some specific information, but I am not
>sure if I changed anything else. Here is the config.yaml that produces
>the
>above error:
>
># This file contains default non-project-specific settings for 'stack',
>used
># in all projects.  For more information about stack's configuration,
>see
># http://docs.haskellstack.org/en/stable/yaml_configuration/
>
># The following parameters are used by "stack new" to automatically
>fill
>fields
># in the cabal config. We recommend uncommenting them and filling them
>out
>if
># you intend to use 'stack new'.
># See
>https://docs.haskellstack.org/en/stable/yaml_configuration/#templates
>templates:
>  params:
>    author-name:Dennis
>    author-email:dennisraddle at gmail.com
>    category:programming
>    copyright:2017
>    github-username:Dennis

Hi Dennis,

The problem is just that the structure of your YAML config file is off, so it doesn't say what you think it says.

Where you have things like "author-name:Dennis" you need a space after the colon for YAML to interpret it as a key value pair in a map. With what you have currently, the whole contents of your "params" section is just one string split over several lines, rather than a map (which is more or less what the error message is reporting).

You can see how YAML interprets your file here: https://yaml-online-parser.appspot.com/

-- Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170527/cb4f3130/attachment.html>


More information about the Haskell-Cafe mailing list