Send Beginners mailing list submissions to
[email protected]
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
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: Re: Enforcing Monad Laws (Daniel Fischer)
2. Re: 'cabal install hdirect' can't find hdirect (Larry Evans)
3. Re: Re: Enforcing Monad Laws (Jorden M)
4. Re: 'cabal install hdirect' can't find hdirect (Stephen Tetley)
----------------------------------------------------------------------
Message: 1
Date: Sun, 4 Jul 2010 17:16:21 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Re: Enforcing Monad Laws
To: [email protected]
Cc: Heinrich Apfelmus <[email protected]>
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
On Sunday 04 July 2010 16:05:48, Jorden M wrote:
> > 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.
>
I think that's not even possible in general.
Generally, you can't decide the equality of functions [okay, we're dealing
with finite domains in a computer, so in principle one could check all
possible inputs, but even for a small type like uint64_t, that's
impractical].
> > 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?.
To a certain extent. You'd have a good chance to catch gross violations of
the monad laws with QuickCheck. But for subtle violations, the odds are
minuscule.
------------------------------
Message: 2
Date: Sun, 04 Jul 2010 10:33:21 -0500
From: Larry Evans <[email protected]>
Subject: Re: [Haskell-beginners] 'cabal install hdirect' can't find
hdirect
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
On 07/04/10 10:06, Larry Evans wrote:
> 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.
[snip]
However, the 2nd alternative solution:
{-# LANGUAGE PatternSignatures #-}
did work. Thanks. However, during the compilations, there
were many warnings about pattern matching. Also, I plan to use
this with hugs. I'm not sure which haskell compiler was used.
Does that matter? I'm actually trying to use:
http://www.cas.mcmaster.ca/~kahl/FP/2003/Interpreter.lhs
with hugs.
TIA.
-Larry
------------------------------
Message: 3
Date: Sun, 4 Jul 2010 11:41:32 -0400
From: Jorden M <[email protected]>
Subject: Re: [Haskell-beginners] Re: Enforcing Monad Laws
To: Daniel Fischer <[email protected]>
Cc: Heinrich Apfelmus <[email protected]>,
[email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On Sun, Jul 4, 2010 at 11:16 AM, Daniel Fischer
<[email protected]> wrote:
> On Sunday 04 July 2010 16:05:48, Jorden M wrote:
>> > 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.
>>
>
> I think that's not even possible in general.
It would equate to solving the Halting Problem, I suppose. The point
of axioms for compiler use must then have been to say, `All right,
assume this is true and make optimizations if possible.'
A bit fast and loose in the presence of careless programmers, no? At
least calling them axioms makes more sense.
> Generally, you can't decide the equality of functions [okay, we're dealing
> with finite domains in a computer, so in principle one could check all
> possible inputs, but even for a small type like uint64_t, that's
> impractical].
>
>> > 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?.
>
> To a certain extent. You'd have a good chance to catch gross violations of
> the monad laws with QuickCheck. But for subtle violations, the odds are
> minuscule.
>
I wonder if the effort to do so would be useful.
------------------------------
Message: 4
Date: Sun, 4 Jul 2010 16:50:33 +0100
From: Stephen Tetley <[email protected]>
Subject: Re: [Haskell-beginners] 'cabal install hdirect' can't find
hdirect
To: Larry Evans <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
You don't need HDirect for this.
I've attached an early revision of Wolfram Kahl's code that I download
years ago - this is a plain Haskell version rather than a literate
file you should find it easier to use.
The file itself seems to have disappeared from the web, though maybe
it is findable through the Wayback machine.
On 4 July 2010 16:33, Larry Evans <[email protected]> wrote:
> {-# LANGUAGE PatternSignatures #-}
>
> did work. Thanks. However, during the compilations, there
> were many warnings about pattern matching. Also, I plan to use
> this with hugs. I'm not sure which haskell compiler was used.
> Does that matter? I'm actually trying to use:
>
> http://www.cas.mcmaster.ca/~kahl/FP/2003/Interpreter.lhs
>
> with hugs.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Interpreter.hs
Type: application/octet-stream
Size: 16539 bytes
Desc: not available
Url :
http://www.haskell.org/pipermail/beginners/attachments/20100704/257418bb/Interpreter.obj
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 25, Issue 12
*****************************************