Will Ness profile image
4497
Reputation: 35049

Will Ness


O Gℎ, !

YOUR LANGUAGE IS NOT high-level ENOUGH

primes =[2..] \[[p², p²+p..] | p <- primes]

((g<=<f)=<<) = (g=<<) . (f=<<) = join . (g<$>) . join . (f<$>)

(<$>) :: (a -> b) -> f a -> f b ; (<*>) :: f (a -> b) -> f a -> f b ; (=<<) :: (a -> m b) -> m a -> m b ; ($) :: (a -> b) -> a -> b

in a declarative language,
length(a) == 0 is the same as null(a),
and [y | x <- [1..], y <- []] is just [].

apply (FUNARG lambda env) xs a = apply lambda xs env

(g ~~>! h) f x = case g x of [] -> f x; (y:_) -> h y

1:foldr (\n s->fix (merge s.(n:).map (n*))) [] [2,3,5]

ordfactors = foldr g [1] . reverse . primePowers where

slice hi w = (c, sortBy (compare `on` fst) b) where


What's in a powerset? A set's subsets...


(define (call/cc-cps proc k) (proc k k))

(define (list . xs) xs)


How Monads are considered Pure?

Monads are EDSLs:
do { [1,2,3] ; [4,5] } => do { x <- [1,2,3] ; do { y <- [4,5] ; return y }} => {for x in [1,2,3] : {for y in [4,5] : {yield y}}} => [4,5,4,5,4,5]

StackOverflow Profile