The tag has no usage guidance.

learn more… | top users | synonyms

11
votes
6answers
653 views

Make a long type signature

Challenge Find an expression, at most 100 bytes long, with the longest type signature. Rules Any statically typed language with type inference is allowed The type must be non-ambiguous, but ...
0
votes
3answers
141 views

Define map in the fewest tokens [closed]

map is a very basic yet important function in functional programming. All FP programming languages have it built-in but it is always fun to see how shortly you can define it yourself. This will be ...
21
votes
9answers
744 views

Implement functional programming paradigms

Your company is just getting started on a project, and for the first time you decided to go use a functional programming code-style. However your boss is really diffident and doesn't want to use built-...
6
votes
6answers
438 views

Most concise way to fold tree structures

Background (F#) Let there be trees: type Tree<'T> = Node of 'T * Tree<'T> list Now lets fold them nicely with a function called... foldTree f:('a -> 'b -> 'c) -> g:('c -> '...
-2
votes
1answer
125 views

Compare array of decimal sum of Integers and exact fractional part

Develop a program which takes two arrays of decimal numbers, and compare the sum of whole numbers only and the decimal part. If the sums of the whole numbers are the same, and the decimal parts of ...
6
votes
5answers
254 views

Write biSp in point-free form using as few terms as possible

The Haskell function biSp has type signature biSp :: (a -> c) -> (b -> d) -> (c -> d -> e) -> a -> b -> e and (for those who prefer combinator calculus) can be defined as ...
15
votes
3answers
2k views

Shortest a -> b -> (a -> b) function in Haskell

I got this question at a test: Write a function f with the following type a -> b -> (a -> b). a and b should not be bound in any sense, the shorter the code, the better. I came up with this:...
6
votes
11answers
395 views

Write a function that reduces compositions of linear operators

You are given two functions g(x) and h(x), each of which takes an integer x and returns the number ax + b (where a and b are integers defined in the function). Your task is to write a function f(g, h)...
8
votes
5answers
385 views

Golfed fixed point combinator

Write a fixed point combinator in as few characters as possible, in the language of your choice. free form (i.e., whatever's shortest): whole program, actual function, code snippet you may not use ...