[Haskell-cafe] Where is the hole?

Joachim Breitner mail at joachim-breitner.de
Fri Aug 11 15:38:12 UTC 2017


Hi,

cpp easily gets confused by single primes in variables names, which do
not exist in C. You can use a better suited cpp implementation, such as
http://projects.haskell.org/cpphs/

Greetings,
Joachim

Am Freitag, den 11.08.2017, 18:25 +0300 schrieb Baa:
> Hello, Dear List!
> 
> I have code (this is the fragment only):
> 
>   {-# LANGUAGE CPP                 #-}
>   ...
>   ...
>     let user' = ...
>     ...
>     else defect $ logger # ("authentication failure (user: " ++ user'
> ++ ")") #: __LINE__
>     ...
>   ...
> 
> and I get compilation error:
> 
>         • Found hole: __LINE__ :: Int
>           Or perhaps ‘__LINE__’ is mis-spelled, or not in scope
>         • In the second argument of ‘(#:)’, namely ‘__LINE__’
>           In the second argument of ‘($)’, namely
>             ‘logger # ("authentication failure (user: " ++ user' ++
> ")")
>              #: __LINE__’
>           In the expression:
>             defect
>             $ logger # ("authentication failure (user: " ++ user' ++
> ")")
>               #: __LINE__
>         • Relevant bindings include...
>         ... etc ...
> 
> But if I change variable name to `userx` (from user'), all is
> compiled
> succesflully, no any holes. Where is the hole?
> 
> ---
> Best regards, Paul
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
-- 
Joachim “nomeata” Breitner
  mail at joachim-breitner.de
  https://www.joachim-breitner.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170811/8f9e9c3e/attachment.sig>


More information about the Haskell-Cafe mailing list