2009/5/25 Jean-Philippe Bernardy <[email protected]>:
>
> On Mon, May 25, 2009 at 4:09 PM, Deniz Dogan <[email protected]>
> wrote:
>>
>> 2009/5/25 [email protected] <[email protected]>:
>>>
>>> My custom yi.hs below, which I release into the public domain, applies
>>> the f (g x) --> f $ g x code transformation (which I call "dollarify")
>>> to the parenthesised expression at the point, or the selected syntax
>>> tree node (e.g. select a do block and it will try to dollarify each
>>> line).
>>
>> This is super cool! I hope to see more of this in Yi, maybe for the
>> JavaScript mode some day? ;)
>>
>
> It is indeed awesome :). I hope to find some time to integrate (at
> list part of) this
> in the Haskell mode, if Anders does not beat me to it.
>
> Thanks a lot!
> -- JP
Inspired by this patch, I think it would be really awesome if someone
wrote some generic "code sorting" functionality for the Haskell mode,
which could e.g. sort function declarations and such.
Examples of use:
g y =
if y > 0
then 1
else 3
f x = x * 2
abc a b c = c b a
...then running the sorter on these lines results in...
abc a b c = c b a
f x = x * 2
g y =
if y > 0
then 1
else 3
Another example:
data A = B Hello | A Int | D String | C
deriving (Typeable, Show, Eq)
...then running the sorter on those two lines results in...
data A = A Int | B Hello | C | D String
deriving (Eq, Show, Typeable)
(Sorting both the constructors and the derived instances!)
--
Deniz Dogan
--~--~---------~--~----~------------~-------~--~----~
Yi development mailing list
[email protected]
http://groups.google.com/group/yi-devel
-~----------~----~----~----~------~----~------~--~---