
Hello Haskellers, what about insert haskell code as DSL in haskell program? as an example, in ghci:
eval [haskell| tail [0,1,2,3]|] [1,2,3]
as intermediate step to get an interactive word-based italian translation of haskell:
eval [italian| coda [0,1,2,3]|] [1,2,3]
I'm an italian primary school teacher and I would like to introduce my schoolchildren to FP using haskell... Thank you very much, see You son. Rosario

On 20/03/14 19:50, Rosario Borda wrote:
Hello Haskellers, what about insert haskell code as DSL in haskell program? as an example, in ghci:
eval [haskell| tail [0,1,2,3]|] [1,2,3]
as intermediate step to get an interactive word-based italian translation of haskell:
eval [italian| coda [0,1,2,3]|] [1,2,3]
I'm an italian primary school teacher and I would like to introduce my schoolchildren to FP using haskell...
Thank you very much, see You son. Rosario
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
What's wrong with making something like Prelude.Italian which re-exports the common functions under their Italian equivalents? It'd just contain things like coda = tail … Isn't this much easier than messing with Template Haskell and effectively achieving the same thing? Maybe there's something I'm missing here. -- Mateusz K.

Thank You,
but are the keywords of haskell translatable using the "function" approach
suggested (case, of - data - ...)?
Rosario
2014-03-21 17:59 GMT+01:00 Kim-Ee Yeoh
On Fri, Mar 21, 2014 at 3:17 AM, Mateusz Kowalczyk < fuuzetsu@fuuzetsu.co.uk> wrote:
What's wrong with making something like Prelude.Italian which re-exports the common functions under their Italian equivalents?
Yes, a Prelude with Italian names is a great idea!
-- Kim-Ee
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners

On 22/03/14 17:15, Rosario Borda wrote:
Thank You, but are the keywords of haskell translatable using the "function" approach suggested (case, of - data - ...)?
Rosario
2014-03-21 17:59 GMT+01:00 Kim-Ee Yeoh
: On Fri, Mar 21, 2014 at 3:17 AM, Mateusz Kowalczyk < fuuzetsu@fuuzetsu.co.uk> wrote:
What's wrong with making something like Prelude.Italian which re-exports the common functions under their Italian equivalents?
Yes, a Prelude with Italian names is a great idea!
-- Kim-Ee
No, they aren't but considering how few keywords Haskell has, this shouldn't be a problem and your students would learn some Haskell rather than some Template Haskelled wrapper around it which they can't relate to when they go and look stuff up. case of data newtype module if then else class type do where let newtype instance import qualified as hiding pattern proc That's just about it and you won't be using all of these at once either. If you really want to go with ‘translate everything’ approach, what are you going to do about error messages? Even if you alias the used built-in types, GHC will still often strip the alias. I understand translating some function names because there are many functions and it's easier to remember what it does if it's a word you know, but I think going beyond that is going to be harmful in a long run. If you want to introduce your students to FP using Haskell then please use Haskell! Using TH to hide Haskell seems counter-intuitive. I'm sceptic whether the word ‘instance’ or ‘module’ will mean anything more to young students whether it's in English or Italian. -- Mateusz K.

On Sun, Mar 23, 2014 at 12:37 AM, Mateusz Kowalczyk wrote: If you really want to go with 'translate everything' approach, what are
you going to do about error messages? That's a good point. A fully language-native Haskell environment seems to
be sought-after here, and that's a major undertaking.
TH, if anything, could blow up with even more error messages when fed
slightly off syntax. These are primary schoolchildren, yes?
To summarize, the choices available include:
1. nativize Prelude, let children grapple with English keywords
2. use sed scripts or some editor feature to translate italian .ihs to .hs
before feeding into interpreter/compiler.
3. nativize Prelude & keywords by recompiling with necessary tweaks to the
keyword table. But errors still in English tho.
4. full i18n
If GHC isn't a must, option 3 just might be a 10-minute job for hugs.
-- Kim-Ee

Thank You so much for yours replies.
1. Very simple and promising. However an interesting feature of Haskell is
its proximity to the natural language, especially from an educational point
of view. Many important keywords (if then else, case of, type, do, where
...) aren't translatable in this approach.
2. Very interesting. Perhaps it would need a compiler, rather than a
translation "words based"?
3. I followed this path with ghc, duplicating keywords to maintain
compatibility with external modules. Many modules compiled, but not all due
to words conflict.
4. I don't know how, any reference for Haskell?
A DSL choice allow to import external modules and isolate italian code. I
was wondering if there is an approach that allow to utilize the code of ghc
compiler for a DSL.
Many thanks for yours much appreciated help.
Rosario
2014-03-22 18:56 GMT+01:00 Kim-Ee Yeoh
On Sun, Mar 23, 2014 at 12:37 AM, Mateusz Kowalczyk < fuuzetsu@fuuzetsu.co.uk> wrote:
If you really want to go with 'translate everything' approach, what are you going to do about error messages?
That's a good point. A fully language-native Haskell environment seems to be sought-after here, and that's a major undertaking.
TH, if anything, could blow up with even more error messages when fed slightly off syntax. These are primary schoolchildren, yes?
To summarize, the choices available include:
1. nativize Prelude, let children grapple with English keywords
2. use sed scripts or some editor feature to translate italian .ihs to .hs before feeding into interpreter/compiler.
3. nativize Prelude & keywords by recompiling with necessary tweaks to the keyword table. But errors still in English tho.
4. full i18n
If GHC isn't a must, option 3 just might be a 10-minute job for hugs.
-- Kim-Ee
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
participants (3)
-
Kim-Ee Yeoh
-
Mateusz Kowalczyk
-
Rosario Borda