types - Haskell, String vs ...String? -
i'm following happstack lite tutorial website. http://happstack.com/page/view-page-slug/9/happstack-lite-tutorial
right now, i'm implementing echo function, , compiler giving me error message don't understand. here's code:
echo :: serverpart response echo = path $ \(msg :: string) -> ok $ template "echo" $ h1 "echo service" p "giant, haskell style papagallo" p msg and here's error message:
src/motiondude.hs:35:15: couldn't match type `[char]' `text.blaze.internal.markupm ()' expected type: html actual type: string in first argument of `p', namely `msg' in stmt of 'do' block: p msg in second argument of `($)', namely `do { h1 "echo service"; p "giant, haskell style papagallo"; p msg }' i thought quote-enclosed "thing",
"giant, haskell style papagallo" was string. yet, understand compiler error, p not accept string argument. can explain me?
the problem seem have enabled overloadedstring extensions means
"foo" :: isstring => to coerce plain old string implementing isstring use fromstring. in case however, happstack has function html looks more appropriate.
Comments
Post a Comment