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

Rustom Mody rustompmody at gmail.com
Thu Apr 24 17:15:49 UTC 2014


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140424/7adacf2d/attachment.html>


More information about the Haskell-Cafe mailing list