Adblock breaks this site

Functional Programming

Discussion in 'Programming General' started by SuF, Jun 9, 2014.

  1. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    I love it. Haskell is by far my favorite language. Anyone else tried it or do it?
     
  2. Blupig

    Blupig BEEF TOILET
    $5 USD Donor

    Joined:
    Nov 23, 2006
    Posts:
    7,145
    Referrals:
    16
    Sythe Gold:
    1,609
    Discord Unique ID:
    178533992981594112
    Valentine's Singing Competition Winner Member of the Month Winner MushyMuncher Gohan has AIDS Extreme Homosex World War 3 I'm LAAAAAAAME
    Off Topic Participant
    Functional Programming

    I poked around F# a bit out of curiosity...Didn't like it. We'll be doing Haskell next year in my degree program. Not looking forward to it :p
     
  3. Darkest Dream

    Darkest Dream I prefer to have my nightmares with open eyes.
    Darkest Dream Donor

    Joined:
    Jun 26, 2013
    Posts:
    7,457
    Referrals:
    1
    Sythe Gold:
    544
    Vouch Thread:
    Click Here
    Discord Unique ID:
    624783392625524785
    Sythe RSPS Player Two Factor Authentication User In Memory of Jon Christmas 2015 Doge Halloween 2013 Sythe's 10th Anniversary Off Topic Participant Gohan has AIDS
    Heidy Lawrence
    Functional Programming

    I had to google this, looks kind of terrible to try and lean...
     
  4. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    Hit me up if you need help. I hated it at first until I went back to it. You can to think about issues in a completely different way. But map and folds are fucking awesome.
     
  5. xhulic

    xhulic Forum Addict

    Joined:
    Oct 6, 2009
    Posts:
    380
    Referrals:
    0
    Sythe Gold:
    65
    Vouch Thread:
    Click Here
    Discord Unique ID:
    615053642453483532
    Discord Username:
    spodey#0001
    Two Factor Authentication User
    Functional Programming

    Check out Clojure. Recently learnt it at my internship. Hated it first. Then found it out how amazing functional languages can be.
     
  6. Imagine

    Imagine Grand Master

    Joined:
    May 31, 2010
    Posts:
    3,375
    Referrals:
    4
    Sythe Gold:
    5
    Chess Master
    Functional Programming

    I <3 Haskell!

    Its like writing out math!

    I thought I'd always be a Python-masterrace person, but not anymore!
     
  7. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    Same with me and Haskell. Hated it until I kept doing it.

    It really is. I am a Haskell master race sort of person now.
     
  8. Imagine

    Imagine Grand Master

    Joined:
    May 31, 2010
    Posts:
    3,375
    Referrals:
    4
    Sythe Gold:
    5
    Chess Master
    Functional Programming

    It seems like a hassle to learn at first, but it really changes the way you think about stuff. Like whenever I do python now I just think "Why doesn't this have a very convenient takeWhile" etc etc.

    Also the annotations are really nice.
     
  9. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    Yes. It is a whole different way of looking at problems. I also hate for loops now. Iterators are also stupid. Map is the the way of the future.
     
  10. Caseus

    Caseus Member
    Banned

    Joined:
    Jun 17, 2014
    Posts:
    39
    Referrals:
    0
    Sythe Gold:
    0
    Functional Programming

    Haskell's fun if you're good at math.
    It's just weird to me, compared to other things.
     
  11. Imagine

    Imagine Grand Master

    Joined:
    May 31, 2010
    Posts:
    3,375
    Referrals:
    4
    Sythe Gold:
    5
    Chess Master
    Functional Programming

    >inb4 iterate is a function in haskell

    Code:
    f x 
        | even x = x/2
        | odd x = (x*3) + 1
    
    take 5 . iterate f $ 23
    lel (inb4 code doesn't work - I haven't run this).

    But yes, I agree with you.
     
  12. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    They have their place but I find map much more useful.
     
  13. Imagine

    Imagine Grand Master

    Joined:
    May 31, 2010
    Posts:
    3,375
    Referrals:
    4
    Sythe Gold:
    5
    Chess Master
    Functional Programming

    yeah, me too. I really like how you can use map to construct types and currying functions etc instead of just applying a function to a list of values.
     
  14. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    Yea. Abstracting away what a for loop essentially does is epic. It allows you to do such powerful stuff. Monads are another great example. Abstract shit enough and it all fits a very similar mold.
     
  15. CallMeNick

    CallMeNick Active Member
    Banned

    Joined:
    Jun 23, 2014
    Posts:
    211
    Referrals:
    0
    Sythe Gold:
    2
    Functional Programming

    I've only ever done java, js, html, php. Read of functional but never got into it
     
  16. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    You can use underscore.js to write JS in a more functional way.
     
  17. Imagine

    Imagine Grand Master

    Joined:
    May 31, 2010
    Posts:
    3,375
    Referrals:
    4
    Sythe Gold:
    5
    Chess Master
    Functional Programming

    .
     
    Last edited: Aug 16, 2022
  18. SuF

    SuF Legend
    Pirate Retired Global Moderator

    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary
    Functional Programming

    I wouldn't know off the top of my head. You can look at this source: http://hackage.haskell.org/package/base-4.7.0.1/docs/src/Data-List.html#permutations

    It seems kinda ugly but that is in the GHC standard library.
     
< How to Prevent Windows From Restarting Without Your Permission | Need Help With Creating Website! >


 
 
Adblock breaks this site