On Wed, Dec 23, 2009 at 5:43 PM, Roel van Dijk <[email protected]> wrote:
> I briefly looked at the Yi.Char.Unicode module and I'm not sure
> if it has the same goal or functionality as the 3 packages you
> mentioned. It appears to contain mappings from symbols name to
> actual unicode symbols on the data level.
>
> The idea of the x-unicode-symbols packages is to enable you to write
> your source code using unicode symbols.
>
> So if you have a snippet of code like this:
>
> foo :: Integral a => a -> Bool
> foo x = x `elem` [1..10] || odd x
>
> You can replace it with this:
>
> {-# LANGUAGE UnicodeSyntax #-}
>
> import Data.List.Unicode ( (∈) )
> import Data.Bool.Unicode ( (∨) )
>
> foo ∷ Integral α ⇒ α → Bool
> foo x = x ∈ [1..10] ∨ odd x
>
> Here are a number of packages which use base-unicode-symbols:
> http://bifunctor.homelinux.net/~roel/cgi-bin/hackage-scripts/revdeps/base-unicode-symbols
>
> What is the idea behind Yi.Char.Unicode?
>
> Regards,
> Roel

The idea is that it contains a mapping, String -> (Unicode) Char; it
is used in Yi for a 'pretty lambdas'-like mode where the text file
remains unchanged but the visual display in the terminal or whatever
shows the respective Unicode symbol in place of the long ASCII name.
This is, I think, similar to the unicode-symbols packages except
instead of defining the symbols directly, it allows replacement. It is
a slightly different change of emphasis.
(Offhand, I wonder whether it would be possible to use TH to generate
the function aliases directly from Yi.Char.Unicode's mapping? Probably
not, since you would have to evaluate the Strings/Chars.)

-- 
gwern

-- 
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel

Reply via email to