haskell,functional-programming,pointfree

Conal's blog post boils down to saying "non-functions are not functions", e.g. False is not a function. This is pretty obvious; if you consider all possible values and remove the ones which have a function type, then those that remain are... not functions. That has absolutely nothing to do with...

There's a tool called pointfree on hackage, which helps you tremendously (see also the wiki). It creates the following version: multTable = map (flip map [1..12] . (*)) [1..12] How do we get there? Well, lets move operators a little bit and try to apply flip on your function till...

f#,pointfree,partial-application,tacit-programming

The F# compiler distinguishes between let-bindings of functions, which have parameters, and values, which do not have parameters. Value definition: A binding like let a = ... is a value definition. Its body is evaluated eagerly, "where it is", before the evaluation of anything further down the code. Function definition:...

You should pass (+) to uncurry: add :: (Int, Int) -> Int add = uncurry (+) This is because uncurry is a function that takes a binary function and returns an unary function: uncurry :: (a -> b -> c) -> ((a, b) -> c) Your binary function is (+)...

haskell,functional-programming,pointfree

The pointfree version of id is... well, id. id is often taken as a fundamental operator in pointfree constructions, a sort of a primitive upon which more combinators are constructed. If you really want, you can reconstruct id from other more complex operators, e.g. exploiting the Monad ((->) a) instance:...

f#,pointfree,partial-application,tacit-programming

I can only think of a few times you'd ever need to worry about the distinction between A -> B and (A -> B) (see the F# spec's section on signature conformance for related commentary): When you want to implement a module signature, only a syntactic function can serve as...

f#,pointfree,partial-application

Add a swap operator/function: let swap f = fun x y -> f y x let aList = [2;4;6;8] let mut = aList |> List.map (swap (/) 2) ...