[Haskell-beginners] Unicode Fanatic -- How to use?

David McBride toad3k at gmail.com
Thu Mar 27 21:13:38 UTC 2014


I think the problem is that ¬ is unary.  You can use problem = (¬) True.
I'm not sure that there isn't a way around this.


On Thu, Mar 27, 2014 at 4:51 PM, John M. Dlugosz
<ngnr63q02 at sneakemail.com>wrote:

> I love using non-ASCII characters!  Even my name, Długosz, needs Latin-2.
>  My wife's name, 涛, doesn't even use Latin characters.  I've inserted
> thousands of em and en dashes in Wikipedia and can easily type at least
> three kinds of blank space.
>
> When I was in a college class on programming theory, we studied Backus’s
> FP System and I corresponded with John Backus to ask a question the prof
> couldn't handle, and he sent me the TeX definitions he used, so my homework
> really did match the appearance of the textbook.  But that's another story.
>  I managed to get my name in the Unicode 3 hardcopy book.
>
> So, I relish the ability to use proper math symbols in Haskell.
>
> Here is an example of what I've tried:
>
>         {-# LANGUAGE UnicodeSyntax #-}
>
>         import Prelude.Unicode
>
>         f x y = x∨y
>
>         result = f ∘ id
>
>         -- problem = ¬ True
>
> Is the UnicodeSyntax pragma a different mechanism than the modules?  Do I
> need to state both, or do they clash, or work together, or what?
>
> Do I need to list all the individual modules (up to 12 of them) as needed
> (see http://hackage.haskell.org/package/base-unicode-symbols) or can they
> be brought in as one easy chunk, as the package itself is one thing?
>
> The compiler does not like the ¬ symbol, with or without the pragma.
> http://hackage.haskell.org/package/base-unicode-symbols-
> 0.2.2.4/docs/Prelude-Unicode.html
> clearly shows it (the first one!) and it appears in the module source so
> presumably it didn't choke there.  I recall seeing that it is one of the
> "problematic" symbols but GHC has some extensions.
>
> OTOH, I read that λ can’t be made to work, which is sad.  Maybe ⅄ (which
> is a symbol) can be used instead?
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140327/1c389b1a/attachment.html>


More information about the Beginners mailing list