yesodweb / yesod-scaffold

The Yesod scaffolding, with branches for different versions.
MIT License
75 stars 39 forks source link

Add ViewPatterns to Application.hs #176

Closed psibi closed 6 years ago

psibi commented 6 years ago

As soon as you add a new route which accepts an input, you will be greeted with this error:

/home/sibi/todo/src/Application.hs:49:1: error:
    Illegal view pattern:  fromPathPiece -> Just dyn_awHr
    Use ViewPatterns to enable view patterns
   |
49 | mkYesodDispatch "App" resourcesApp
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

And since defining a route taking inputs is a common task, we should add this extension by default in the file.