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.  Functional analysis and design (Martin Drautzburg)
   2.  Haskell connectTo problem (Alexander 0xAX)
   3. Re:  Haskell connectTo problem (Kim-Ee Yeoh)
   4. Re:  Functional analysis and design (Gianfranco Alongi)
   5. Re:  Haskell connectTo problem (Brandon Allbery)
   6. Re:  Functional analysis and design (Rustom Mody)


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

Message: 1
Date: Sat, 5 Jan 2013 12:10:22 +0100
From: Martin Drautzburg <martin.drautzb...@web.de>
Subject: [Haskell-beginners] Functional analysis and design
To: Haskell Beginners <beginners@haskell.org>
Message-ID: <201301051210.22888.martin.drautzb...@web.de>
Content-Type: Text/Plain;  charset="us-ascii"

Hello all,

often, when I read tutorials or lectures about haskell, I am absolutely 
intrigued by the solutions presented there. It often creates this "aha" effect 
and I think "yes, this perfectly describes the problem to solve, this is what 
the problem IS".

But alas, I have difficulties to come up with equally brilliant solutions for 
my own problems. As for learning haskell, I am now pretty comfortable with it, 
but I fail to apply it to real world problems.

I am pretty good at semantic data modelling, but this technique gives me 
nothing but trouble, when I try to apply it in the functional world (while it 
works well in the OO world).

What I am trying now it asking "what do I want the system to compute in the 
first place" and then think about how to implement these top-level functions. 
Do you think that this is a good way to start?

Other than that I was trying to find some information about haskell as a 
specification language, but could not find anything. Is this a sensible idea 
at all? If not, how would you write a specification if not in haskell itself?

So if you have any pointers on how to address a non-trivial problem in 
haskell, this would by much appreciated.

-- 
Martin



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

Message: 2
Date: Sat, 5 Jan 2013 19:25:16 +0600
From: Alexander 0xAX <anotherworldofwo...@gmail.com>
Subject: [Haskell-beginners] Haskell connectTo problem
To: beginners@haskell.org
Message-ID:
        <cafpzw88_h951eaxuhmqonawycv8eqhp8jotnz9rcpfegc+-...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello,

I try to connect to host:

>>> connectTo "httpbin.org" (PortNumber 80)
{handle: <socket: 8>}

It's ok. But if i try to connect:

>>>connectTo "httpbin.org/ip" (PortNumber 80)
*** Exception: getAddrInfo: does not exist (Name or service not known)

Why i got this error?

Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130105/28e5dec3/attachment-0001.htm>

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

Message: 3
Date: Sat, 5 Jan 2013 21:10:37 +0700
From: Kim-Ee Yeoh <k...@atamo.com>
Subject: Re: [Haskell-beginners] Haskell connectTo problem
To: Alexander 0xAX <anotherworldofwo...@gmail.com>
Cc: "beginners@haskell.org" <beginners@haskell.org>
Message-ID:
        <CAPY+ZdTB447j=x1di02rdeuvew2iujnizrfwxqry-rfa88p...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Not knowing anything about the package or the function, my guess is
connectTo wants a domain name, not a URL, because it proceeds to do a DNS
lookup on exactly that.

You probably want a different function. There's something called simpleHTTP
or thereabouts.

-- Kim-Ee


On Sat, Jan 5, 2013 at 8:25 PM, Alexander 0xAX <
anotherworldofwo...@gmail.com> wrote:

> Hello,
>
> I try to connect to host:
>
> >>> connectTo "httpbin.org" (PortNumber 80)
> {handle: <socket: 8>}
>
> It's ok. But if i try to connect:
>
> >>>connectTo "httpbin.org/ip" (PortNumber 80)
> *** Exception: getAddrInfo: does not exist (Name or service not known)
>
> Why i got this error?
>
> Thank you.
>
> _______________________________________________
> 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/20130105/261c28db/attachment-0001.htm>

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

Message: 4
Date: Sat, 5 Jan 2013 15:57:15 +0100
From: Gianfranco Alongi <gianfranco.alo...@gmail.com>
Subject: Re: [Haskell-beginners] Functional analysis and design
To: Martin Drautzburg <martin.drautzb...@web.de>
Cc: Haskell Beginners <beginners@haskell.org>
Message-ID:
        <CALs9xayMfs0Wmw+67EzxhG10hwa4M=rmjvynsx3n-xbcpsg...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

You will seldom find the 'best' solution immediately - remember that
lectures are prepared
and so is most of the things you see.

Write something that works, then make it pretty,
if you can prove by numbers (measurements) that it needs/can be
optimized, do it.

For this reason, I do TDD - building a set of regression
tests which I can lean on for refactoring.

G

On Sat, Jan 5, 2013 at 12:10 PM, Martin Drautzburg <martin.drautzb...@web.de
> wrote:

> Hello all,
>
> often, when I read tutorials or lectures about haskell, I am absolutely
> intrigued by the solutions presented there. It often creates this "aha"
> effect
> and I think "yes, this perfectly describes the problem to solve, this is
> what
> the problem IS".
>
> But alas, I have difficulties to come up with equally brilliant solutions
> for
> my own problems. As for learning haskell, I am now pretty comfortable with
> it,
> but I fail to apply it to real world problems.
>
> I am pretty good at semantic data modelling, but this technique gives me
> nothing but trouble, when I try to apply it in the functional world (while
> it
> works well in the OO world).
>
> What I am trying now it asking "what do I want the system to compute in the
> first place" and then think about how to implement these top-level
> functions.
> Do you think that this is a good way to start?
>
> Other than that I was trying to find some information about haskell as a
> specification language, but could not find anything. Is this a sensible
> idea
> at all? If not, how would you write a specification if not in haskell
> itself?
>
> So if you have any pointers on how to address a non-trivial problem in
> haskell, this would by much appreciated.
>
> --
> Martin
>
> _______________________________________________
> 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/20130105/57c5125b/attachment-0001.htm>

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

Message: 5
Date: Sat, 5 Jan 2013 10:20:43 -0500
From: Brandon Allbery <allber...@gmail.com>
Subject: Re: [Haskell-beginners] Haskell connectTo problem
To: Alexander 0xAX <anotherworldofwo...@gmail.com>
Cc: beginners@haskell.org
Message-ID:
        <CAKFCL4UrJK=f-jDaW7_Gn-5VRasJBd+XxnW=5a_s28w+eag...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Sat, Jan 5, 2013 at 8:25 AM, Alexander 0xAX <
anotherworldofwo...@gmail.com> wrote:

> >>>connectTo "httpbin.org/ip" (PortNumber 80)
> *** Exception: getAddrInfo: does not exist (Name or service not known)
>

connectTo is not a web browser, but low level TCP/IP; it wants a hostname,
and only a hostname.  If you wanted to write a web browser or HTTP fetch
utility, you would connectTo the host on port 80 and then conduct an HTTP
exchange to GET /ip.

There are higher level libraries if you want to use HTTP without writing it
yourself.

-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20130105/e47a7272/attachment-0001.htm>

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

Message: 6
Date: Sun, 6 Jan 2013 12:43:14 +0530
From: Rustom Mody <rustompm...@gmail.com>
Subject: Re: [Haskell-beginners] Functional analysis and design
To: Martin Drautzburg <martin.drautzb...@web.de>
Cc: Haskell Beginners <beginners@haskell.org>
Message-ID:
        <caj+teoc_rbmhma_pzs2imkbhzuv2czq0ry0qbe8safxb2if...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

On Sat, Jan 5, 2013 at 4:40 PM, Martin Drautzburg
<martin.drautzb...@web.de>wrote:

> Hello all,
>
> often, when I read tutorials or lectures about haskell, I am absolutely
> intrigued by the solutions presented there. It often creates this "aha"
> effect
> and I think "yes, this perfectly describes the problem to solve, this is
> what
> the problem IS".
>
> But alas, I have difficulties to come up with equally brilliant solutions
> for
> my own problems.


Human learning is far more mimetic than we realize.
See one master and one goes: This is incredible!
See 10 and one starts picking up small patterns they use
See 100s (or a few over long periods) and one starts becoming like them.

A favourite example of mine:
Today J S Bach is regarded as the pinnacle of western classical music.
When he was a young man he spent much of his time just copying out 'the
masters'
(in quotes because today they are not regarded today in the same category
as Bach.

So go ahead -- keep getting awed by masterly 'works of (functional) art'



> As for learning haskell, I am now pretty comfortable with it,
> but I fail to apply it to real world problems.
>
> I am pretty good at semantic data modelling, but this technique gives me
> nothing but trouble, when I try to apply it in the functional world (while
> it
> works well in the OO world).
>
> What I am trying now it asking "what do I want the system to compute in the
> first place" and then think about how to implement these top-level
> functions.
> Do you think that this is a good way to start?
>
> Other than that I was trying to find some information about haskell as a
> specification language, but could not find anything. Is this a sensible
> idea
> at all? If not, how would you write a specification if not in haskell
> itself?
>
> So if you have any pointers on how to address a non-trivial problem in
> haskell, this would by much appreciated.
>
>
Dont underestimate the trivial.
One of the difficulties with modern haskell is that advanced type hackery
is taking so much center-stage that simple stuff is getting neglected.

I have a page of 'basic stuff' that is good nourishment to all (not just
functional) programmers:
http://blog.languager.org/2012/10/functional-programming-lost-booty.html

My favourite books are Bird and Wadler and Chris Reade  Martin Henson (yes
that gives away my age!)  And of course spj's bible on implementation, not
so much for the implementation as for the foundations.

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



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

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

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


End of Beginners Digest, Vol 55, Issue 5
****************************************

Reply via email to