Send Beginners mailing list submissions to
        beginners@haskell.org

To subscribe or unsubscribe via the World Wide Web, visit
        http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Re: curry in a hurry (prad)
   2.  WinGHCi (Michael Mossey)
   3.  Emacs tags (Michael Mossey)
   4.  Re: Enforcing Monad Laws (Heinrich Apfelmus)
   5.  'cabal install hdirect' can't find hdirect (Larry Evans)
   6. Re:  'cabal install hdirect' can't find hdirect (Daniel Fischer)
   7. Re:  'cabal install hdirect' can't find hdirect (Stephen Tetley)
   8. Re:  'cabal install hdirect' can't find hdirect (Daniel Fischer)
   9. Re:  Re: Enforcing Monad Laws (Jorden M)
  10. Re:  'cabal install hdirect' can't find hdirect (Larry Evans)


----------------------------------------------------------------------

Message: 1
Date: Sat, 3 Jul 2010 19:48:03 -0700
From: prad <p...@towardsfreedom.com>
Subject: [Haskell-beginners] Re: curry in a hurry
To: beginners@haskell.org
Message-ID: <20100703194803.30fe4...@gom>
Content-Type: text/plain; charset=US-ASCII

On Sat, 03 Jul 2010 20:18:24 -0300
MAN <elviotoccal...@gmail.com> wrote:

> The Integer/Num discrepancy you experience is due to
> ghci pushing the types a bit... put your code in a file for better
> results.
> 
ok so this is the ghci monomorphism restriction that daniel was talking
about which can be shut off with 
:set -XNoMonomorphismRestriction
in the .ghci file

> However, to keep it
> simple, just say that 'f' takes two arguments ;)
> 
ok this is helpful and combined with daniel's explanations (which i'll
respond to later after some thought) has made things considerably
clearer.

thx elvio!


> part 3:
> I refuse to put myself through that twisted experiment of yours :P
>
just my attempt at introducing some recurrysion. :D

-- 
In fiendship,
prad

                                      ... with you on your journey
Towards Freedom
http://www.towardsfreedom.com (website)
Information, Inspiration, Imagination - truly a site for soaring I's


------------------------------

Message: 2
Date: Sat, 03 Jul 2010 23:12:35 -0700
From: Michael Mossey <m...@alumni.caltech.edu>
Subject: [Haskell-beginners] WinGHCi
To: beginners@haskell.org
Message-ID: <4c302653.30...@alumni.caltech.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

What is special about WinGHCi? Does it add anything to ghci or  is it just 
a GUI interface to ghci commands? I have RSI and avoid the mouse, so I 
would rather use ghci unless WinGHCi adds something special.

Thanks,
Mike


------------------------------

Message: 3
Date: Sat, 03 Jul 2010 23:54:54 -0700
From: Michael Mossey <m...@alumni.caltech.edu>
Subject: [Haskell-beginners] Emacs tags
To: beginners@haskell.org
Message-ID: <4c30303e.7090...@alumni.caltech.edu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

(I asked this question on the logical email list to ask, haskell-mode, but 
got no reply, so I'm hoping someone here might know the answer.)

I tried to use tags with emacs.

I ran :etags in ghci, then tried to use C-c M-. inside Emacs
to find the definition of a symbol. It reported "no source information
available". I did some basic checking---a TAGS file does exist in the same 
directory as the file I was visiting, and contains some kind of entry for 
the specific symbol (whether the right syntax I don't know).

I'm using haskell-mode 2.4 and emacs 21.3.1 on Windows XP. Also ghci 6.12.1.

Thanks,
Mike


------------------------------

Message: 4
Date: Sun, 04 Jul 2010 09:15:47 +0200
From: Heinrich Apfelmus <apfel...@quantentunnel.de>
Subject: [Haskell-beginners] Re: Enforcing Monad Laws
To: beginners@haskell.org
Message-ID: <i0pcf3$uc...@dough.gmane.org>
Content-Type: text/plain; charset=UTF-8; format=flowed

Jorden M wrote:
> Heinrich Apfelmus wrote:
>> Jorden M wrote:
>>>
>>> C++ `Concepts', which almost made it into the C++0x standard, are
>>> roughly similar to Haskell type classes. The proposal for concepts in
>>> C++ had a feature called axioms, which allow the programmer to specify
>>> semantics on the functions the concept contains. This allows for
>>> enforcing things such as the Monad Laws, as well as letting the
>>> compiler make certain optimizations it may not have been able to make
>>> without axiomatic guarantees.
>>
>> I have a hard time imagining that axioms are being used to prove properties
>> about programs in a language such as C++... :) Any pointers?
> 
> That is not what they are for. Axiom is probably not a good choice of
> terminology. Axioms let a concept enforce certain statements about
> functions inside the concept. E.g., in a concept that describes
> addition, one could use an axiom statement to enforce commutativity of
> that addition operation. There seems to be no way to do this in
> Haskell, hence my question.

Now that I've had a really short look at Axioms, I think the Haskell 
equivalent would be QuickCheck properties. After all, Axioms are not 
enforced by the compiler, their only effect is documentation. Granted, 
they are part of the source code, but frankly, I don't see how this has 
more effect than stating invariants as QuickCheck properties or writing 
them down in a comment.


Regards,
Heinrich Apfelmus

--
http://apfelmus.nfshost.com



------------------------------

Message: 5
Date: Sun, 04 Jul 2010 05:20:42 -0500
From: Larry Evans <cppljev...@suddenlink.net>
Subject: [Haskell-beginners] 'cabal install hdirect' can't find
        hdirect
To: beginners@haskell.org
Message-ID: <4c30607a.3080...@suddenlink.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

hdirect is here:

http://hackage.haskell.org/package/hdirect

however, as shown by the following terminal session,
cabal can't find it.  What should I do to insteall hdirect?

~/download/haskell/libs $ cabal -V
cabal-install version 0.6.0
using version 1.6.0.1 of the Cabal library
~/download/haskell/libs $ uname -a
Linux evansl-desktop 2.6.24-24-generic #1 SMP Fri Sep 18 16:16:18 UTC 
2009 x86_64 GNU/Linux
~/download/haskell/libs $ cabal install happy --dry-run
Resolving dependencies...
In order, the following would be installed (use -v for more details):
mtl-1.1.0.2
happy-1.18.1
~/download/haskell/libs $ cabal install hdirect --dry-run
cabal: There is no package named hdirect
~/download/haskell/libs $


------------------------------

Message: 6
Date: Sun, 4 Jul 2010 12:28:55 +0200
From: Daniel Fischer <daniel.is.fisc...@web.de>
Subject: Re: [Haskell-beginners] 'cabal install hdirect' can't find
        hdirect
To: beginners@haskell.org
Message-ID: <201007041228.56513.daniel.is.fisc...@web.de>
Content-Type: text/plain;  charset="iso-8859-1"

On Sunday 04 July 2010 12:20:42, Larry Evans wrote:
> hdirect is here:
>
> http://hackage.haskell.org/package/hdirect
>
> however, as shown by the following terminal session,
> cabal can't find it.  What should I do to insteall hdirect?

Strange. What does

$ cabal update && cabal list | grep -A 6 hdirect

produce?

Well, in case of emergency, there's always

*download the .tar.gz from hackage via wget, browser, ...
* unpack the archive
$ cd hdirect/0.21.0
$ cabal install

but try the other route first. Also, you might consider

$ cabal install cabal-install-0.6.2 [or 0.6.4]

and try your luck with that.

>
> ~/download/haskell/libs $ cabal -V
> cabal-install version 0.6.0
> using version 1.6.0.1 of the Cabal library
> ~/download/haskell/libs $ uname -a
> Linux evansl-desktop 2.6.24-24-generic #1 SMP Fri Sep 18 16:16:18 UTC
> 2009 x86_64 GNU/Linux
> ~/download/haskell/libs $ cabal install happy --dry-run
> Resolving dependencies...
> In order, the following would be installed (use -v for more details):
> mtl-1.1.0.2
> happy-1.18.1
> ~/download/haskell/libs $ cabal install hdirect --dry-run
> cabal: There is no package named hdirect
> ~/download/haskell/libs $


------------------------------

Message: 7
Date: Sun, 4 Jul 2010 11:34:52 +0100
From: Stephen Tetley <stephen.tet...@gmail.com>
Subject: Re: [Haskell-beginners] 'cabal install hdirect' can't find
        hdirect
Cc: beginners@haskell.org
Message-ID:
        <aanlktimyt4cf6xhvn4opfdfyfkthcpy_qpsmun2tx...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On 4 July 2010 11:28, Daniel Fischer <daniel.is.fisc...@web.de> wrote:

> Well, in case of emergency, there's always
>
> *download the .tar.gz from hackage via wget, browser, ...
> * unpack the archive
> $ cd hdirect/0.21.0
> $ cabal install

If you download the archive there is also the manual way:

cd into the archive after untarring it...

> runhaskell Setup.hs configure
> runhaskell Setup.hs build
> runhaskell Setup.hs install


The last step may require sudo privileges depending on your set up.
Also some archives have a Setup.lhs rather than Setup.hs file.


------------------------------

Message: 8
Date: Sun, 4 Jul 2010 13:10:39 +0200
From: Daniel Fischer <daniel.is.fisc...@web.de>
Subject: Re: [Haskell-beginners] 'cabal install hdirect' can't find
        hdirect
To: beginners@haskell.org
Message-ID: <201007041310.39920.daniel.is.fisc...@web.de>
Content-Type: text/plain;  charset="iso-8859-1"

On Sunday 04 July 2010 12:34:52, Stephen Tetley wrote:
> On 4 July 2010 11:28, Daniel Fischer <daniel.is.fisc...@web.de> wrote:
> > Well, in case of emergency, there's always
> >
> > *download the .tar.gz from hackage via wget, browser, ...
> > * unpack the archive
> > $ cd hdirect/0.21.0
> > $ cabal install
>
> If you download the archive there is also the manual way:

Sure, but "cabal install" requires less typing. And it defaults to user-
installs, so you needn't pass --user to Setup configure. And with a proper 
config file, you needn't pass --enable-library-profiling to configure and 
you needn't run (Setup) haddock manually and cabal install automatically 
puts the created docs in the same place as the others.

On the whole, cabal install is much more convenient :)

>
> cd into the archive after untarring it...
>
> > runhaskell Setup.hs configure
> > runhaskell Setup.hs build
> > runhaskell Setup.hs install
>
> The last step may require sudo privileges depending on your set up.
> Also some archives have a Setup.lhs rather than Setup.hs file.



------------------------------

Message: 9
Date: Sun, 4 Jul 2010 10:05:48 -0400
From: Jorden M <jrm8...@gmail.com>
Subject: Re: [Haskell-beginners] Re: Enforcing Monad Laws
To: Heinrich Apfelmus <apfel...@quantentunnel.de>
Cc: beginners@haskell.org
Message-ID:
        <aanlktik3i_s6wf6qa29xyzvfo38tqjucabwjlv_nq...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

On Sun, Jul 4, 2010 at 3:15 AM, Heinrich Apfelmus
<apfel...@quantentunnel.de> wrote:
> Jorden M wrote:
>>
>> Heinrich Apfelmus wrote:
>>>
>>> Jorden M wrote:
>>>>
>>>> C++ `Concepts', which almost made it into the C++0x standard, are
>>>> roughly similar to Haskell type classes. The proposal for concepts in
>>>> C++ had a feature called axioms, which allow the programmer to specify
>>>> semantics on the functions the concept contains. This allows for
>>>> enforcing things such as the Monad Laws, as well as letting the
>>>> compiler make certain optimizations it may not have been able to make
>>>> without axiomatic guarantees.
>>>
>>> I have a hard time imagining that axioms are being used to prove
>>> properties
>>> about programs in a language such as C++... :) Any pointers?
>>
>> That is not what they are for. Axiom is probably not a good choice of
>> terminology. Axioms let a concept enforce certain statements about
>> functions inside the concept. E.g., in a concept that describes
>> addition, one could use an axiom statement to enforce commutativity of
>> that addition operation. There seems to be no way to do this in
>> Haskell, hence my question.
>
> Now that I've had a really short look at Axioms, I think the Haskell
> equivalent would be QuickCheck properties. After all, Axioms are not
> enforced by the compiler, their only effect is documentation. Granted, they

Really? I thought they were.

> are part of the source code, but frankly, I don't see how this has more
> effect than stating invariants as QuickCheck properties or writing them down
> in a comment.

Would it make sense to try to formalize things like the monad laws
using QuickCheck?

>
>
> Regards,
> Heinrich Apfelmus
>
> --
> http://apfelmus.nfshost.com
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>


------------------------------

Message: 10
Date: Sun, 04 Jul 2010 10:06:11 -0500
From: Larry Evans <cppljev...@suddenlink.net>
Subject: Re: [Haskell-beginners] 'cabal install hdirect' can't find
        hdirect
To: beginners@haskell.org
Message-ID: <4c30a363.8030...@suddenlink.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

On 07/04/10 07:28, Daniel Fischer wrote:
> On Sunday 04 July 2010 13:45:01 you wrote:
>   
>> src/Lex.lhs:330:8:
>>     Illegal signature in pattern: Int
>>         Use -XPatternSignatures to permit it
>> cabal: Error: some packages failed to install:
>> hdirect-0.21.0 failed during the building phase. The exception was:
>> exit: ExitFailure 1
>> ~/download/haskell/libs $ which happy
>> /home/evansl/.cabal/bin/happy
>> ~/download/haskell/libs $
>>
>> Any ideas about how to solve this problem?
>>     
>
> Sure. First, tell the maintainer, he might want to fix it for all.
>   
Done.
> Then, the quick fix for you,
> * unpack the .tar.gz
> * change the version in the .cabal file (my preferred method is appending a 
> ".1" to the version number). You need that in case you want to build some 
> library which depends on hdirect, so that cabal-install picks your bumped 
> newer version rather than the newest version on hackage.
> * make it compile, e.g. by adding a field
> Extensions:     PatternSignatures
> to the cabal file, or by putting a 
> {-# LANGUAGE PatternSignatures #-}
> pragma to the offending file.
> Then run cabal install in the unpacked and modified directory.
> Several iterations of edit file; cabal install may be necessary.
>
>   
Downloaded:

http://hackage.haskell.org/packages/archive/hdirect/0.21.0/hdirect-0.21.0.tar.gz

then unzipped and untarred it then edited hdirect.cabal by adding:

      Extensions:     PatternSignatures

Below the line:

library

However, still got:

src/Desugar.lhs:2053:1:
    Warning: Pattern match(es) are non-exhaustive
             In a case alternative:
                 Patterns not matched:
                     (_, [])
                     (_, IDL.IncludeEnd : _)
                     (_, (IDL.IncludeStart _) : _)
                     (_, (IDL.Pragma _) : _)
                     ...
[60 of 65] Compiling IDLToken         ( src/IDLToken.lhs, 
dist/build/hdirect/hdirect-tmp/IDLToken.o )
[61 of 65] Compiling LexM             ( src/LexM.lhs, 
dist/build/hdirect/hdirect-tmp/LexM.o )
[62 of 65] Compiling Lex              ( src/Lex.lhs, 
dist/build/hdirect/hdirect-tmp/Lex.o )

src/Lex.lhs:330:8:
    Illegal signature in pattern: Int
        Use -XPatternSignatures to permit it
cabal: Error: some packages failed to install:

Any further help is appreciated.

-regards,
Larry



------------------------------

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 25, Issue 11
*****************************************

Reply via email to