Learning Haskell

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Learning Haskell

Jimmie Houchin
Hello,

I am exploring the possibility of learning Haskell. I am not a
professional programmer, nor do I have a CS or Math degree.

I do play and program with Python, Smalltalk (Squeak), Javascript,
explored Erlang some.

I do not have a strong math background.

Is lack of strong math background a major hindrance to learning Haskell?

Also, I understand Haskell's benefits for programming larger projects.
But how does it do on programming in the small?
ie: using Haskell where I might have used Python for scripting?

Thanks for any help and wisdom.

Jimmie Houchin
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Peter Robinson-2
On Monday 05 December 2005 23:26, Jimmie Houchin wrote:
> I do not have a strong math background.
> Is lack of strong math background a major hindrance to learning Haskell?
While it's certainly helpful to have some basic knowledge of lambda calculus,
type theory, etc.  most concepts in Haskell can be understood intuitively -
that means without digging deep into theory.

> Also, I understand Haskell's benefits for programming larger projects.
> But how does it do on programming in the small?
> ie: using Haskell where I might have used Python for scripting?
Small tasks can be solved quite efficiently in Haskell compared to most other
languages. This is a good place to start since you don't need to know about
advanced concepts (Monads). See the tutorials [1] or the haskell wiki [2]  
for examples.

Regards,
Peter

[1] http://www.haskell.org/learning.html
[2] http://www.haskell.org/hawiki/CodeExamples
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
jrv
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

jrv
In reply to this post by Jimmie Houchin

I think you should take a look at some of the tutorial material you can
find at www.haskell.org and jump in.

For some reason there seems to be an affinity between Python and Haskell.
Not clear to me why, since on the surface there is little similarity of
syntax.

If you think you might like it well enough to get a book, there are several
good ones.  I think Paul Hudack's "The Haskell School of Expression" might
be a good start for you (I'm assuming that the SOEGraphics library is
readily available.  Once when I complained that I couldn't find it, someone
told me I should have been able to!)   Also, Simon Thompson's "The Craft of
Functional Programming" is very good.

Haskell should be good for doing small 'throw away' programs, once you get
used to the IO.

Caveats, and truth in advertising:

1. I'm pretty much a Haskell novice.  Although I've lurked in the foothills
here for some years, only recently have I had a chance to try to get up to
speed for something relatively serious.

2. I intend to use Haskell for most of what I used to use Perl for, in the
way of small programs.  I haven't actually done this, since I haven't had
the need. (I'm currently working on a parser for the Conceptual Graph
Interchange Format (CGIF) -- which will be a small program itself, using Parsec.
I hope to use it as part of a graphical CG editor, eventually.  If I ever
get time I intend to rewrite my Prolog/Postgresql bank statement tracking
and reconciling program using Haskell/Postgresql, but that's a ways down on
my list.)

3. I have been certified to have a strong math background :-), so take my
advice with a grain of salt.  I definitely don't understand monads, but can
use them in a primative, unsophisticated way.  I think if you can get along
ok in Python and <groan> java script </groan> you ought to be able to get
along ok in Haskell.

4. If you want a GUI, there are several in the works but (as far as I
know), none standard.  I'm using HTk, because of an old slow machine and
previous knowledge of tcl/Tk.  I also tried developing a little drawing
program with GTK2HS, but its development was moving too fast for me.
wxHaskell is also pretty active.  Others may have better advice.

5. Oh, and my platform is Linux.  I used to use Hugs on Windows a long time
ago when my job required Windows.

Happy Haskelling!

John Velman



On Mon, Dec 05, 2005 at 04:26:20PM -0600, Jimmie Houchin wrote:

> Hello,
>
> I am exploring the possibility of learning Haskell. I am not a
> professional programmer, nor do I have a CS or Math degree.
>
> I do play and program with Python, Smalltalk (Squeak), Javascript,
> explored Erlang some.
>
> I do not have a strong math background.
>
> Is lack of strong math background a major hindrance to learning Haskell?
>
> Also, I understand Haskell's benefits for programming larger projects.
> But how does it do on programming in the small?
> ie: using Haskell where I might have used Python for scripting?
>
> Thanks for any help and wisdom.
>
> Jimmie Houchin
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Cale Gibbard
In reply to this post by Jimmie Houchin
Hello,

It's always great to see more people interested in Haskell. :)  While
a strong mathematics background can help in learning Haskell, I
wouldn't say that it's much more essential to learning Haskell than
Python or Smalltalk.  You will be directly exposed to mathematical
concepts from time to time (functors, monads, monoids), but it's not
necessary to understand them in their full mathematical context to put
them to use in your programs.  On the contrary, they're rather good
programming abstractions on their own, and would be worthwhile in most
any language.  Further, mathematical kinds of reasoning apply more
directly to Haskell programs, for instance, referential transparency
lets you substitute equal expressions for one another like in a
mathematical calculation, but again, it's not really essential to
programming (though it's handy, and you'll probably just find yourself
doing it after a while).

To your second question, I'd say that Haskell isn't bad at small
things. One can write a great deal of useful one-or-two-line Haskell
programs. I'd consider its use in shell-scripting like tasks perhaps a
little bit odd, but not really awkward at all.  Some people have
worked on libraries and tools in that direction.

One thing which might interest you is Don Stewart's h4sh, which allows
one to use common Haskell list functions in the shell.
http://www.cse.unsw.edu.au/~dons/h4sh.html

There's also a library at http://www.volker-wysk.de/hsshellscript/
which is aimed at writing shell-script-like code in Haskell.

I've used it myself for a lot of small tasks, many oriented in the
direction of searching for solutions to particular problems. It's a
nice language in which to do nondeterministic things.

Haskell code is generally pretty fun to write, there's usually not a
lot of framework cruft that you need to write to get started on code
that works.

 - Cale

On 05/12/05, Jimmie Houchin <[hidden email]> wrote:

> Hello,
>
> I am exploring the possibility of learning Haskell. I am not a
> professional programmer, nor do I have a CS or Math degree.
>
> I do play and program with Python, Smalltalk (Squeak), Javascript,
> explored Erlang some.
>
> I do not have a strong math background.
>
> Is lack of strong math background a major hindrance to learning Haskell?
>
> Also, I understand Haskell's benefits for programming larger projects.
> But how does it do on programming in the small?
> ie: using Haskell where I might have used Python for scripting?
>
> Thanks for any help and wisdom.
>
> Jimmie Houchin
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Jimmie Houchin
In reply to this post by Jimmie Houchin
I would like to thank all who have replied to my inquiry.

I have been perusing the haskell.org site and reading some of the
tutorials. I just didn't want to expend lots of time just to find out
that my math skills were woefully inadequate. I am grateful to learn
that I can continue pursuing Haskell. I am not afraid of math. I just
don't have a background nor the interest in acquiring one. My time is
too limited. :)

Haskell looks like a very interesting language. I am only so-so with
Python and I thought that maybe if instead of spending sufficient time
to get proficient with Python, I could invest a similar time (more or
less) and get reasonably (pragmatically speaking) proficient with
Haskell. I know I may never understand the theory and maths behind the
design, but I believe I can appreciate the design and be a decent user
of the tools it provides.

I've seen much of what OO provides, good and bad. I'm interested in a
good FP experience and it seems that Haskell can provide that.

The reason I asked about programming in the small, was my desire to
spend my time and energy in a single direction. The ability to move what
I do in Python to Haskell aids in that goal. It also promotes my
learning of Haskell. From my browsing of the lists on gmane, it seems
that Haskell is improving in that direction. I know it isn't Haskell's
native environment, but as long as it permits and doesn't hinder.

I am also hoping to use it for web development.

Thanks again. We'll see if I can fit Haskell into my brain. Or at least
a sufficiently workable portion. :)

Jimmie
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Donn Cave-2
In reply to this post by Jimmie Houchin
Quoth Jimmie Houchin <[hidden email]>:
...
| Haskell looks like a very interesting language. I am only so-so with
| Python and I thought that maybe if instead of spending sufficient time
| to get proficient with Python, I could invest a similar time (more or
| less) and get reasonably (pragmatically speaking) proficient with
| Haskell. I know I may never understand the theory and maths behind the
| design, but I believe I can appreciate the design and be a decent user
| of the tools it provides.

I'm coming from a similar background, Python early adopter (well, they
do have something in common!  Just something sort of trivial.) and no
great math background.

I find Haskell MUCH more mentally rigorous.  I don't think that's just
because I have previously been living in "imperative" land, it's because
Haskell gets far more abstract.  I have lately been thinking I might
see if I can achieve a clear understanding of StateT.  Not in any
theoretical or mathematical sense, just want to understand how it goes
together where honestly right now it seems kind of like magic.  Not
complaining, there could be worse things than magic like that, but
I'm just saying our mathematical ignorance doesn't excuse us from some
mental heavy lifting that doesn't compare to anything in Python.

Then there are performance issues with Haskell that don't come up in
other languages.  I have tried to do things like analyze big text files
with Haskell and given up, because I could not figure out how to get
within an order of magnitude of reasonable completion time.  I still
think it's possible, though maybe not with standard String type, but
anyway it's something to look out for.

| I am also hoping to use it for web development.

Wonder how `links' is coming along.  (Hope they figured out a better
name, anyway.)

        Donn
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Lemmih
On 12/6/05, Donn Cave <[hidden email]> wrote:

> Quoth Jimmie Houchin <[hidden email]>:
> ...
> | Haskell looks like a very interesting language. I am only so-so with
> | Python and I thought that maybe if instead of spending sufficient time
> | to get proficient with Python, I could invest a similar time (more or
> | less) and get reasonably (pragmatically speaking) proficient with
> | Haskell. I know I may never understand the theory and maths behind the
> | design, but I believe I can appreciate the design and be a decent user
> | of the tools it provides.
>
> I'm coming from a similar background, Python early adopter (well, they
> do have something in common!  Just something sort of trivial.) and no
> great math background.
>
> I find Haskell MUCH more mentally rigorous.  I don't think that's just
> because I have previously been living in "imperative" land, it's because
> Haskell gets far more abstract.  I have lately been thinking I might
> see if I can achieve a clear understanding of StateT.  Not in any
> theoretical or mathematical sense, just want to understand how it goes
> together where honestly right now it seems kind of like magic.  Not
> complaining, there could be worse things than magic like that, but
> I'm just saying our mathematical ignorance doesn't excuse us from some
> mental heavy lifting that doesn't compare to anything in Python.
>
> Then there are performance issues with Haskell that don't come up in
> other languages.  I have tried to do things like analyze big text files
> with Haskell and given up, because I could not figure out how to get
> within an order of magnitude of reasonable completion time.  I still
> think it's possible, though maybe not with standard String type, but
> anyway it's something to look out for.

You might wanna have a look at Don's FastPackedString library:
http://www.cse.unsw.edu.au/~dons/fps.html

> | I am also hoping to use it for web development.
>
> Wonder how `links' is coming along.  (Hope they figured out a better
> name, anyway.)

Got an url for the project?

--
Friendly,
  Lemmih
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re[2]: Learning Haskell

Bulat Ziganshin
In reply to this post by Jimmie Houchin
Hello Jimmie,

Tuesday, December 06, 2005, 9:14:37 AM, you wrote:

JH> I would like to thank all who have replied to my inquiry.

my two cents :)

i'm not mathematician, but instead a professional programmer. i found
that Haskell allow to write shorter, concise and robust programs. as
Wirth says, "program = datastructures plus algorithms" and Haskell is
excellent at expressing both data types and algorithms processing them

the larger the project, the there is more meaning to use Haskell to
implement it, because you get the possibility to construct language
"dialect" which is better suits pecularities of this concrete project.
just for example - even control structures i use in my program are
written by me (and it is implemented very easy, just several lines each)

but for the small projects real difference created not by general
language features, but by features and environment, oriented toward
this concrete field of application. and in area of scripting and web
programming perl/ruby/python have much more specialization

one time i tried to write Haskell and Ruby variants of small script that
runs programs and bencmark its results. the main part of program was
equally sized, but Haskell implementation required from me writing
some small library of functions which are already present in all
abovementioned languages - getFileSize, trimSpaces and so on

so, for small scripting tasks you will not get benefits unless you are
need to organize complex dataprocessing. and even to make par-to-par
comparision with scripting languages, you are need to obtain libraries
for RegEx matching, String processing, and filesystem operations

i think, that the same applies to web programming - you need an
additional libraries and even with them you will not get all benefits
of Zope and RubyOnRails

so, in my feel, Haskell is better in areas where there is no standard
quick-and-dirty solutions and all languages are in equal conditions,
but it can't compete with Visual Basic in user interfaces, Erlang in
distributed processing, and Python in scripting

JH> I've seen much of what OO provides, good and bad. I'm interested in a
JH> good FP experience and it seems that Haskell can provide that.

nevertheless, if you not only search for the faster way to create
these scripts, but also to improve your programming skills, i
recommend you to teach Haskell :)  i even recommend you to spend just
one day to read book about Python (or Ruby, which i love more :) just
to get taste, and then go to teach Haskell seriously. these scripting
languages are not very complex, nor very different from other languages.
and in big contrast with Perl, they contains very little number of
"special rules". so, reading the whole book about Python/Ruby in just
one day is entirely possible

to learn Haskell and run scripts i recommend to use Hugs (WinHugs to
learn, if you are under Windows). my CMD instructed to run .hs files
with "runhugs.exe +st.qkoOuI -98"

i learned Haskell by "gentle introduction" but afair it had bad
explanation of imperative programming in Haskell. if your book have a
bad explanation of I/O in Haskell, try another book, or ask here. this
area really not seriously more complicated than in other languages,
despite its complex (but completelly hidden!) theoretical basis

JH> Thanks again. We'll see if I can fit Haskell into my brain. Or at least
JH> a sufficiently workable portion. :)

to my taste, Haskell have the features from ususal languages (say,
Java or Ruby) plus something more in areas of defining datastructures
and algorithms. if you don't need to use more features in these areas
than traditional languages provide, then there is no great meaning to
learn Haskell


--
Best regards,
 Bulat                            mailto:[hidden email]



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Mark T.B. Carroll-2
In reply to this post by Jimmie Houchin
Jimmie Houchin <[hidden email]> writes:
(snip)
> I have been perusing the haskell.org site and reading some of the
> tutorials. I just didn't want to expend lots of time just to find out
> that my math skills were woefully inadequate. I am grateful to learn
(snip)

Right. My math background isn't good enough for me to understand
(without much effort) some of the list traffic here - there's a lot I'm
still wrapping my head around. With much of the Haskell I've figured
out, I've done so by studying examples of others' code. Still, the
Haskell I do know is more than enough for me to do plenty of things
with, and it certainly covers everything I'd normally have coming to
mind from my use of other languages.

> The reason I asked about programming in the small, was my desire to
> spend my time and energy in a single direction. The ability to move what
> I do in Python to Haskell aids in that goal. It also promotes my
(snip)

Yes. I've ported a number of little Perl and bash scripts to Haskell
with very pleasing results. (Most recently, a little script that does
AUTHINFO GENERIC authentication by MD5 to an NNTP server.) It's even
quite easy to slap together little one-off programs once you're
comfortable with using "do" and the IO monad (which is pretty easy for
single-threaded stuff, and forkProcess works nicely too IMLE).

-- Mark

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Donn Cave-2
In reply to this post by Jimmie Houchin
Quoth Lemmih <[hidden email]>:
...
| You might wanna have a look at Don's FastPackedString library:
| http://www.cse.unsw.edu.au/~dons/fps.html

Thanks, that's actually what got me thinking about trying this again.

| > | I am also hoping to use it for web development.
| >
| > Wonder how `links' is coming along.  (Hope they figured out a better
| > name, anyway.)
|
| Got an url for the project?

http://homepages.inf.ed.ac.uk/wadler/links/

Having looked it up, of course I looked at it.  Please forget I asked.

        Donn Cave, [hidden email]
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Wolfgang Jeltsch
In reply to this post by Bulat Ziganshin
Am Dienstag, 6. Dezember 2005 14:43 schrieb Bulat Ziganshin:
> [...]

> so, in my feel, Haskell is better in areas where there is no standard
> quick-and-dirty solutions and all languages are in equal conditions,
> but it can't compete with Visual Basic in user interfaces, Erlang in
> distributed processing, and Python in scripting

Well, I would say that this has nothing to do with the language as such but
with a current lack of certain libraries.  I even think that with appropriate
libraries, Haskell will often have advantages over the existing solutions.

> [...]

Best wishes,
Wolfgang
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re[2]: Learning Haskell

Bulat Ziganshin
Hello Wolfgang,

Tuesday, December 06, 2005, 10:16:08 PM, you wrote:

>> so, in my feel, Haskell is better in areas where there is no standard
>> quick-and-dirty solutions and all languages are in equal conditions,
>> but it can't compete with Visual Basic in user interfaces, Erlang in
>> distributed processing, and Python in scripting

WJ> Well, I would say that this has nothing to do with the language as such but
WJ> with a current lack of certain libraries.  I even think that with appropriate
WJ> libraries, Haskell will often have advantages over the existing solutions.

of course, the main problem is libraries. the second problem is
frameworks (like Delphi, which i also love). the third-priority problem
is language itself. in particular, i hate Haskell school of imperative
manipulations:

x' <- readIORef x
y' <- readIORef y
writeIORef z (x'*y')

i already sayed about lacking of OOP features. another weakness
against Erlang and scripting languages is their more dynamic
character which sometimes is more appropriate, especially in
scripting, web pages and other applets


--
Best regards,
 Bulat                            mailto:[hidden email]



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Tomasz Zielonka
In reply to this post by Cale Gibbard
On Mon, Dec 05, 2005 at 09:08:32PM -0500, Cale Gibbard wrote:
> To your second question, I'd say that Haskell isn't bad at small
> things. One can write a great deal of useful one-or-two-line Haskell
> programs. I'd consider its use in shell-scripting like tasks perhaps a
> little bit odd, but not really awkward at all.

For me, it isn't odd at all. I often face the some problem with
traditional shell scripting using tools like awk, cut, head, tail, sort,
etc - these tools are most often used in a way that is very sensitive
to formats of processed (text) files. This is a dangerous kind of
sensitivity, which often results in silent errors.

On the other hand in Haskell, with use of libraries like Parsec, it
is very easy to create a precise parser for the intended file format.
Almost every divergence from the assumed format will cause the program
to fail with a nice error message pointing to the problem.

Of course you can do similar things with regular expression provided
by tools like awk, sed and perl, but regexps don't scale to more
complicated formats (regular languages vs. context-free languages).

> Haskell code is generally pretty fun to write, there's usually not a
> lot of framework cruft that you need to write to get started on code
> that works.

Some Haskell libraries, like Parsec, require a bit of constant
boilerplate code to use - but you can write your own library
to move some of boilerplate code to one place. Recently, I was
very happy when I realized that I could reduce most of my small
Parsec-using programs by 5-10 lines of code this way.

If you wonder what kind of functions are these, below are their
signatures. I would have to ask my boss to show the actual code, but
they are really quite simple, and the types tell everything.

    parseFile :: CharParser () a -> FilePath -> IO a
    parseStdIn :: CharParser () a -> IO a

    parseOrFail :: Monad m => GenParser tok () a -> SourceName -> [tok] -> m a

    lazyMany :: CharParser () a -> SourceName -> [Char] -> [a]
    parserToMaybeFun :: GenParser tok () a -> ([tok] -> Maybe (a, [tok]))

    parseWithText :: CharParser st a -> CharParser st (a, String)

With these some programs become really simple:

    import ...

    main = do
        x <- parseStdIn fileParser
        do something with x

    fileParser = do
        ...

Best regards
Tomasz

--
I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Ketil Malde-2
In reply to this post by Jimmie Houchin

Jimmie Houchin <[hidden email]> writes:

> I have been perusing the haskell.org site and reading some of the
> tutorials. I just didn't want to expend lots of time just to find out
> that my math skills were woefully inadequate. I am grateful to learn
> that I can continue pursuing Haskell.

Lots of people have answered, so I'll just add one point: use the
community!  Lots of people are quite enthusiastic, so if you get
stuck, or have questions, post to this or one of the other mailing
lists, or try the #haskell IRC channel on FreeNode.

-k
--
If I haven't seen further, it is by standing in the footprints of giants

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Haskell and other languages (was: Learning Haskell)

Graham Klyne-2
In reply to this post by Jimmie Houchin
Jimmie Houchin wrote:
> Haskell looks like a very interesting language. I am only so-so with
> Python and I thought that maybe if instead of spending sufficient time
> to get proficient with Python, I could invest a similar time (more or
> less) and get reasonably (pragmatically speaking) proficient with
> Haskell. I know I may never understand the theory and maths behind the
> design, but I believe I can appreciate the design and be a decent user
> of the tools it provides.

FWIW, I learned Haskell a couple of years ago, having previously programmed in
Python and (many) other languages.  Recently, I've been using Python for a
project (the choice being determined by both technical and non-technical
issues), and find my Python programming style is now heavily influenced (for the
better, I hope ;-) by my Haskell programming experience.

A drawback of using Haskell is the limited availability of support libraries,
although many people here are working hard to improve that situation.  I'm doing
Python work with a web application framework (Turbogears - in the same general
space as Ruby/Rails, but different), and as yet I don't see anything like it in
Haskell.  It would be great to see a lightweight "full stack" web application
framework for Haskell:  I believe many of the pieces exist, and Haskell could be
a supremely effective language for tying them together.

#g

--
Graham Klyne
For email:
http://www.ninebynine.org/#Contact

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Wolfgang Jeltsch
In reply to this post by Bulat Ziganshin
Am Dienstag, 6. Dezember 2005 20:58 schrieb Bulat Ziganshin:
> [...]

> i already sayed about lacking of OOP features.

This is the old discussion again.  Do we need OOP features?  Or do we want to
avoid OOP features?  I would like to avoid them.  Maybe I have not enough
experience with situations where they are helpful but maybe there exist
better alternatives.

> another weakness against Erlang and scripting languages is their more
> dynamic character which sometimes is more appropriate, especially in
> scripting, web pages and other applets

What do you mean with "more dynamic"?  More dynamic typing?  Where is this
important?  By the way, I'm thinking about a web development framework where
static typing is essential for enforcing certain restrictions and consistency
conditions.  Currently, I cannot see where dynamic typing would help for web
programming but this does not mean that there aren't such situations.

Best wishes,
Wolfgang
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Jimmie Houchin
In reply to this post by Jimmie Houchin
I want to thank all who provided insight and understanding to my
inquiry. This has been a very nice and helpful community.

I look forward to the progress Haskell makes.

I do a lot of text processing. I currently have a few million files and
4-6gb of data to process. I need excellent string support.

It seems for me at this present time and with my knowledge and time
constraints that Python will be the practical choice.

I will continue to slowly work my way through the tutorials and expand
my understanding. Maybe someday Haskell and I will converge at a place
where I am more capable and it is more ready for me.

Until that day I wish all of you the best and may Haskell grow, mature
and prosper in its acceptance, libraries and community.

I think that as more practical applications such as darcs are produced
that Haskell's mindshare will grow.

Again, Thanks.

Jimmie
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Tomasz Zielonka
In reply to this post by Bulat Ziganshin
On Tue, Dec 06, 2005 at 10:58:45PM +0300, Bulat Ziganshin wrote:
> the third-priority problem is language itself. in particular, i hate
> Haskell school of imperative manipulations:
>
> x' <- readIORef x
> y' <- readIORef y
> writeIORef z (x'*y')

Some day you may thank for this verbosity, because it encourages
you do program in a purely functional way making your program more
friendly for SMP execution.

> i already sayed about lacking of OOP features.

Besides Haskell I also write in C++, and there I haven't yet found a
good use for deep subtyping hierarchies. Most of my class hierarchies
consist of a single abstract root and a group of concrete children.
These kind of OO is easily expressible even in Haskell 98.

> another weakness against Erlang and scripting languages is their more
> dynamic character which sometimes is more appropriate,

Then use those scripting languages! I don't want Haskell's semantics
to be "whatever is appropriate in this context".

Best regards
Tomasz

--
I am searching for a programmer who is good at least in some of
[Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

greenrd
On Wednesday 07 December 2005 19:35, Tomasz Zielonka wrote:

> On Tue, Dec 06, 2005 at 10:58:45PM +0300, Bulat Ziganshin wrote:
> > the third-priority problem is language itself. in particular, i hate
> > Haskell school of imperative manipulations:
> >
> > x' <- readIORef x
> > y' <- readIORef y
> > writeIORef z (x'*y')
>
> Some day you may thank for this verbosity, because it encourages
> you do program in a purely functional way making your program more
> friendly for SMP execution.

You are mistaken. The verbosity is necessary if you want "visual" referential
transparency, but not necessary if you only want pure functional programming.
Only the latter is helpful for optimisability. I am hoping to write a paper
on this topic.

Regards,
--
Robin
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Learning Haskell

Sebastian Sylvan
On 12/7/05, Robin Green <[hidden email]> wrote:

> On Wednesday 07 December 2005 19:35, Tomasz Zielonka wrote:
> > On Tue, Dec 06, 2005 at 10:58:45PM +0300, Bulat Ziganshin wrote:
> > > the third-priority problem is language itself. in particular, i hate
> > > Haskell school of imperative manipulations:
> > >
> > > x' <- readIORef x
> > > y' <- readIORef y
> > > writeIORef z (x'*y')
> >
> > Some day you may thank for this verbosity, because it encourages
> > you do program in a purely functional way making your program more
> > friendly for SMP execution.
>
> You are mistaken. The verbosity is necessary if you want "visual" referential
> transparency, but not necessary if you only want pure functional programming.
> Only the latter is helpful for optimisability. I am hoping to write a paper
> on this topic.
>

I probably wouldn't mind some syntax along the lines of

-- x,y :: IOref a
x := y

translated to

v <- readIORef y
writeIORef x y

and

-- x :: IOref a , y :: a
x := y

translated to

writeIORef x y


Of course it should carry over to STM (TVar) and ST etc. Maybe even
allow the right-hand-side to have type "IO a" and make "Num a => IORef
a" instances in Num to allow expressions like

x := y + z

Where x, y and z are IORefs or regular values.

As long as the result of := (or any numeric operators involving
IORefs) is always an IO computation it's still safe.

It may make it harder for people to grasp the difference between an
IORef and a regular value though...

/S


--
Sebastian Sylvan
+46(0)736-818655
UIN: 44640862
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
12