Skip to main content
Will Ness's user avatar
Will Ness's user avatar
Will Ness's user avatar
Will Ness
  • Member for 13 years, 5 months
  • Last seen more than a month ago
Stats
71,060
reputation
9k
reached
6
answers
15
questions
Loading…
About

Empirical orders of growth, please!

In a declarative language,
length(a) == 0 is the same as null?(a),
and [y | x <- [1..], y <- []] is just [].
Any high-level language worth its salt must have Abstract Data Types with automatic O(1) append where possible, and efficient lists and strings. Otherwise, it is not high-level enough.

How to generate all the permutations of elements in a list one at a time in Lisp?

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

condU:(g ~~>! h) f x = case g x of [] -> f x; (y:_) -> h y
apply (FUNARG lambda env) xs a = apply lambda xs env
hammingSlice hi w = (c, sortBy (compare `on` fst) b) where
ordfactors = foldr g [1] . reverse . primePowers where
1:foldr (\n s->fix (merge s . (n:) . map (n*))) [] [2,3,5]

(define (call/cc& proc& k) (proc& k k))
(define (list . xs) xs)


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

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

Monads as generalized function application

How Monads are considered Pure?
Monads are EDSLs are Nested Loops are Trees:
do { [1,2,3] ; [4,5] } =>
do { x <- [1,2,3] ; do { y <- [4,5] ; return y }} =>
for x from [1,2,3] { for y from [4,5] { yield y }} =>
[ 4,5, 4,5, 4,5 ]

1
gold badge
19
silver badges
23
bronze badges
21
Score
9
Posts
43
Posts %
21
Score
3
Posts
14
Posts %
9
Score
13
Posts
62
Posts %
8
Score
3
Posts
14
Posts %
4
Score
5
Posts
24
Posts %
4
Score
4
Posts
19
Posts %
Top posts
View all questions and answers