Ticket #1103: CJK.hs

File CJK.hs, 0.8 KB (added by humasect, 5 years ago)

Her is an idea/proposal for some kind of simple extension to also allow backward-compatible "international" source code. Multilingual language ?

Line 
1{-# OPTIONS_GHC -futf16-string-defines #-}
2
3{-
4Two ideas for Unicode human language support in GHC
5-}
6
7module CJK where
8
9import Control.Monad
10import System.IO
11
12-- Method 1, string preprocessing
13
14#string 倉換 Translation
15#string 単子 Monad
16#string システム System
17#string コントロヌル Control
18#string むンポヌト import
19
20#string ã€‚ .
21#string 「 [
22#string 」 ]
23
24-- Method 2, module symbol exosure. One could translate any syntax any number of ways then.
25
26foreign export utf16 "単子" Monad
27foreign export utf16 "マップ" map
28foreign export utf16 "おすず" Test 
29
30-- If using the first method of preprocessing, perhaps an option to GHC for basic translate:
31--
32-- ghc -ddump-utf16 CJK.hs
33--
34-- which makes CJK_utf16.hs
35--
36
37-- If using the second method of foriegn exports,
38--
39-- ..then would ghc --dump-foreign need to respect this also?
40--