Functional Programming & Math: General

haskell.org/
schemers.org/Documents/#intro-texts
scala-lang.org/
elm-lang.org/
miranda.org.uk/
functionalgeekery.com/
clojure.org/
en.wikipedia.org/wiki/Category_theory
jobs.functionalworks.com/#/job-board

Other urls found in this thread:

seas.upenn.edu/~cis194/fall14/spring13/index.html
bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/
jobs.functionalworks.com/#/job-board/585
programmers.stackexchange.com/questions/267086/is-every-language-written-in-c
rosettacode.org/wiki/Sorting_algorithms/Quicksort#Scala
rosettacode.org/wiki/Sorting_algorithms/Quicksort#Haskell
rosettacode.org/wiki/Sorting_algorithms/Quicksort#F.23
rosettacode.org/wiki/Mutual_recursion#Scala
rosettacode.org/wiki/Mutual_recursion#Haskell
rosettacode.org/wiki/Mutual_recursion#F.23
rosettacode.org/wiki/Palindrome_detection#Scala
rosettacode.org/wiki/Palindrome_detection#Haskell
rosettacode.org/wiki/Palindrome_detection#F.23
rosettacode.org/wiki/Remove_lines_from_a_file#Haskell
rosettacode.org/wiki/Remove_lines_from_a_file#Scala
rosettacode.org/wiki/Remove_lines_from_a_file#F.23
twitter.com/SFWRedditGifs

Let the functional programming goddess save this board from retards and degeneracy.

I know a thing or two about Haskell and abstract algebra. Happy to answer any questions!

What are closed cartesian categories? The definitions I've read made little sense.

What resources are the best place to learn abstract algebra?

A Book of Abstract Algebra by Charles Pinter
How to Bake Pi

also consider How to Prove It for general mathematical thinking

Category theory isn't my strong suit, but something like:

A CCC is a category with a terminal object - in Hask that's ()
and products - in Hask that's pairs
and exponentials - in Hask that's functions.

You can do a form of currying:
((a,b) -> c) -> a -> b -> c
and uncurrying:
(a -> (b -> c)) -> (a,b) -> c

Currying and uncurrying form what's called an adjunction.

Thanks for the book recommendation and response. I'm not that advanced in Haskell yet, can you explain this in english?

If that explanation didn't make sense, then you probably don't need to know about CCCs. Most Haskell programmers don't know any category theory at all. It is sort of a myth that has come about because the more famous members of the Haskell community like Edward Kmett tend to talk a lot about category theory.

It would probably be a better use of your time to learn Haskell, instead.

I recommend CIS194 - 2013 edition:
seas.upenn.edu/~cis194/fall14/spring13/index.html

And if you're hungry for more exercises, try the NICTA course:
www.github.com/NICTA/course

Ok thanks for the resources.

Haskell is shit. A programming language is supposed to be first and foremost useable above all else. Meanwhile Haskell does its best to be a Turing tar pit language.

Lisp > Haskell

>hasklel
>turing tar pit

nice meme

Without an advanced type system such as Haskell's, I can't even define the abstractions I rely on on a daily basis, such as Traversable Alternative, and Functor.
Types are documentation that cannot get stale.

Requiring programmers to be experts in type theory is a failure of the language designer. Programming languages are supposed to be for creating things, not jerking off.

You don't need to be an expert in type theory. Most professional Haskell programmers have never learnt any type theory. These are practical, composable abstractions, with many motivating examples.

I go back and forth.

I like reading Haskell but writing Lisp

Whenever there is something serious I need to get done though, I reach for Lisp. Lazy evaluation and a forced functional paradigm hold me back too much.

If you like Haskell but you want a strict programming language, try Idris. It also has some extra type system features, which make it worth learning about.
What about laziness do you dislike? (genuine question)
I hope you know there are strictness annotations to make certain parts of data structures strict, and strict variants of most data structures (Data.Map.String, Data.Bytestring.Strict, ...)
A good rule of thumb is strict data, lazy functions.
A lot of people don't like lazy IO. Its performance can be unintuitive. An iteratee library like Pipes would give you compositional strict IO.

Why do you feel like FP holds you back? How do you structure your Haskell programs?

>If you like Haskell but you want a strict programming language
You really don't get it, do you?

I really like the look of haskell (sometimes) but I am already a lisp converse.
And not even a Scheme guy but a CL man.
I'm interested in that it's based on category theory or type theory or whatever it is. I'd love to see a formal spec of the language as a mathematical entity, you know? Something that's thorough but concise.
Have anything for me babe?

...

Anyone know a good book on type theory or category theory for someone with no experience in either?

I've got a pretty good foundation in set theory, formal logic and automata

category theory for computer scientists by, er... just look it up in google it's right there

bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/

thanks man. I'm about to finish my degree, and I'm looking for books on the CS end of math to explore before I immediately forget everything

Unfortunately I never got to take combinatorics or linear algebra either :/

Who is this ugly cunt you keep putting on your Haskell threads?

Conceptual Mathematics is the best intro category theory book. The blog post series recommended earlier is also good.

what do I need to know to be considered proficient in haskell?
list in order of most importance to least important

nice AMA, faggot

>>>/reddit/

kys faggot
its almost like you're new and saw someone say "go back to plebbit" and now you wanna try it because you think is cool

try F#

nvidia or amd?

>I'm a newfag, the post

now you fucking retard you did a literal ama on Sup Forums you need to leave now this place is already almost unusable because of people like you

Not even him, but kys. You are the fucking problem, instead of letting people discuss functional programming you know in a functional programming general you just come here to insult because you are a butthurt fagott. Let people learn, he is teaching them what they dont know, but here comes the memer cockgoblin whot thinks he is better than the rest. Kys

>posts an fb image
I don't wanna shit up thread, so this is going to be my last post replying to your faggotry.
anyways, his post has value to the thread because it creates discussion pertaining to the thread

I'd agree with you if it was a "the best girl is Maki, prove me wrong" post
so please, stop being a faggot and don't shit up the thread by defining what a gentoo man is.
nobody gives a shit

>Microshit

...

...

Category Theory: Awodey - Category Theory

Type Theory: Pierce - Types and Programming Languages

I wrote a chess engine in C++ once. The hard part was the chess not the programming. OOP let's you write code so easily, since it maps to real life concepts.

Now I'm trying to rewrite the engine in lisp and I can't think of a natural way structure the program.

How would you represent the pieces and their legal moves? The state of the board? I looked at a github project and I swear the code is read only - so much nesting and unnamed functions...

Also any very basic GUI packages for board and piece movement?

>In March 2015, former VP of the Platform Engineering group at Twitter Raffi Krikorian, stated he would not have chosen Scala in 2011 due to its learning curve.[110] The same month, LinkedIn SVP Kevin Scott stated their decision to "minimize [their] dependence on Scala."[111] In November 2011, Yammer moved away from Scala for reasons that included the learning curve for new team members and incompatibility from one version of the Scala compiler to the next.[112]

>minimise our dependence on scala
that's just code for we will hire a herd of pajeets to write java instead of competent developers to write something that's actually good

instead of flying cars we get 140 characters thanks to Raffi

you look at the entire board
you analyse the state of the board based on where each piece is

depending on who's turn it is you do one of two things

you make your move, or you let the other player move

It is about strictness and less "magic"
jimplush.com/talk/2015/12/19/moving-a-team-from-scala-to-golang/

In large teams this is important, of course functional languages work well in small teams (

Java 8+ basically killed Scala
the scala experiment failed

>How to Prove It
>free as in free beer
based

how can it be hard?

what does oop have that other paradigms don't have?

I don't think Java 8 killed Scala. Kotlin is going to be Scala's killer.

linkedin moved to java from scala (which they moved from java before that)

but yea I am sure they will move to kotlin after that

> of course functional languages work well in small teams (

Why are you guys saying scala is dying? Honest question, dont really know much about it

I don't know but you can get paid $170,000/yr in NY to be a Scala engineer:

jobs.functionalworks.com/#/job-board/585

>jobs.functionalworks.com/#/job-board/585

Why doesn't mention the startup name?

Sounds like a honey trap for recruiters. I don't see similar job offerings on other websites.

what is typed lambda calculus?

I honestly can't even decipher what this pic is trying to convey

People are used to it. That's all.

lol. That's a lot like saying "windows with bash killed linux." Java 8's functional aspects are incomplete and it still can't really work as a purely functional language. I don't know a single person that switched to Java because of new Java 8 features

learning python and c++, why haskell?

My teacher says that c is the ultimate language because it is as low as you can get previous to assembly.

Educate me to some extent if you are learned, and infographs for visual are appreciated.

Scala's not a purely functional language either. It's OO with syntactic sugar.

> "ultimate language"

Oh, man. Is this bait?

no. His philosophy is that most languages are written in a fork of 'c' anyways.

Please explain or enlighten me.

> all languages a fork of c

Well, I don't know enough about compilers to go into detail about where languages come from, but I do know enough to be bothered by that statement. Have you ever heard of bootstrapping? A lot of languages are literally written in themselves.

Additionally, reductionism helps no one and hurts everyone in most situations. For instance, before a language is bootstrapped, it may be written in C. But C had to go through the same process when as well (not sure if it was written in pure assembly or not). This is a really shitty rabbit hole because then:

> C is the ultimate language. Everything else is a fork of C

> Assembly is the ultimate language. C is just a fork of assembly.

> Hexcode is the ultimate language. Assembly is just a fork of hexcode

> Binary is the ultimate language. Hexcode is just a fork of Binary

> Logic gates are the ultimate language. Binary is just a fork of Logic gates

see what I mean? Doing anything in C is a pain, and that's important. Try writing a web framework in C. You don't always need to go that low level. It seems ridiculous to argue that "abstraction is bad" in a system that is literally abstractions on top of abstractions and only progresses by adding additional abstractions. Sorry if that doesn't answer your question about haskell.

He probably means that since C is a low level language without features like garbage collection, which prevent programmers from making catastrophic and difficult to find mistakes, and higher-level imperative languages (usually object-oriented) share much their syntax with C, they are forks of C.

It's certainly not true of all languages.

With higher-level languages you can usually write code that is shorter, more appropriate for the problem domain, and easier to maintain. Dropping down to C lets you leverage higher performance.

High level languages are just for people who can't into C. C is indeed the ultimate language. Every language is implemented in C. Compilers are written in C (or C++, eg clang).

programmers.stackexchange.com/questions/267086/is-every-language-written-in-c

Nice try faggot. You're objectively wrong, and you're just going to get more and more wrong as time goes on

Honestly Scala is syntactically ugly as fuck for a functional programming language.

rosettacode.org/wiki/Sorting_algorithms/Quicksort#Scala
rosettacode.org/wiki/Sorting_algorithms/Quicksort#Haskell
rosettacode.org/wiki/Sorting_algorithms/Quicksort#F.23

rosettacode.org/wiki/Mutual_recursion#Scala
rosettacode.org/wiki/Mutual_recursion#Haskell
rosettacode.org/wiki/Mutual_recursion#F.23

rosettacode.org/wiki/Palindrome_detection#Scala
rosettacode.org/wiki/Palindrome_detection#Haskell
rosettacode.org/wiki/Palindrome_detection#F.23

rosettacode.org/wiki/Remove_lines_from_a_file#Haskell
rosettacode.org/wiki/Remove_lines_from_a_file#Scala
rosettacode.org/wiki/Remove_lines_from_a_file#F.23

To be fair though this comparison isn't exactly very scientific, I'm just clicking random pages.

Those aren't quicksort. Quicksort is an in-place sort.

...

Doing it in-place would mean side-effects - the very thing functional programming helps us avoid. If you wanna control flow by hand, you can stick to your imperative language of choice.

...

When your language can't do something, you redefine its meaning.

An all-purpose language is a useless language.

I have a profile there - you can only see the companies' names after your profile is approved.

What company is it? I'm generally curious different user here

>I can’t even say what’s wrong with Haskell, because— okay. Imagine you have uh, a toolbox. A set of tools. Looks okay, standard stuff in there.

>You pull out a screwdriver, and you see it’s one of those weird tri-headed things. Okay, well, that’s not very useful to you, but you guess it comes in handy sometimes.

>You pull out the hammer, but to your dismay, it has the claw part on both sides. Still serviceable though, I mean, you can hit nails with the middle of the head holding it sideways.

>You pull out the pliers, but they don’t have those serrated surfaces; it’s flat and smooth. That’s less useful, but it still turns bolts well enough, so whatever.

>And on you go. Everything in the box is kind of weird and quirky, but maybe not enough to make it completely worthless. And there’s no clear problem with the set as a whole; it still has all the tools.

underrated post

Algebra Chapter 0 by Aluffi.

>I can’t even say what’s wrong with Haskell
or because you dont know the language :^)

I got p. pissed when a functional programing twitter ad bot followed me.

>using the smiley with a carat nose

Machine Learning >>> functional programming

python and cuda/c are used to produce research (ML related) orders of magnitude more relevant then all the empty PL papers you keep regurgitating

Haskell is to programming as masturbation is to sex.

"more relevant" to what exactly?
and what does machine learning even have to do with functional programming? that's like saying "HTML is superior to C++"

You like this more?
def qsort[T ls(0)))
}


I agree Scala is not that nice, but it's not even ugly as fuck as you say. Some syntax is optional (like the dot to call a method) and this is the main problem in my opinion.

I bet you never tried to pass a method as a parameter. Java 8 functional style sucks.

meant for

Ok

Why use Java 8?