Thanks, this is great. I added it to the OP. Also, drat, I really need to get into Elm more!
|
|
# ? May 3, 2015 20:59 |
|
|
# ? Apr 26, 2024 05:56 |
|
a monad is a monoid in the category of endofunctors
|
# ? May 3, 2015 22:57 |
|
Is this thread a monad?
|
# ? May 3, 2015 23:45 |
|
I'll mo your nad.
|
# ? May 4, 2015 14:54 |
|
Malcolm XML posted:a monad is a monoid in the category of endofunctors This is the best way I've ever seen this explained. You don't even need to know anything about anything, just read it as unknown symbols and you can see what that quote is getting at:
|
# ? May 4, 2015 15:16 |
|
fart simpson posted:This is the best way I've ever seen this explained. You don't even need to know anything about anything, just read it as unknown symbols and you can see what that quote is getting at: Thanks, this is unironically helpful. At first it looks like a bunch of gibberish, but I've convinced myself that I understand it after staring at it for a bit.
|
# ? May 4, 2015 16:30 |
|
I really think whoever devised the wikipedia definition of monad should be shot. Math articles on Wikipedia in general are impenetrable gibberish.
|
# ? May 4, 2015 16:38 |
|
Yeah, they're rarely a good way to learn anything new.
|
# ? May 4, 2015 16:40 |
|
Math articles on wikipedia read like they were written by someone jacking off to how much smarter they are than everyone else. I guess it is supposed to be a reference, not a text book, but Its hard to find math text books that aren't too advanced or too basic. I'm trying to relearn modern algebra, this book is excellent in terms of being fast paced without assuming too much about how much you already know. http://www.amazon.com/gp/product/0486474178
|
# ? May 4, 2015 16:53 |
|
This was kind of covered earlier with the haskell course from UPenn, but are there other sources of "homework assignments" in functional languages? I can read a book until I'm blue in the face but it's useless without something to work on. Nothing too big either, I don't want to write some giant program that I could have done in any other language, I just want to have the important features highlighted in the assignment. This is one of the reasons I didn't really like learn you a haskell/erlang. It talked about a lot of stuff but that's pretty much fluff, I would have preferred a helpful reference and some assignments.
|
# ? May 6, 2015 04:18 |
|
Eeyo posted:This was kind of covered earlier with the haskell course from UPenn, but are there other sources of "homework assignments" in functional languages? I can read a book until I'm blue in the face but it's useless without something to work on. Nothing too big either, I don't want to write some giant program that I could have done in any other language, I just want to have the important features highlighted in the assignment. This is one of the reasons I didn't really like learn you a haskell/erlang. It talked about a lot of stuff but that's pretty much fluff, I would have preferred a helpful reference and some assignments. I really liked Write Yourself a Scheme in 48 Hours
|
# ? May 6, 2015 04:45 |
Real World Haskell has some exercises as well.
|
|
# ? May 7, 2015 02:30 |
|
Just a note about Elm, I've found this set of tutorials, Elm By Example and I wished I'd started here. I like the idea behind Elm so far, but it's in version 0.15 and it shows. A lot of rough around the edges stuff. I'm going to stick with it though.
|
# ? May 8, 2015 17:06 |
|
HappyHippo posted:Just a note about Elm, I've found this set of tutorials, Elm By Example and I wished I'd started here. Yeah, I wouldn't use Elm for anything that "matters" yet. It's still pretty young and rapidly changing, with a major, compatibility breaking release about once every 3 months. But the core concept doesn't change, and that's what I really like about it.
|
# ? May 8, 2015 18:07 |
|
Does someone want to take a stab at explaining the ((->) a) instances for type classes like Functor and Monad 'cause I don't really get them still.
|
# ? May 8, 2015 18:58 |
|
rrrrrrrrrrrt posted:Does someone want to take a stab at explaining the ((->) a) instances for type classes like Functor and Monad 'cause I don't really get them still. I would also like to see this.
|
# ? May 8, 2015 20:20 |
|
Barnyard Protein posted:Math articles on wikipedia read like they were written by someone jacking off to how much smarter they are than everyone else. I guess it is supposed to be a reference, not a text book, but Its hard to find math text books that aren't too advanced or too basic. I just ordered this, thank you. I've heard good things about Algebra 0. I've started Algebra of Programming and it is very, very good. Harder to find though.
|
# ? May 8, 2015 20:32 |
|
rrrrrrrrrrrt posted:Does someone want to take a stab at explaining the ((->) a) instances for type classes like Functor and Monad 'cause I don't really get them still. Short answer: Don't use them. Long answer: For functor, fmap is (.). I've not yet found a case where this is useful per say, but it's a thing. Due to (subject to a slight renaming of the variables) code:
code:
code:
As with the monad instance, I'm not entirely sure - let's work out the types now (again, subject to the renaming): code:
In short, I've used (<>) and join for functions, and only to save a few characters in common use cases. One concrete use for join is, using Debug.Trace.traceShow (which bypasses the type system to print a value): code:
e: and let's just not talk about the function `fmap fmap fmap', also known as (.:) or (.).(.) or the boobs operator (which I have used more than the other mentioned functions here put together. I'll leave it as an exercise to figure out its type and what it does) gonadic io fucked around with this message at 22:05 on May 8, 2015 |
# ? May 8, 2015 20:59 |
|
As for when you'd actually use the monad instance for (-> r), the idea is you can have a single value that's implicitly passed to many different functions. What you'd actually use if you want this idea is the Reader monad.
|
# ? May 9, 2015 00:33 |
|
You mean ((->) r).
|
# ? May 9, 2015 00:35 |
|
Yes.
|
# ? May 9, 2015 00:48 |
So apparently facebook is re-writing their content classification code in Haskell. Pretty interesting to see the language in use by one of the bigger tech companies around!
|
|
# ? May 14, 2015 05:27 |
|
Yeah, that system is in production now. They had to force an eager approach to some data handling to avoid catastrophic runtime overload, recently: http://www.serpentine.com/blog/2015/05/13/sometimes-the-old-ways-are-the-best/
|
# ? May 14, 2015 16:13 |
|
Subjunctive posted:Yeah, that system is in production now. They had to force an eager approach to some data handling to avoid catastrophic runtime overload, recently: http://www.serpentine.com/blog/2015/05/13/sometimes-the-old-ways-are-the-best/ Asil Ching says: 2015-05-13 at 22:50 What the gently caress you are talking about man? Can you write a few lines that shows some education? Thunk your rear end you punk show off.
|
# ? May 14, 2015 17:53 |
|
AWWNAW posted:Asil Ching says: Well, he has a point.
|
# ? May 14, 2015 18:04 |
|
Subjunctive posted:Yeah, that system is in production now. They had to force an eager approach to some data handling to avoid catastrophic runtime overload, recently: http://www.serpentine.com/blog/2015/05/13/sometimes-the-old-ways-are-the-best/ its pretty ace
|
# ? May 14, 2015 20:53 |
|
There was an interesting talk/paper about that querying/parallelising/caching infrastructure given at ICFP last year: https://www.youtube.com/watch?v=jG9PWdV1wso
|
# ? May 15, 2015 01:11 |
|
Barnyard Protein posted:I'm trying to relearn modern algebra, this book is excellent in terms of being fast paced without assuming too much about how much you already know. http://www.amazon.com/gp/product/0486474178 I ended up buying this from your recommendation, and it (and some other mathy/cs books) just arrived today. Thanks for it, it looks really great so far
|
# ? May 15, 2015 05:24 |
Speaking of interesting math-y books, can anyone recommend a good book on category theory? I've been meaning to read up on it more.
|
|
# ? May 15, 2015 05:48 |
|
Category theory is a waste of time.
|
# ? May 15, 2015 05:59 |
|
sarehu posted:Category theory is generally a waste of time if you are trying to get better at functional programming ftfy
|
# ? May 15, 2015 13:18 |
I'm not really interested in reading it for functional programming purposes--I just thought this thread would be a good place to ask since there is an overlap between the two subjects.
|
|
# ? May 15, 2015 13:51 |
|
VikingofRock posted:Speaking of interesting math-y books, can anyone recommend a good book on category theory? I've been meaning to read up on it more. Don't know how I've seen this recommended. I read the first two posts and it seemed pretty good.
|
# ? May 16, 2015 17:01 |
|
I don't know if any other functional programmers run into this problem, but I have a really hard time deciding which language I want to use for new projects. My two main choices are Racket and Haskell. I think that Racket programs can be developed much faster because of the minimal syntax, dynamic typing and macro system. But they're less safe than Haskell programs, which have static typing and pure functions. Are there any languages that are a compromise between the two, like a statically-typed, purely functional Lisp language? I'm trying to get into Typed Racket and I figure I could use the monad library for side effects. The benefit I see is that I can start with an untyped program and add types as needed. xtal fucked around with this message at 22:55 on May 18, 2015 |
# ? May 18, 2015 22:41 |
|
I've used both, Haskell is faster because it has good syntax, static typing, and is advanced enough that it doesn't need to resort to a macro system to do basic programming tasks.
|
# ? May 19, 2015 00:43 |
|
VikingofRock posted:Speaking of interesting math-y books, can anyone recommend a good book on category theory? I've been meaning to read up on it more. I haven't looked too deeply at either of them, but I hear good things about Conceptual Mathematics and Category Theory for the Sciences.
|
# ? May 20, 2015 00:29 |
|
xtal posted:I don't know if any other functional programmers run into this problem, but I have a really hard time deciding which language I want to use for new projects. My two main choices are Racket and Haskell. I think that Racket programs can be developed much faster because of the minimal syntax, dynamic typing and macro system. But they're less safe than Haskell programs, which have static typing and pure functions. Maybe it's because I've hardly used Racket, but I certainly don't find that programming in dynamically typed languages is faster.
|
# ? May 20, 2015 05:21 |
|
I have never used Racket, but I have written 10000+ SLOC programs in Common Lisp and 10000+ SLOC programs in Haskell. While Common Lisp is more powerful, I have come to prefer Haskell. If you sit down and think about your data structures in advance, the difference in power is not significant, and Haskell does give you more peace of mind. You will, at times, curse some of the shortcomings of Haskell, just like you will curse the shortcomings of any language. But if you know Lisp, you would know that it could be fixed with proper macros. Yes, there is Template Haskell, but that is a horrible place, and you must never go there.
|
# ? May 20, 2015 10:07 |
|
Template Haskell is, as a colleague put it, "the simplest possible thing that could work". It's got a horrible notion of hygiene, a bad interface, and a frankly unfortunate usage pattern. The paper is also a jumbled mess of "but it's like C++ templates", instead of just admitting that they really want syntax-case but don't want to try to get that together and working.
|
# ? May 20, 2015 19:38 |
|
|
# ? Apr 26, 2024 05:56 |
I've been thinking about implementing Conway's Game of Life in Haskell. Does anyone have any recommendations for graphics libraries to use?
|
|
# ? May 30, 2015 00:30 |