You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For background, please see this post on the google group. To solve the type variable not being in scope problem, I've deviated from my original plan of using a &{} syntax. Instead I've:
UpdatedmkYesodGeneral so that it can accept type variables as well. For example, you can now do: mkYesodSubData "MySubsite master". This also fixed a non-exhaustive pattern matching bug.
UpdatedttToType so that type variables can be parsed in routes. This now can look something like: /#{MyDataId master} MyHandlerR GET
Added contexts as an argument to mkYesodGeneral'. These contexts are added to the instances generated. When there are contexts, I switched to use standalone deriving instead of regular deriving since I was running into this issue.
So far, it seems like everything is working as I'd like. You can see what I currently have on my vars branch. I don't think there are any breaking changes (I'm not sure if every template-haskell version works properly though).
I'd like to make a few more changes.
Implement a context parser so that we can just write mkYesodSubData "(MyClass master) => MySubsite master" instead of passing in a manually constructed Cxt.
Change the [Either String [String]] to [String] in mkYesodGeneral since the context parser would subsume this functionality.
Do you have any thoughts before I continue?
The text was updated successfully, but these errors were encountered:
I just created PR #1366. This implements the context parser and everything mentioned above it. There shouldn't be any breaking changes.
I didn't change mkYesodGeneral since this would be a breaking change with mkYesodWith exported. I can create a separate pull request if you'd like to save this change for the next major version bump.
For background, please see this post on the google group. To solve the type variable not being in scope problem, I've deviated from my original plan of using a
&{}
syntax. Instead I've:mkYesodGeneral
so that it can accept type variables as well. For example, you can now do:mkYesodSubData "MySubsite master"
. This also fixed a non-exhaustive pattern matching bug.ttToType
so that type variables can be parsed in routes. This now can look something like:/#{MyDataId master} MyHandlerR GET
mkYesodGeneral'
. These contexts are added to the instances generated. When there are contexts, I switched to use standalone deriving instead of regular deriving since I was running into this issue.So far, it seems like everything is working as I'd like. You can see what I currently have on my vars branch. I don't think there are any breaking changes (I'm not sure if every template-haskell version works properly though).
I'd like to make a few more changes.
mkYesodSubData "(MyClass master) => MySubsite master"
instead of passing in a manually constructedCxt
.[Either String [String]]
to[String]
inmkYesodGeneral
since the context parser would subsume this functionality.Do you have any thoughts before I continue?
The text was updated successfully, but these errors were encountered: