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:  Literate Haskell - capturing output (Rustom Mody)
   2. Re:  Literate Haskell - capturing output (Rustom Mody)
   3.  Using Parsec to parse Haskell Language (Sean Cormican)
   4.  Type classes vs Java interfaces (Mateusz Kowalczyk)
   5. Re:  Type classes vs Java interfaces (Peter Hall)
   6.  cabal-debian (Ryan)


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

Message: 1
Date: Thu, 31 Jan 2013 19:55:56 +0530
From: Rustom Mody <rustompm...@gmail.com>
Subject: Re: [Haskell-beginners] Literate Haskell - capturing output
To: Martin Drautzburg <martin.drautzb...@web.de>
Cc: beginners@haskell.org
Message-ID:
        <CAJ+TeociEmb0B99MG1ab+eCdG-JEz=hmui_71v3o9a7rth5...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Fri, Jan 18, 2013 at 12:30 AM, Martin Drautzburg <
martin.drautzb...@web.de> wrote:

> Hello all,
>
> I am using literate haskell quite a lot (otherwise I don't understand my
> own
> code). This works fine for the code as such. But when I give an example
> usage,
> I run code snippets in ghci and copy&paste into the main document/program,
> which turns them into "text" (and not code).
>
> When I make changes to the program these examples tend to no longer reflect
> the actual program.
>
> Is there a way to automatically run examples and include them in the .lhs
> file, preferably with the haskell prompt and everything?
>
>
If you are ok with emacs,
emacs -> orgmode -> babel may be worth a consider
http://orgmode.org/worg/org-contrib/babel/intro.html
http://www.jstatsoft.org/v46/i03/paper


-- 
http://www.the-magus.in
http://blog.languager.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130131/7cbeef10/attachment-0001.htm>

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

Message: 2
Date: Thu, 31 Jan 2013 20:12:22 +0530
From: Rustom Mody <rustompm...@gmail.com>
Subject: Re: [Haskell-beginners] Literate Haskell - capturing output
To: Martin Drautzburg <martin.drautzb...@web.de>
Cc: beginners@haskell.org
Message-ID:
        <caj+teodf8bqwwa1cwfjrpbwcfxm4ywa5arlh8wfjuvkt7c-...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Thu, Jan 31, 2013 at 7:55 PM, Rustom Mody <rustompm...@gmail.com> wrote:

>
>
> On Fri, Jan 18, 2013 at 12:30 AM, Martin Drautzburg <
> martin.drautzb...@web.de> wrote:
>
>> Hello all,
>>
>> I am using literate haskell quite a lot (otherwise I don't understand my
>> own
>> code). This works fine for the code as such. But when I give an example
>> usage,
>> I run code snippets in ghci and copy&paste into the main document/program,
>> which turns them into "text" (and not code).
>>
>> When I make changes to the program these examples tend to no longer
>> reflect
>> the actual program.
>>
>> Is there a way to automatically run examples and include them in the .lhs
>> file, preferably with the haskell prompt and everything?
>>
>>
> If you are ok with emacs,
> emacs -> orgmode -> babel may be worth a consider
> http://orgmode.org/worg/org-contrib/babel/intro.html
> http://www.jstatsoft.org/v46/i03/paper
>
>
>

http://www.cs.unm.edu/~eschulte/data/CISE-13-3-SciProg.pdf
maybe a better read
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130131/ea6befab/attachment-0001.htm>

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

Message: 3
Date: Thu, 31 Jan 2013 16:40:49 +0000
From: Sean Cormican <seancormic...@gmail.com>
Subject: [Haskell-beginners] Using Parsec to parse Haskell Language
To: beginners@haskell.org
Message-ID:
        <CAF6xeQdRnywdM=xfngbCr=0ohi1gbr_yz7gvhtcw6v2si3f...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

I'm working on a project in which I am attempting to write a parser for
Haskell within Haskell itself using Parsec.

The parser itself only deals with a subset of the features of the full
Haskell implementation but I'm having difficulty figuring out how to
implement the grammar with precedence of operations for example boolean
expression involving && over || and also 'if then else" statements in
relation to other operations.

I'm attempting to do this with the Text.Parsec.Expr module more
specifically BuildExpressionParser combinator using table and term as used
in a number of tutorials I have seen which deal with arithmetic expression.
Is this the correct course of action? Or will it fail to meet my needs.

Will it be necessary to create an AST for the grammar by creating new data
types as outlined in the following tutorial?
http://www.haskell.org/haskellwiki/Parsing_a_simple_imperative_language

Also what's the difference between the modules:
Text.Parsec.Expr
Text.ParserCombinators.Parsec.Expr

Thanks in advance,
Se?n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130131/dc787da8/attachment-0001.htm>

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

Message: 4
Date: Thu, 31 Jan 2013 23:36:46 +0000
From: Mateusz Kowalczyk <fuuze...@fuuzetsu.co.uk>
Subject: [Haskell-beginners] Type classes vs Java interfaces
To: beginners@haskell.org
Message-ID: <510b000e.5000...@fuuzetsu.co.uk>
Content-Type: text/plain; charset=ISO-8859-1

Greetings,

I often wonder how one would explain type classes to someone coming from
an environment such as Java. Whenever I think about type classes, I seem
to think of them as Java interfaces. Bah, even the bottom of [1] states
> Haskell classes are roughly similar to a Java interface. Like an
interface declaration, a Haskell class declaration defines a protocol
for using an object rather than defining an object itself.

Is there more to this `roughly similar' statement? Syntax is an obvious
difference but beyond that, I can't think of anything I can do with a
Haskell type class that I wouldn't be able to do with similar amount of
effort with a Java interface, except for the fact that the interface
would look absolutely disgusting syntax wise.

Any insight appreciated.


[1] - http://www.haskell.org/tutorial/classes.html



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

Message: 5
Date: Fri, 1 Feb 2013 01:43:16 +0000
From: Peter Hall <peter.h...@memorphic.com>
Subject: Re: [Haskell-beginners] Type classes vs Java interfaces
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <beginners@haskell.org>
Message-ID:
        <CAA6hAk60ZuKC8KH-9h+mLdfjP8=ozrjeswh38lyrbrwt_nl...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

The Java type system is a lot less rich. You can take an object and call
methods on it, knowing only that it implements an interface. In Haskell,
you can do so much more. You don't even need an implementation, you can
rely on the type of the binding instead:

extremes :: Bounded b => Bool -> b
extremes lower = if lower then minBound else maxBound
-- e.g.
extremes True :: Int -- -9223372036854775808
data Foo = A | B | C | D deriving (Bounded, Show)
extremes False :: Foo -- D

Or (with a few language extensions), you can have the typeclass take
multiple arguments. In Java, you can't do anything like this:

class Convert a b where
   convert :: a -> b

instance Show a => Convert a String where
   convert = show

instance Convert Foo String where
   convert A = "A"
   convert B = "B"
   convert C = "C"
   convert D = "D"


Peter


On 31 January 2013 23:36, Mateusz Kowalczyk <fuuze...@fuuzetsu.co.uk> wrote:

> Greetings,
>
> I often wonder how one would explain type classes to someone coming from
> an environment such as Java. Whenever I think about type classes, I seem
> to think of them as Java interfaces. Bah, even the bottom of [1] states
> > Haskell classes are roughly similar to a Java interface. Like an
> interface declaration, a Haskell class declaration defines a protocol
> for using an object rather than defining an object itself.
>
> Is there more to this `roughly similar' statement? Syntax is an obvious
> difference but beyond that, I can't think of anything I can do with a
> Haskell type class that I wouldn't be able to do with similar amount of
> effort with a Java interface, except for the fact that the interface
> would look absolutely disgusting syntax wise.
>
> Any insight appreciated.
>
>
> [1] - http://www.haskell.org/tutorial/classes.html
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130201/528c16b2/attachment-0001.htm>

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

Message: 6
Date: Fri, 01 Feb 2013 00:01:55 -0500
From: Ryan <rde...@gmail.com>
Subject: [Haskell-beginners] cabal-debian
To: beginners@haskell.org
Message-ID: <510b4c43.1030...@gmail.com>
Content-Type: text/plain; charset="iso-8859-1"; Format="flowed"

Hello,

I'm trying to compile a cabal package to debian with cabal-debian and 
having some trouble.

git clone git://github.com/wavewave/hoodle.git
cd hoodle/
cabal-debian --debianize --ghc --maintainer Ryan

then I get a the following error:
cabal-debian: cabal-debian: No bundled package list for ghc Version 
{versionBranch = [7,4,2], versionTags = []}

shouldn't cabal-debian be pulling the package list from the hoodle.cabal 
file?

Thanks,
Ryan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130201/6ed11e70/attachment.htm>

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

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


End of Beginners Digest, Vol 56, Issue 1
****************************************

Reply via email to