๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.functional
Article #1094

How do i approach this problem?

#1094
From: Konrad Den Ende
Date: Mon, 17 Feb 2003 18:57
38 lines
2921 bytes
I have a very strong feeling that i already asked the question i'm
about to ask now but failed to comprehend or memorize the answer.
Therefore i appologize in advance if anybody already has been kind
enough to explain this to me before. Please share your wisdom again   :)

I can build a list by  [xs | xs <- [[1,2,3],[4,5,6]]] and am happy with the
outcome. Now what i'd like to do is being able to process xs BEFORE it
"hits the market". I've tried among many things (including screaming
loudly at my computer and kicking a garbage can) this:
[x:xs | xs <- [[1,2,3],[4,5,6]], x <- head xs]
thinking, "hey, we pick the first element of the list and then the first
element of the first element, and then put them togehter to form a new
list". The computer regarded that as stupid and claimed "unification would
give infinite type", which wasn't any good since i don't even understand
what that means, so my machine is probably just trying to show-off.

I ment the outcome to be [[1,1,2,3],[4,4,5,6]] and i have two questions.
1) What should i do to trick my computer into doing what i want?
2) What does the stupid machine think i was trying to tell it to do?
If possible, please adjust the answer to a level suitable for a banana or
any other object with IQ not greater than that.
--

V๏ฟฝnligen
Konrad
---------------------------------------------------
phone #1:  (+46/0) 708 - 70 73 92
phone #2: (+46/0) 704 - 79 96 95
url: http://konrads.webbsida.com
e-mail: chamsterkonrad@bigfoot.com
-----------------------------------

Sleep - thing used by ineffective people
            as a substitute for coffee

Ambition - a poor excuse for not having
                 enough sence to be lazy
---------------------------------------------------
Technical Details
Message-ID: <b2rbba$6dc$1@news.gu.se>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!logbridge.uoregon.edu!news.stupi.se!news.stupi.se!News-Peer-Europe!news.sprintlink.net!luth.se!news-stoc.telia.net!news-stoa.telia.net!telia.net!newsfeed.sunet.se!news01.sunet.se!news.chalmers.se!news.gu.se!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 107f24,a907e0b23c6eca41,start
X-Google-Attributes: gid107f24,public
X-Google-Thread: 10f6e0,a907e0b23c6eca41,start
X-Google-Attributes: gid10f6e0,public
X-Google-ArrivalTime: 2003-02-17 11:00:16 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.cs.ubc.ca!logbridge.uoregon.edu!news.stupi.se!news.stupi.se!News-Peer-Europe!news.sprintlink.net!luth.se!news-stoc.telia.net!news-stoa.telia.net!telia.net!newsfeed.sunet.se!news01.sunet.se!news.chalmers.se!news.gu.se!not-for-mail
From: "Konrad Den Ende" <chamsterkonrad@bigfoot.com>
Newsgroups: comp.lang.functional,cth.dtek.general
Subject: How do i approach this problem?
Date: Mon, 17 Feb 2003 19:57:44 +0100
Organization: Gothenburg University
Lines: 44
Message-ID: <b2rbba$6dc$1@news.gu.se>
NNTP-Posting-Host: giraffen.ostkupan.studenthem.gu.se
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2720.3000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000