daniel gratzer

Jun 5, 2014 15:47
I suppose that's almost the "Haskell zen"
Jun 5, 2014 15:42
Jun 5, 2014 15:42
@JimmyHoffa It's essentially a generalization over foldr and unfoldr, it's got mathy names (cata, ana, ..) but it's not terrible
Jun 5, 2014 15:36
@JimmyHoffa Have you looked at recursion-schemes yet? I've been having a lot of fun with it for the last 2 weeks :D
Jun 5, 2014 15:33
@MichaelT I see what your saying.. yeah I might do that, I can't fit all my books in my dorm :(
Jun 5, 2014 15:33
@ratchetfreak I'm fairly certain in my little suburb they'd send in riot police :P
Jun 5, 2014 15:31
Trying to figure out how to move all my crap... it's going to be an adventure
Jun 5, 2014 15:30
@JimmyHoffa CMU actually :) (I got into both, ended up choosing cmu) and yep!
Jun 5, 2014 15:28
Hi all
Apr 17, 2014 16:59
Also Hi Everybody
Apr 17, 2014 16:59
@JimmyHoffa Yep, I lived about 3 blocks away from that square over the summer.
Mar 18, 2014 17:21
Everything is seg-faulting D:
Mar 10, 2014 22:21
I heard monad and OCaml
Mar 10, 2014 19:59
Hi all
Mar 3, 2014 14:42
@WorldEngineer More Self, though it is one a few dynamic languages with mostly working closures which is nice :)
Mar 3, 2014 14:38
Oh god help me, I'm starting to enjoy some javascript
Feb 28, 2014 16:41
@JimmyHoffa Did my rant above make much sense? I was somewhat asleep when I wrote it :$
Feb 28, 2014 04:02
btw I do believe Foldable is the relevant typeclass here
Feb 28, 2014 04:02
This is clearly not the case for all functors so not all functors give rise to a catamorphism
Feb 28, 2014 04:02
So essentially, a cata exists whenever the F-algebra F a -> a exists
Feb 28, 2014 04:01
this is normally called cata.
Feb 28, 2014 04:01
It turns out elim is actually the most useful and has the type

elim :: Functor f => Alg f a -> Fix f -> a
elim :: Functor f => (f a -> a) -> Fix f -> a
Feb 28, 2014 04:00
hom :: Functor f => Alg f a -> Fix f -> f a
hom alg = fmap elim . unfix
    where elim = alg . fmap elim . unfix
Feb 28, 2014 03:56
Sorry, between the carriers of alg and initAlg which are f a and Fix f respectively
Feb 28, 2014 03:52
Now using this, we need to prove that for every algebra alg :: Alg f a, there is a map between initAlg and alg
Feb 28, 2014 03:51
type Alg f a = f a -> a
initAlg :: Alg f (Fix f)
initAlg = Fix
Feb 28, 2014 03:51
In our case, we're interested in a specific initial algebra, which is given by
Feb 28, 2014 03:33
An initial algebra is one with a unique map to all algebras in the group we're considering. A catamorphism is the unique homomorphism from the initial F-algebra to all others.]
Feb 28, 2014 03:27
data Tree a = Leaf a | Branch (Tree a) (Tree a)
Feb 28, 2014 03:27
The classic example of a catamorphism comes from the functor
Feb 28, 2014 03:26
Think of it this way, let's consider a functor `F`, an F-algebra for F is

type FAlg a = F a -> a
Feb 28, 2014 03:26
@JimmyHoffa I'm not so sure. A functor is simply a mapping yes, a catamorphism is meant to model a mapping from an initial algebra to any algebra in a category. A functor can give rise to an F-algebra, but need not necessarily. For example if IO give rise to an F-algebra unsafePerformIO is trivially derived.
Feb 26, 2014 01:09
Oddly enough the OP didn't care haha
Feb 26, 2014 01:09
Fair enough
Feb 26, 2014 01:03
Thanks for mentioning it though :)
Feb 26, 2014 01:03
@GlenH7 Fair enough, yeah it didn't realize it would upset that many people :$
Feb 25, 2014 21:11
@JimmyHoffa To my understanding it seems that they actually do prefer lists. Seqs are lists :) So map filter etc are all operating on lists, it's just htat if you're doing access by index or whatever, vector is way more efficient
Feb 25, 2014 19:47
@YannisRizos So automating is probably just redundant then.
Feb 25, 2014 19:46
Seems fair, trolls are annoying/distracting
Feb 25, 2014 19:45
@YannisRizos And at that point I can't imagine the community hasn't notified you with some form of "stop trolling".
Feb 25, 2014 19:43
@YannisRizos Is there a consequence after a certian number of flags? Like "comment banning" or something? Because if so I'd definitely want to know that I'm being annoying before being banned/punished
Feb 25, 2014 19:40
@YannisRizos Oh alright, that's what I was hoping for. Ignore me :)
Feb 25, 2014 19:39
@Ampt hmm fair, I just thought of that.. though there's the same risk with closed/deleted questions and that doesn't happen too much
Feb 25, 2014 19:32
RFC, deleted comments should notify the poster? My comment got deleted (probably fairly, sorry about that) but I wouldn't know about it if I didn't go back to delete it myself..
Feb 25, 2014 18:40
@JimmyHoffa yeah :( I'm particularly sad when it's PHP as their blub.. trying to argue with PHP fanatics makes me sad on the inside
Feb 25, 2014 18:36
Yeah.. I'd expect that more in Scala than clojure htough
Feb 25, 2014 18:33
Lisps have never really been gung-ho on ADTs
Feb 25, 2014 18:33
@JimmyHoffa Possible, I suspect that the clojure community is in two camps. "Java with lambda + macros" and "Common lisp/Scheme with Java access"
Feb 25, 2014 18:24
@JimmyHoffa Fun, suggestion, Hoogle type app for clojure? Based on your question it could come in handy
Feb 25, 2014 18:22
@JimmyHoffa Learning Clojure?