[Haskell-cafe] Re: Haskell and OS X

Stefan Monnier monnier at iro.umontreal.ca
Fri Oct 21 11:22:40 EDT 2005


> I don't think it's so much bugs as it's funky indentation :-). For
> example...

> data TableInfo = TableInfo {
>                              avgPot :: Double,

> I would have preferred not to offset the fields from the brace but I don't
> know how to change this and maybe I'm going against standard Haskell
> style here.

You mean you'd like

 data TableInfo = TableInfo {
                            avgPot :: Double,

?  That'd look odd to me, but to each his own.  I don't know what's
"standard Haskell style" here, but since it'd look odd to me, I guess it's
indeed not very standard.  In such a case I wouldn't consider it a bug (I
do want the indentation code to allow the use of various styles, but only
those styles that are "standard".  I think variety in indentation style is
detrimental to the readability of a language).

>      case findprop attr props of
>                               Just x -> x

> seems like a lot of space is wasted by hanging the Just from the of.

Indeed.  I've added this case to indent.hs.  Hopefully I'll get to fix it
before the next release.  Note that the second choice offered is

      case findprop attr props of
      Just x -> x

which is much better.  I'd personally prefer

      case findprop attr props of
        Just x -> x

but I haven't coded it yet.

> Try this to see that you cannot indent "something here" at the same  level
> as let.

> main = do let foo = 10
>                bar = 20
>                something here

Yes, this one is a known bug, and I haven't tried fixing it yet.


        Stefan


More information about the Haskell-Cafe mailing list