Re: Beginners Digest, Vol 27, Issue 57

Ahaaa, the heureka moment. Stupid me, I should have tried :t null Thanks Brent! On 9/27/2010 6:00 PM, beginners-request@haskell.org wrote:
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-request@haskell.org
You can reach the person managing the list at beginners-owner@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: matching the output of a standard function to my function definition (non-exhaustive pattern problem) (Brent Yorgey)
----------------------------------------------------------------------
Message: 1 Date: Mon, 27 Sep 2010 12:21:08 -0400 From: Brent Yorgey
Subject: Re: [Haskell-beginners] matching the output of a standard function to my function definition (non-exhaustive pattern problem) To: beginners@haskell.org Message-ID:<20100927162108.GA5408@seas.upenn.edu> Content-Type: text/plain; charset=us-ascii On Mon, Sep 27, 2010 at 06:15:22PM +0200, Martin Tomko wrote:
Dear Daniel that worked perfectly, thanks for the suggestion!
One more question: how do you use null to check for empty lists? something like [] == null did not work ... just chekcing, I got my orignal code to work, thanks again! Martin
When in doubt, consult the types!
null :: [a] -> Bool
That is, null is a function for testing lists to see whether they are empty. So rather than 'list == null' you write 'null list'.
-Brent
------------------------------
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 27, Issue 57 *****************************************
-- Martin Tomko Postdoctoral Research Assistant Geographic Information Systems Division Department of Geography University of Zurich - Irchel Winterthurerstr. 190 CH-8057 Zurich, Switzerland email: martin.tomko@geo.uzh.ch site: http://www.geo.uzh.ch/~mtomko mob: +41-788 629 558 tel: +41-44-6355256 fax: +41-44-6356848
participants (1)
-
Martin Tomko