Why are λ-calculus optimal evaluators able to compute big modular exponentiations without formulas?

The phenomenon comes from the amount of shared beta-reduction steps, which can be dramatically different in Haskell-style lazy evaluation (or usual call-by-value, which is not that far in this respect) and in Vuillemin-Lévy-Lamping-Kathail-Asperti-Guerrini-(et al…) “optimal” evaluation. This is a general feature, that is completely independent from the arithmetic formulas you could use in this particular … Read more

Haskell Type vs Data Constructor

In a data declaration, a type constructor is the thing on the left hand side of the equals sign. The data constructor(s) are the things on the right hand side of the equals sign. You use type constructors where a type is expected, and you use data constructors where a value is expected. Data constructors … Read more

Handling List-types with Esqueleto

Esqueleto is NOT meant to handle list of sublists (multidimensional list) out of the box yet! Data.List.groupBy that ‘cdk’ advised to you can group only list itself, but not what you was asking for. For your case I would insistently advise you to use a classic SQL queries. You can run n+1 queries, but do … Read more