haskell / stylish-haskell

Haskell code prettifier
Other
986 stars 150 forks source link

Fully support base-unicode-symbols #93

Open langston-barrett opened 9 years ago

langston-barrett commented 9 years ago

As a part of the Unicode support feature, I propose that stylish-haskell could support the functions in base-unicode-symbols.

Related code is in this file.

Related to #3 and #81.

I'd be interested in helping out, but I can't really understand the code in that file.

MrDetonia commented 8 years ago

I'd like to see this also. The mentioned code is now in this file.

It seems currently only converting :: => and -> will work, and they only seem convert in type signatures for me. Example below:

getPort ∷ SvHashTable → Server → IO (Maybe Port)
getPort ht sv = do
  se <- H.lookup ht sv
  case se of
       Nothing           -> return Nothing
       Just (port,_,_,_) -> return $ Just port

Could we get more conversions and more detection?

langston-barrett commented 8 years ago

@MrDetonia I think you're talking about the UnicodeSyntax language extension in #3, rather than the base-unicode-symbols package mentioned in this issue.

jaspervdj commented 8 years ago

I prefer to have something that works without extra dependencies, so I'd rather just have very good UnicodeSyntax support.

langston-barrett commented 8 years ago

@jaspervdj Maybe this could be an optional feature, disabled by default, like UnicodeSyntax?

id-ekaagr commented 2 years ago

stylish haskell is even replacing unicode with ASCII characters on it's own (with UnicodeSyntax pragma on).

example :

data Maybes a where
Nothings ∷ Maybes a
Justs ∷ a -> Maybes a

converts to

data Maybes a where
Nothings :: Maybes a
Justs :: a -> Maybes a

makes it impossible to deal with.