Re: public/private module sections

2006-02-27 Thread Marcin 'Qrczak' Kowalczyk
"Claus Reinke" <[EMAIL PROTECTED]> writes: > you mean as in "public static void main(String[] args) { ..}" > instead of "main args = .."?-) there are such languages, and > I'm happy to say Haskell isn't one of them! In my language Kogut the default everywhere (modules, objects) is public. I don't

Re: public/private module sections

2006-02-24 Thread Lennart Augustsson
In Cayenne it's: public foldr:: (a -> b -> b) -> b -> [a] -> b foldr f z [] = z foldr f z (x:xs) = f x (foldr f z xs) And I quite like it. :) -- Lennart Jared Updike wrote: And this public foldr:: (a -> b -> b) -> b -> [a] -> b public foldr f z [] =

Re: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread John Meacham
what about method and data constructors? data public: Foo a = private: Bob | public: Baz class Foo a where private: foo :: a public: baz :: a I really like haskell's current module system. A whole lot. other than the minor tweaks that have been mentioned. A reall

Re: public/private module sections

2006-02-24 Thread Ketil Malde
[EMAIL PROTECTED] writes: > In my personal experience, I have three kinds of Haskell modules: > > 1. Exporting everything > 2. Exporting almost everything > 3. Having a designed export interface I tend to start out exporting everything, which I find useful for testing the internals, and so

Re: Re[2]: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Jared Updike
And this public foldr:: (a -> b -> b) -> b -> [a] -> b public foldr f z [] = z public foldr f z (x:xs) = f x (foldr f z xs) or is it public foldr:: (a -> b -> b) -> b -> [a] -> b foldr f z [] = z foldr f z (x:xs) = f x (foldr f z xs) and now things aren't lin

Re[2]: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Bulat Ziganshin
Hello Claus, Friday, February 24, 2006, 7:53:09 PM, you wrote: CR> public class C a CR> where CR> public m1 :: a CR> private m2 :: a -> String please don't stop on this! public map (private f) (public (private x:public xs)) = private (public f (private x)) `public :` p

Re[2]: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Bulat Ziganshin
Hello Claus, Friday, February 24, 2006, 6:55:51 PM, you wrote: CR> not quite (though I believe that would be close to Simon M's idea). CR> in my modification, both map and length would move completely CR> into the export section WHY? it's not the interface. implementation of exported functions

Re: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Claus Reinke
> > i personally prefer to have > > public/private modifiers on each function and gather interface > > documentation by tools like haddock > Me too. having to type one of "public" or "private" at each function site would get really tedious... you mean as in "public static void main(String[] a

Re: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread kahl
Bulat.Ziganshin responded to Claus Reinke: > > CR> yes, this would add one constraint on where to place definitions. but > CR> grouping logically related definitions together is not quite what one > CR> might think anyway: aren't the definitions making up the interface > CR> most strongly re

Re: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Sebastian Sylvan
On 2/24/06, Benjamin Franksen <[EMAIL PROTECTED]> wrote: > On Friday 24 February 2006 16:38, Bulat Ziganshin wrote: > > i personally prefer to have > > public/private modifiers on each function and gather interface > > documentation by tools like haddock > > Me too. > Maybe if you only had to spec

Re: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Benjamin Franksen
On Friday 24 February 2006 16:38, Bulat Ziganshin wrote: > i personally prefer to have > public/private modifiers on each function and gather interface > documentation by tools like haddock Me too. Ben ___ Haskell-prime mailing list Haskell-prime@haskel

Re: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Claus Reinke
so: not quite (though I believe that would be close to Simon M's idea). in my modification, both map and length would move completely into the export section, length# would stay in the local section. both sections would just be module s., containing full definitions, declarations, imports. to e

Re: public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Bulat Ziganshin
Hello Claus, Friday, February 24, 2006, 2:46:40 PM, you wrote: CR> yes, this would add one constraint on where to place definitions. but CR> grouping logically related definitions together is not quite what one CR> might think anyway: aren't the definitions making up the interface CR> most stron

public/private module sections (was: Haskell-prime Digest, Vol 2, Issue 58)

2006-02-24 Thread Claus Reinke
I feel unkeen. you will notice that I haven't actually proposed adopting this (yet:-); neither did Simon M for his original version. so far, I had thought Haskell's export/import language quite limited, but useable and simple. so apart from fixing the asymmetries between export and import, and a

Re: public/private module sections (was Re[2]: Export lists in modules)

2006-02-23 Thread Claus Reinke
let's go through 5.2 "Export Lists" to see what would be missing if we tried to replace the export list with a separation of a module into a public (exported) and a private (local) part: --- module M exports where -- 1. "value, field name, or c

Re: public/private module sections (was Re[2]: Export lists in modules)

2006-02-23 Thread Bulat Ziganshin
Hello Claus, Thursday, February 23, 2006, 9:48:03 PM, you wrote: CR> if you'd go one step further, you'd replace the public/private modifiers CR> with public/private module sections. I don't like the modifiers, and I'm CR> uncertain about the intermediate form you

public/private module sections (was Re[2]: Export lists in modules)

2006-02-23 Thread Claus Reinke
?-) if you'd go one step further, you'd replace the public/private modifiers with public/private module sections. I don't like the modifiers, and I'm uncertain about the intermediate form you suggested, but I might be able to live with two-section modules: nothing is duplicate