×
all 15 comments

[–]Paczesiowa 5 points6 points  (1 child)

there are many ideas like this, types can help editors too! eg.

case x of
    Just n  -> n
    Nothing -> 0*

* - you are here

thanks to knowing the type of x, editor should know that there is one less possibility to indent code on the next line (there are no other constructors).

[–][deleted] 0 points1 point  (0 children)

Well of course! Maybe the idea should be "let GHC talk to the coding environment and vice-versa".

But is it a realistic proposition?

[–]Aviator 1 point2 points  (2 children)

An expression may contain subexpressions. How do you color this:

ord 'a'

The whole expression evaluates to an Int, but there are two subexpressions function and Char.

[–][deleted] 0 points1 point  (0 children)

Perhaps by colouring atoms and additionally anything in parenthesis, either by highlight/background or just colouring the brackets themselves.

[–][deleted]  (5 children)

[deleted]

    [–][deleted] 1 point2 points  (4 children)

    It's been a while since I proposed this! I saw that Visual Haskell now does something similar and automatically puts in an inferred type signature. Funnily enough I'd rather die than use visual studio and I'm afraid vi is the best I can do as far as editing is concerned. Ideally this would go into leksah or yi (which have modes for vi and emacs AFAIK). Do you find it a good feature in emacs?

    [–][deleted]  (1 child)

    [deleted]

      [–][deleted] 0 points1 point  (0 children)

      Fairly similarly, but without the integration, I'm side by side with a GHCi window all the time hitting :r and then :t'ing things when I need to. I also spend a lot of time on hoogle because invariably the function I want to write is in a standard library (hooray for searching by type).

      [–]Phyx 0 points1 point  (1 child)

      It's important to understand that while Visual Haskell is build on top of Visual Studio it's build on top of the Shell, and that's about it. This basically provides provisions for basic tasks, but the rest is part of the language service "Haskell". I don't know to what end you hate visual studio but there are also vi bindings for it.

      Anyway, If there's a specific gripe you might have which can be adressed in the language service, I'd be happy to see if I can't plan a fix in.

      [–][deleted] 0 points1 point  (0 children)

      Thanks for the offer but I can't even run visual studio here.

      [–][deleted] 0 points1 point  (1 child)

      I think this sounds like a really cool idea, if it can be done in a way that is meaningful and simple enough to follow.

      [–][deleted] 0 points1 point  (0 children)

      That it would need to be KISS goes without saying. It would be an aid to comprehension after all.

      [–]mmaruseacph2 0 points1 point  (4 children)

      Sounds very cool. Maybe create an IDE like drScheme which will colour an expression if the user is at it's enclosing paranthesis, otherwise will default to colouring the smallest subexpressions (atoms).

      [–][deleted] 0 points1 point  (3 children)

      Wouldn't this be great? Now if only someone with some sort of standing in the haskell community would submit it for GSOC.

      [–]mmaruseacph2 0 points1 point  (2 children)

      Why don't you propose it?:P

      [–][deleted] 1 point2 points  (1 child)

      Fine so! But It'll be on your head when they make fun of me and say I don't know a catamorphism from an endofunctor.

      edit: registration is broken(?), will try again tomorrow

      [–]mmaruseacph2 0 points1 point  (0 children)

      As far as I know, it will open on 29th but you may ask for feedback until then on #haskell and r/haskell