| 1 | {-# OPTIONS_GHC -futf16-string-defines #-} |
|---|
| 2 | |
|---|
| 3 | {- |
|---|
| 4 | Two ideas for Unicode human language support in GHC |
|---|
| 5 | -} |
|---|
| 6 | |
|---|
| 7 | module CJK where |
|---|
| 8 | |
|---|
| 9 | import Control.Monad |
|---|
| 10 | import 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 | |
|---|
| 26 | foreign export utf16 "åå" Monad |
|---|
| 27 | foreign export utf16 "ããã" map |
|---|
| 28 | foreign 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 | -- |
|---|