haskell - Yesod's TH generates incorrect code? -


i'm making yesod subsite , getting type error in template haskell-generated code:

yesod\datasource\data.hs:19:1: couldn't match type `[char]' `text' expected type: () -> ([text], [(text, text)]) -> maybe (route datasource)   actual type: () -> ([[char]], [(text, text)]) -> maybe (route datasource) in first argument of `\ f_amms x_ammt -> f_amms () x_ammt ::                             forall a_ammu.                             (() -> ([text], [(text, text)]) -> maybe (route a_ammu))                             -> ([text], [(text, text)]) -> maybe (route a_ammu)', namely   `helper_ammr' in expression:     \ f_amms x_ammt -> f_amms () x_ammt ::       forall a_ammu.       (() -> ([text], [(text, text)]) -> maybe (route a_ammu))       -> ([text], [(text, text)]) -> maybe (route a_ammu)     helper_ammr 

the problem clear, don't understand why it's generating incorrect code.

the issue occurs in th call:

mkyesodsubdata "datasource" [parseroutes| / subhomer /datasource datasourceinputr post |] 

specifically, caused line:

/datasource datasourceinputr post 

removing line fixes issue.

i'm using stackage lts 1.15:

remote-repo: stackage-lts-1.15:http://www.stackage.org/snapshot/lts-1.15 

and i'm inside cabal sandbox.

here relevant files: https://gist.github.com/beerendlauwers/774cc432c3ada5b597e1

any idea?

i think generated code expects have overloadedstrings extension enabled in source file. try adding

{-# language overloadedstrings #-} 

to top of source file splice in template haskell code (i.e. data.hs).


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -