Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible imports and impossible stuff #40

Open
kanashimia opened this issue Jan 28, 2020 · 0 comments
Open

Flexible imports and impossible stuff #40

kanashimia opened this issue Jan 28, 2020 · 0 comments

Comments

@kanashimia
Copy link

This:

hmm better
import           Control.Concurrent.Async
import           Graphics.Rendering.OpenGL
import           Graphics.UI.GLUT
-- same imports, but with qualified import Control.Concurrent.Async import Graphics.Rendering.OpenGL import qualified Graphics.UI.GLUT
import Control.Concurrent.Async
import Graphics.Rendering.OpenGL
import Graphics.UI.GLUT
-- same imports, but with qualified import Control.Concurrent.Async import Graphics.Rendering.OpenGL import qualified Graphics.UI.GLUT
createWindowAndStuff title = do
    createWindow title
    windowSize $= Size 800 500
    displayCallback $= displaySomething
      
createWindowAndStuff title = do
    createWindow title
    windowSize      $= Size 800 500
    displayCallback $= displaySomething
      
somePoints :: [(Float, Float)]
somePoints = [ (-0.25, 0.25)
             , (0.75, 0.35)
             , (0.75, -0.15)
             , (-0.75, -0.25)
             , (0.75, 0.35)
             , (0.75, -0.15)
             , (-0.75, -0.25)
             ]
      
somePoints :: [(Float, Float)]
somePoints = [ (-0.25,  0.25)
             , ( 0.75,  0.35)
             , ( 0.75, -0.15)
             , (-0.75, -0.25)
             , ( 0.75,  0.35)
             , ( 0.75, -0.15)
             , (-0.75, -0.25)
             ]
      
somePoints :: [(Float, Float)]
somePoints = [ (-0.25, 0.25) :: (Float, Float)
             , (0.75, 0.35) :: (Float, Float)
             , (0.75, -0.15) :: (Float, Float)
             , (-0.75, -0.25) :: (Float, Float)
             , (0.75, 0.35) :: (Float, Float)
             , (0.75, -0.15) :: (Float, Float)
             , (-0.75, -0.25) :: (Float, Float)
             ]
      
somePoints :: [(Float, Float)]
somePoints = [ (-0.25, 0.25)  :: (Float, Float)
             , (0.75, 0.35)   :: (Float, Float)
             , (0.75, -0.15)  :: (Float, Float)
             , (-0.75, -0.25) :: (Float, Float)
             , (0.75, 0.35)   :: (Float, Float)
             , (0.75, -0.15)  :: (Float, Float)
             , (-0.75, -0.25) :: (Float, Float)
             ]
      

Imports one would be very easy to implement - others are very tricky, especially considering that it should work for any lists and data constructors.

That one in the do expression should be configurable for each operator like (<-,$...).

There is extension with similar alignment functionality for vs code.



-- I don't really know any formatter that does this, so this isn't world's first feature by any means.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants