Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-05 Thread Ketil Malde
Isaac Dupree writes: My proposal: >> A module may be defined in a file with a name corresponding to the >> module name, or any dot-separated prefix of it. I.e. the file >> Foo/Bar.hs will define module Foo.Bar and optionally Foo.Bar.Baz as >> well. > Note though, that local modules tempt us to

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-04 Thread Miguel Mitrofanov
On 4 Jan 2009, at 07:11, Thomas DuBuisson wrote: My proposal would be for each selector name to be a special type of "phantom" type class (existing in the intermediate language only). This type class would not be accessible by the programmer and thus s/he couldn't make a polymorphic function fo

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-03 Thread Thomas DuBuisson
Cafe, I was going to write about this earlier, but I'm so ill read on the record selector papers that I deleted the draft. My proposal would be for each selector name to be a special type of "phantom" type class (existing in the intermediate language only). This type class would not be accessible

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-03 Thread Isaac Dupree
Ketil Malde wrote: > A module may be defined in a file with a name corresponding to the > module name, or any dot-separated prefix of it? I.e. the file > Foo/Bar.hs will define module Foo.Bar and optionally Foo.Bar.Baz as > well? > > GHC should then be able to find it, and I believe it already has

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-03 Thread Ketil Malde
Isaac Dupree writes: > Derek Elkins wrote: >> I haven't been able to find any semantic difficulties with this >> addition. > I like it too... what I run into is that there's an implicit > assumption that module of name Foo.Bar.Baz *must* be found in a file > Foo/Bar/Baz.[l]hs . Ah, surely mer

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Henning Thielemann
Miguel Mitrofanov schrieb: > module Element where > import QName > import ... > data Element = Element {name :: QName, attribs :: [Attr], content :: > [Content], line :: Maybe Line} > > module Attr where > import QName > import ... > data Attr = Attr {key :: QName, val :: String} > > module QNam

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Isaac Dupree
Derek Elkins wrote: I haven't been able to find any semantic difficulties with this addition. I like it too... what I run into is that there's an implicit assumption that module of name Foo.Bar.Baz *must* be found in a file Foo/Bar/Baz.[l]hs . "module Main" seems to be the only one exempted

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Jonathan Cast
On Fri, 2009-01-02 at 23:48 +0300, Miguel Mitrofanov wrote: > >> > >> module Main where > >> import qualified QName as Q > >> import qualified Element as E > >> ... Q.name ... E.name ... > > > > I'm using this pattern of writing code and, so far, I find it very > > convenient. Yet, the code is like

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Miguel Mitrofanov
module Main where import qualified QName as Q import qualified Element as E ... Q.name ... E.name ... I'm using this pattern of writing code and, so far, I find it very convenient. Yet, the code is likely to be spread across lots of files, which is not always a Good Thing. That's a completely

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Derek Elkins
On Fri, 2009-01-02 at 15:20 +0100, Felix Martini wrote: > Hi all, > > There is currently a discussion on reddit/programming about Haskell. > One complaint is that Haskell functions often use abbreviated names. I > tend to agree with that. In my personal experience it generally takes > more time to

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Cristiano Paris
On Fri, Jan 2, 2009 at 9:21 PM, Miguel Mitrofanov wrote: > module Element where > import QName > import ... > data Element = Element {name :: QName, attribs :: [Attr], content :: > [Content], line :: Maybe Line} > > module Attr where > import QName > import ... > data Attr = Attr {key :: QName, va

Re: [Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Miguel Mitrofanov
module Element where import QName import ... data Element = Element {name :: QName, attribs :: [Attr], content :: [Content], line :: Maybe Line} module Attr where import QName import ... data Attr = Attr {key :: QName, val :: String} module QName where import ... data QName = QName {name :: S

[Haskell-cafe] Use of abbreviations in Haskell

2009-01-02 Thread Felix Martini
Hi all, There is currently a discussion on reddit/programming about Haskell. One complaint is that Haskell functions often use abbreviated names. I tend to agree with that. In my personal experience it generally takes more time to learn a third party Haskell library than libraries written in other