Skip to content
This repository has been archived by the owner on Jan 24, 2020. It is now read-only.

hastache-0.6.1 doesn't compile with GHC 7.10.1 #47

Open
peti opened this issue Apr 17, 2015 · 2 comments
Open

hastache-0.6.1 doesn't compile with GHC 7.10.1 #47

peti opened this issue Apr 17, 2015 · 2 comments

Comments

@peti
Copy link

peti commented Apr 17, 2015

Citing from http://hydra.cryp.to/build/719531/log/raw:

Preprocessing test suite 'test-hastache' for hastache-0.6.1...
[1 of 1] Compiling Main             ( tests/test.hs, dist/build/test-hastache/test-hastache-tmp/Main.dyn_o )

tests/test.hs:220:5:
    Non type-variable argument in the constraint: MonadWriter T.Text m
    (Use FlexibleContexts to permit this)
    When checking that ‘context’ has the inferred type
      context :: forall (m :: * -> *).
                 MonadWriter T.Text m =>
                 [Char] -> MuType m
    In an equation for ‘lambdaMSectionTest’:
        lambdaMSectionTest
          = do { (res, writerState) <- runWriterT monadicFunction;
                 assertEqualStr resCorrectness (decodeStrLT res) testRes;
                 assertEqualStr
                   "monad state correctness" (decodeStr writerState) testMonad }
          where
              monadicFunction
                = hastacheStr
                    defaultConfig (encodeStr template) (mkStrContext context)
              template
                = "[{{#mf}}abc{{/mf}}]\n\
                  \[{{#mf}}def{{/mf}}]\n"
              context "mf" = MuLambdaM $ \ i -> ...
              testRes
                = "[cba]\n\
                  \[fed]\n"
              ....

tests/test.hs:239:5:
    Non type-variable argument in the constraint: MonadError [Char] m
    (Use FlexibleContexts to permit this)
    When checking that ‘context’ has the inferred type
      context :: forall (m :: * -> *) (m1 :: * -> *).
                 MonadError [Char] m =>
                 [Char] -> m (MuType m1)
    In an equation for ‘monadicContextTest’:
        monadicContextTest
          = do { r <- runErrorT
                      $ hastacheStr
                          defaultConfig (encodeStr template) (mkStrContextM context);
                 let res = ...;
                 assertEqualStr resCorrectness res testRes }
          where
              template
                = "Hello, {{name}}! You have {{unread}} unread messages. {{some}}"
              context "name" = return $ MuVariable "Haskell"
              context "unread" = return $ MuVariable (100 :: Int)
              context var = throwError $ "{{" ++ var ++ "}} not found!"
              testRes = "error: {{some}} not found!"
@nomeata
Copy link

nomeata commented Aug 15, 2015

It would be nice to have this fixed, given hastache is a dependency of criterion.

@qrilka
Copy link

qrilka commented Jun 1, 2016

Addressed by #50

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants