Idris eager evaluation

We say Idris has strict evaluation, but this is for its run-time semantics. Being a fully dependently typed language, Idris has two phases where it evaluates things, compile-time and run-time. At compile-time it will only evaluate things which it knows to be total (i.e. terminating and covering all possible inputs) in order to keep type … Read more

What is the relationship between unboxed types and strictness?

Unboxed vs Boxed Data To support parametric polymorphism and laziness, by default Haskell data types are represented uniformly as a pointer to a closure on the heap, with a structure like this: (source: haskell.org) These are “boxed” values. An unboxed object is represented by the value itself directly, without any indirection or closure. Int is … Read more

Math in Vim search-and-replace

Something like this? :%s/^\(\d\d\):\(\d\d\)/\=submatch(1)*60+submatch(2)/ When the replacement starts with a \= the replacment is interpreted as an expression. :h sub-replace-expression is copied below Substitute with an expression *sub-replace-expression* *sub-replace-\=* When the substitute string starts with “\=” the remainder is interpreted as an expression. This does not work recursively: a substitute() function inside the expression cannot … Read more

Is it possible to execute a string in MySQL?

I think you’re looking for something like this: SET @queryString = ( SELECT CONCAT(‘INSERT INTO user_group (`group_id`,`user_id`) VALUES ‘, www.vals) as res FROM ( SELECT GROUP_CONCAT(qwe.asd SEPARATOR ‘,’) as vals FROM ( SELECT CONCAT(‘(59,’, user_id, ‘)’) as asd FROM access WHERE residency = 9 ) as qwe ) as www ); PREPARE stmt FROM @queryString; … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)