Skip to content
This repository was archived by the owner on Sep 28, 2023. It is now read-only.
This repository was archived by the owner on Sep 28, 2023. It is now read-only.

Pragmas ignored in \iohatex{...}? #7

@fedeinthemix

Description

@fedeinthemix

Hi,

I've written a custom function called includeSnippet with the following signature

includeSnippet :: FilePath -> Text -> LaTeXT IO Text

In my .htex file I include

\begin{haskellpragmas}
{-# LANGUAGE OverloadedStrings #-}
\end{haskellpragmas}

However, if I don't use pack for the second argument haskintex gives the following error:

$ haskintex -verbose -keep test_3.htex 
Info: memotree does not exist.
-> Using empty memotree.
Enabled flags: keep, verbose.
Reading test_3.htex...
Creating Haskell source file Haskintex_test_3.hs...
Evaluating expressions in test_3.htex...
Evaluation (IO LaTeX): execLaTeXT (includeSnippet "src/fact.hs" "ex1" >>= verbatim)
Warning: Error while evaluating the expression.
Compiler error:
<interactive>:2:42: error:
    • Couldn't match expected type ‘Text’ with actual type ‘[Char]’
    • In the second argument of ‘includeSnippet’, namely ‘"ex1"’
      In the first argument of ‘(>>=)’, namely
        ‘includeSnippet "src/fact.hs" "ex1"’
      In the first argument of ‘execLaTeXT’, namely
        ‘(includeSnippet "src/fact.hs" "ex1" >>= verbatim)’
File test_3.tex already exists. Overwrite? (use -overwrite to overwrite by default) y
Writing final file at test_3.tex...
End of processing of file test_3.htex.

It seems that during evaluation of the \iohatex{...} expressions, pragmas are ignored.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions