[Haskell-cafe] Compilation issue with GHC 6.10.1 on Vista

2008-11-11 Thread Alexey Romanov
I'm trying to update FreshLib
<http://homepages.inf.ed.ac.uk/jcheney/programs/freshlib/> to work
with the current GHC version.
Now it works fine in GHCi, but trying to compile with ghc --make gives
this result:

[1 of 5] Compiling NominalBase  ( NominalBase.hs, NominalBase.o )
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
Loading package syb ... linking ... done.
Loading package base-3.0.3.0 ... linking ... done.
Loading package array-0.2.0.0 ... linking ... done.
Loading package packedstring-0.1.0.1 ... linking ... done.
Loading package containers-0.2.0.0 ... linking ... done.
Loading package pretty-1.0.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package bytestring-0.9.1.4 ... linking ... done.
Loading package syb-with-class-0.4 ... linking ... done.
C:\Users\Alexey\AppData\Local\Temp\/ghc1892_0/ghc1892_0.s: Assembler messages:
C:\Users\Alexey\AppData\Local\Temp\/ghc1892_0/ghc1892_0.s:557: Error: symbol `_N
ominalBase_zdgtoName_closure' is already defined
C:\Users\Alexey\AppData\Local\Temp\/ghc1892_0/ghc1892_0.s:585: Error: symbol `_N
ominalBase_zdgtoName_info' is already defined
C:\Users\Alexey\AppData\Local\Temp\/ghc1892_0/ghc1892_0.s:637: Error: symbol `_N
ominalBase_zdgfromName_closure' is already defined
C:\Users\Alexey\AppData\Local\Temp\/ghc1892_0/ghc1892_0.s:665: Error: symbol `_N
ominalBase_zdgfromName_info' is already defined

Yours, Alexey Romanov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What I wish someone had told me...

2008-10-14 Thread Alexey Romanov
On Tue, Oct 14, 2008 at 9:15 PM, John Lato <[EMAIL PROTECTED]> wrote:
> Are you advocating introducing existential types to beginning
> Haskellers?  I think something with the scary name "existential
> quantification" would greatly increase the head'splodin' on the
> learnin' slope.  Certainly there's a place for them, but I wouldn't
> want to see new Haskell programmers habitually approach problems with
> a "first create a type class, then make an existential wrapper"
> mentality.  Which is exactly what I fear is the current situation.

I don't think this is the current situation at all. For one, the
beginning Haskellers do
_not_ learn about existential types.

Yours, Alexey Romanov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What I wish someone had told me...

2008-10-14 Thread Alexey Romanov
On Tue, Oct 14, 2008 at 9:14 PM, Jonathan Cast
<[EMAIL PROTECTED]> wrote:
> On Tue, 2008-10-14 at 18:15 +0100, John Lato wrote:
>> Are you advocating introducing existential types to beginning
>> Haskellers?  I think something with the scary name
>
> Invalid argument.
>
>> "existential
>> quantification" would greatly increase the head'splodin' on the
>> learnin' slope.
>
> Invalid argument.  Head explosion is the *goal* of teaching Haskell.

Is it? I would certainly prefer my students to say "This is obvious. Why would
things work in any other way?" They don't, but I can dream.

>> Certainly there's a place for them, but I wouldn't
>> want to see new Haskell programmers habitually approach problems with
>> a "first create a type class, then make an existential wrapper"
>> mentality.
>
> Of course not.  That's just translating OO into Haskell.  Personally, I
> would avoid comparing Haskell to other language at all (SOE I believe
> takes this approach).
>
> jcc

I find such comparisons pretty useful.

Yours, Alexey Romanov
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] What I wish someone had told me...

2008-10-14 Thread Alexey Romanov
Well, they act like interfaces in argument types, just not variable or
return types.

Yours, Alexey Romanov



On Tue, Oct 14, 2008 at 4:11 PM, John Lato <[EMAIL PROTECTED]> wrote:
> I was just thinking about what I wish someone had told me when I
> started working with Haskell (not that long ago).  It would have saved
> me a great deal of trouble.
>
> The Difference Between Interfaces and Type Classes.
>
> Many "Introduction to Haskell for the OOper" style tutorials claim
> that type classes are like Interfaces (for languages with that
> feature).  I now think that, although this is technically true, it's
> fundamentally misleading.  Here's a simple example demonstrating my
> line of thought:
>
> In C# (and presumably Java), this sort of function is common:
> public IList GetListOfData()
>
> In Haskell, a similar function may be
> GetListOfData :: (Foldable a, Indexable a) => IO a
>
> In C#, it doesn't matter what the actual type returned by
> GetListOfData is, as long is it supports the IList interface.  It's
> not uncommon for GetListOfData to make a choice between several
> different implementations, depending on the nature of the data to be
> returned.  The following code is perfectly reasonable in C# :
>
> // List and MyList are different classes
> if (something) { return new List(); }
> else { return new MyList(); }
>
> The equivalent won't compile in Haskell, because the actual return
> type does matter, and *is determined by the calling code*.  Our
> fictional GetListOfData can't return a List or a Mylist depending on
> some conditional, in fact it can't explicitly return either one at
> all, because the actual type of the result, as determined by the
> caller, could be either one, or something else entirely (ignoring the
> IO bit for the time being).
>
> So I've come to the conclusion that stating type classes are like
> interfaces is misleading to newcomers to Haskell, because it leads
> people to think they should use type classes for the same sorts of
> problems OO-languages solve with interfaces.  In turn this means new
> programmers are encouraged to use OO-style architecture in programs,
> reassured that they're in a "functional" idiom because they're using
> the "functionally-approved" feature of type classes.  I think that if
> I had understood this earlier, I would have embraced functional idioms
> more quickly.
>
> Incidentally, I'm still horrible at designing functional APIs and
> modules, but at least now I know it, and I'm no longer trying to force
> OO interfaces into Haskell.  So I've made progress.
> ___
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe