Is 78 characters still a good option? Was: [Haskell-cafe] breaking too long lines

Daniel Fischer daniel.is.fischer at web.de
Sat Apr 25 04:51:48 EDT 2009


Am Samstag 25 April 2009 08:48:16 schrieb Thomas Davie:
> On 24 Apr 2009, at 14:37, Loup Vaillant wrote:
> > 2009/4/23 Miguel Mitrofanov <miguelimo38 at yandex.ru>:
> >> On 23 Apr 2009, at 12:17, Thomas Davie wrote:
> >>> Haskell is a very horizontal language, and to limit our horizontal
> >>> space
> >>> seems pretty weird.
> >>
> >> +1. I sometimes use lines up to 200 characters long, when I feel
> >> they would
> >> be more readable.
> >
> > 200 sounds awfully long. Do you have any example?
>
> Sure...
>
> arrow :: forall (~>) b c d e. ( Arrow (~>), Show (d ~> e), Show (c ~>
> d), Show (b ~> c), Show b, Show c, Show d, Show e, Arbitrary (d ~> e),
> Arbitrary (c ~> d), Arbitrary (b ~> c), Arbitrary b, Arbitrary c,
> Arbitrary d, Arbitrary e, EqProp (b ~> e), EqProp (b ~> d), EqProp
> ((b,d) ~> c), EqProp ((b,d) ~> (c,d)), EqProp ((b,e) ~> (d,e)), EqProp
> ((b,d) ~> (c,e)), EqProp b, EqProp c, EqProp d, EqProp e) => b ~>
> (c,d,e) -> TestBatch
>
>  >.>
>
> In all seriousness though, that one got broken, but I do find that I
> occasionally have lines around 100 characters that just look silly if
> I break them, this is a good example:
>
>              filterNonRoots (GCase e bs    ) = filter ((/= e) <^(&&)^>
> (not . (`elem` bs)))

Not that I'd deny that it can sometimes be more readable to have longer lines*, but in 
this example, would

              filterNonRoots (GCase e bs    ) 
                  = filter ((/= e) <^(&&)^> (not . (`elem` bs)))

be any less readable in your opinion?

[*] but I think 200 characters is beyond the limit
>
> Bob



More information about the Haskell-Cafe mailing list