[Haskell-cafe] Unicode Haskell source -- Yippie!

Nick Rudnick nick.rudnick at gmail.com
Fri Apr 25 08:49:04 UTC 2014


Thanks for the hint =)

I ever wondered about some special characters on the standard keyboard,

°  -- i.e. [⇑][^]
§
¢
€
¶ --e.g. [Alt Gr][R]
· -- e.g. [Alt Gr][,]
… -- e.g. [Alt Gr][,]
–  -- e.g. [Alt Gr][-], though optically ambiguous with -, a candidate for
*unary
       minus*, which I think ever has been considered to be realized a
little
       unsatisfactorily
¬  e.g. [Alt Gr][6], also a great candidate for unary use

now I see they are usable, too, which to me is great news.

Since some time, I began using chars like þ, ø, æ, ŋ, ð, µ, ħ, etc., which,
easily accessible on a Linux keyboard, have more than cosmetic utility to
me; with find / replace it prevents you from the usual trouble when working
– but that with the special chars above is a pleasing discovery. :-)

I ever wondered for the reason that in Haskell function composition is not
declared by (°) instead of (.), which (a) interferes with other uses of the
period and (b) looks less similar to the actual symbol.

It also reminds me of a very beautiful feature (Emacs) haskell-mode had
some years ago; it was able to display special characters in wider
characters (maybe using a special Emacs font??) – does anybody know what I
am speaking about, too?

Unfortunately, this feature wasn't continued while frankly, "←" as in
recent use to me slightly hurts the eye a little everywhere it's seen in
code (sorry, "←"... ;-), while back then, in Emacs there where BEAUTIFUL
arrows in double width and gorgeous lambdas.

Cheers, Nick








2014-04-24 19:15 GMT+02:00 Rustom Mody <rustompmody at gmail.com>:

> I'm mighty pleased to note that the following is valid Haskell code!
>
> Do others find this useful/appealing?
> Any possibilities on making the commented out parts work?
>
> [Pragmatics about typing this at the same speed and facility as we do with
> Ascii is a separate and (IMHO) solvable problem though its not the case at
> the moment]
>
>
> --------------------
> import qualified Data.Set as Set
> -- Experimenting with Unicode in Haskell source
>
> -- Numbers
> x ≠ y   = x /= y
> x ≤ y   = x <= y
> x ≥ y   = x >= y
> x ÷ y   = divMod x y
> x ⇑ y   = x ^ y
>
> x × y   = x * y -- readability hmmm !!!
> π = pi
>
> -- ⌊ x = floor x
> -- ⌈ x = ceiling x
>
> -- Lists
> xs ⤚ ys = xs ++ ys
>
> -- Bools
> x ∧ y   = x && y
> x ∨ y   = y || y
> -- ¬x = not x
>
>
> -- Sets
>
> x ∈ s   = x `Set.member` s -- or keep ∈ for list elem?
> s ∪ t   = s `Set.union` t
> s ∩ t   = s `Set.intersection` t
> s ⊆ t   = s `Set.isSubsetOf` t
> s ⊂ t   = s `Set.isProperSubsetOf` t
> s ⊈ t   = not (s `Set.isSubsetOf` t)
> -- ∅ = Set.null
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140425/5cebb18f/attachment.html>


More information about the Haskell-Cafe mailing list