[Haskell-cafe] Re: Coding conventions for Haskell?

Maciej Piechotka uzytkownik2 at gmail.com
Sun Sep 26 12:25:11 EDT 2010


On Sun, 2010-09-26 at 11:40 +0200, Petr Pudlak wrote:
> Hi Johan,
> 
> On Sat, Sep 25, 2010 at 01:44:07PM +0200, Johan Tibell wrote:
> >Quite a few people follow my style guide
> >
> >    http://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
> >
> >which codifies the style used in Real World Haskell, bytestring, text,
> >and a few other libraries.
> 
> Thanks for sharing the link, it's quite helpful. It's just what I was 
> looking for. 
> 
> One more thought: Do you also have some recommendations for formatting 
> 'let ... in ...' expressions?
> 
>       Best regards,
>       Petr

I use it in following way;

1. For short sharing name (rarely)

    let a = b ++ c in (a, a) 

2. Default

    let a :: [Int]
        a = b ++ c
        f :: Int -> String
        f 0 = ""
        f x = show x
    in map f a

Regards
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100926/92d26750/attachment.bin


More information about the Haskell-Cafe mailing list