undefined symbol not allowed?

I'm one of those evil people who loves to sprinkle Unicode throughout my code. I thought it was pretty cool when I learned about the UnicodeSyntax language extension, as well as the base-unicode-symbols package. However, I am a little perplexed that this symbol is not provided by either of those: ⊥ That is, the "bottom" symbol, Unicode #22A5 (\8869), which I have seen in some programming texts as representing the undefined expression. I tried just defining ⊥ = undefined But ghc won't parse that. Why is this? And is there a way to make it work? -- frigidcode.com theologia.indicium.us

On Thu, Jul 7, 2011 at 11:42 PM, Christopher Howard
I'm one of those evil people who loves to sprinkle Unicode throughout my code. I thought it was pretty cool when I learned about the UnicodeSyntax language extension, as well as the base-unicode-symbols package. However, I am a little perplexed that this symbol is not provided by either of those:
⊥
That is, the "bottom" symbol, Unicode #22A5 (\8869), which I have seen in some programming texts as representing the undefined expression.
I tried just defining
⊥ = undefined
But ghc won't parse that. Why is this? And is there a way to make it work?
What error message do you get?
-- frigidcode.com theologia.indicium.us
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On Fri, Jul 8, 2011 at 00:42, Christopher Howard
I tried just defining
⊥ = undefined
But ghc won't parse that. Why is this? And is there a way to make it work?
The language spec divides characters up as being identifier characters vs. punctuation, using the rules for Unicode; ⊥ is the latter. As such, it can only appear infix or within parentheses, the latter being the syntax to use an operator as a function; compare (+) and note that it's the trivial case of section syntax). So if you're willing to settle for using it as "(⊥)" everywhere (*including* when defining it) then you can do it, but bare "⊥" isn't legal. -- brandon s allbery allbery.b@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms
participants (3)
-
Antoine Latter
-
Brandon Allbery
-
Christopher Howard