Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: suggestions for code improvement (Kim-Ee Yeoh)
2. Re: Haskell code as DSL (Rosario Borda)
3. Re: Haskell code as DSL (Mateusz Kowalczyk)
4. Re: Haskell code as DSL (Kim-Ee Yeoh)
5. Re: Haskell code as DSL (Rosario Borda)
6. Re: Implement semantic editor combinators (Javran Cheng)
----------------------------------------------------------------------
Message: 1
Date: Sat, 22 Mar 2014 22:32:37 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] suggestions for code improvement
Message-ID:
<capy+zdrcwna2uj5ackriwcswaecfaa1dos8agyhuup9yawg...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
On Fri, Mar 21, 2014 at 8:22 AM, Dennis Raddle <[email protected]>wrote:
> This is a fairly complex problem
I'm sure you're right about this.
> and I don't expect anyone to follow it all, but I thought I would just
> post it and see if anyone can immediately identify unidiomatic Haskell.
Have you run it through hlint? What does it say? Let us know if there's
anything in hlint's output that's befuddling -- treat it more as a syntax
h(l)inter than a syntax (h)linter.
p.s. A note about exposition: consider providing some input & output
examples to illustrate what these functions are up to. The preceding
paragraphs indicate twisty exceptions and special cases that are hard-going
for the casual reader. Which means fewer eyeballs on your email.
p.p.s. Are there any interesting properties of these functions that you
could leverage quickcheck on?
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140322/0a349ad9/attachment-0001.html>
------------------------------
Message: 2
Date: Sat, 22 Mar 2014 18:15:37 +0100
From: Rosario Borda <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Haskell code as DSL
Message-ID:
<cabq_edujtn+byagk6c-qa54mix5swtcj38n+gvkx_bep59e...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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 <[email protected]>:
>
> On Fri, Mar 21, 2014 at 3:17 AM, Mateusz Kowalczyk <
> [email protected]> 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
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140322/edf55442/attachment-0001.html>
------------------------------
Message: 3
Date: Sat, 22 Mar 2014 17:37:23 +0000
From: Mateusz Kowalczyk <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Haskell code as DSL
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
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 <[email protected]>:
>
>>
>> On Fri, Mar 21, 2014 at 3:17 AM, Mateusz Kowalczyk <
>> [email protected]> 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.
------------------------------
Message: 4
Date: Sun, 23 Mar 2014 00:56:36 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Haskell code as DSL
Message-ID:
<CAPY+ZdTqybCvEYK=c5cd2_mtzlxpg+3hvqoup1u4ut5karq...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
On Sun, Mar 23, 2014 at 12:37 AM, Mateusz Kowalczyk <[email protected]
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140323/5a068f51/attachment-0001.html>
------------------------------
Message: 5
Date: Sat, 22 Mar 2014 21:38:43 +0100
From: Rosario Borda <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Haskell code as DSL
Message-ID:
<cabq_edvha7akyxdnakgfqbldoydlej_c3rtjuujswbvr66f...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
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 <[email protected]>:
>
> On Sun, Mar 23, 2014 at 12:37 AM, Mateusz Kowalczyk <
> [email protected]> 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
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20140322/0af9f19c/attachment-0001.html>
------------------------------
Message: 6
Date: Sun, 23 Mar 2014 01:51:32 -0400
From: Javran Cheng <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Implement semantic editor combinators
Message-ID:
<CA+TfdNYGLFqDErQH83PxyGHutqrhzW05QBG1NaU=gjpklov...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
On Fri, Mar 21, 2014 at 6:19 PM, Kim-Ee Yeoh <[email protected]> wrote:
>
> On Fri, Mar 21, 2014 at 6:31 PM, Javran Cheng <[email protected]> wrote:
>>
>> Hope you enjoy it and please feel free to give me comments and
>> indicate my misconceptions.
>
>
> A couple of things come to mind: you could
>
> * Ping @conal whether via email or twitter -- he's very friendly and likes
> helping students. And since you worked hard at one of his blog entries, you
> just might make his day! (I could also introduce you to him -- just ask.)
>
I'll absolutely do that!
> * Have you looked at the lens library? What would the code look like using
> lenses instead of SECs? A comparison would reveal tons of insights -- please
> blog and share for everyone!
>
I tried lens few days ago to rewrite my code about "invertible functions",
and to my surprise the translation was just a word-by-word conversion:
https://gist.github.com/Javran/9593215
Also thanks for pointing me the idea of making comparison between lens
and SEC, I'll try to play with it and see if I can extend my knowledge
about it.
>
> -- Kim-Ee
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
--
Javran (Fang) Cheng
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 69, Issue 35
*****************************************