Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'languages.': 0.04; 'say,': 0.05; 'subject:Python': 0.06; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'jan': 0.12; '"real"': 0.16; 'lambda': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'subject:Programming': 0.16; 'variations': 0.16; 'exception': 0.16; 'sat,': 0.16; 'language': 0.16; 'wrote:': 0.18; '(but': 0.19; 'feb': 0.22; 'programming': 0.22; 'header:User- Agent:1': 0.23; 'sort': 0.25; '15,': 0.26; 'header:X-Complaints- To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'programmers': 0.33; 'noticed': 0.34; 'core': 0.34; 'but': 0.35; 'programming,': 0.36; 'scheme': 0.36; 'subject:one': 0.36; 'done': 0.36; 'subject:?': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'functional': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'users': 0.40; 'subject:Can': 0.60; 'new': 0.61; 'received:173': 0.61; 'kind': 0.63; 'sum': 0.64; 'more': 0.64; 'different': 0.65; 'love': 0.65; 'brain': 0.68; 'optimized': 0.68; 'sam': 0.68; 'heavy': 0.81; 'received:fios.verizon.net': 0.84; 'old,': 0.85; 'stretch': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Can one use Python to learn and even apply Functional Programming? Date: Sun, 16 Feb 2014 03:40:24 -0500 References: <3fd33e3a-7774-4988-b725-4fed5472ac94@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-254-207.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 26 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392540068 news.xs4all.nl 2976 [2001:888:2000:d::a6]:37359 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66520 On 2/16/2014 1:38 AM, Devin Jeanpierre wrote: > On Sat, Feb 15, 2014 at 8:45 PM, Sam wrote: >> I would like to learn and try out functional programming (FP). I love Python and would like to use it to try FP. Some have advised me to use Haskell instead because Python is not a good language for FP. I am sort of confused at the moment. Is Python a dysfunctional programming language to apply FP? Can the more experienced Python users advise? > > Everything about FP that can be done in, say, Scheme, can be done in > Python, with the exception of tail recursion (but that isn't important You can do tail recursion in Python, but it will not be noticed and optimized in the way it is is some functional languages. > for "real" FP). But Scheme is old, and people keep thinking of new > things and more interesting variations on the lambda calculus. > > Haskell is kind of the core of modern functional programming, and > involves heavy use of concepts that do not exist or are visibly alien > in Python. If you want to learn FP properly, you should learn Haskell. > Otherwise you will likely be confused when you overhear functional > programmers talking, whether it's about Hindley-Milner or sum types or > eta conversion. In some ways, Haskell is more different from Python than Scheme is, so it may stretch your brain more. -- Terry Jan Reedy