juan_gandhi: (Default)
2020-09-11 09:46 pm
Entry tags:

wtf happened to ohaskell.ru?

Seems like the site does not exist anymore. Sad. 
juan_gandhi: (Default)
2019-12-17 05:33 am
Entry tags:

tweag

Just discovered this company, which is in Paris. Really impressed. https://www.tweag.io/about
 
juan_gandhi: (Default)
2019-06-13 09:46 pm
Entry tags:

самое интересное за сегодня

http://github.com/qfpl/hpython

Хаскель на питоне.
Тони Моррис надыбал. 
juan_gandhi: (Default)
2018-07-05 01:49 pm
Entry tags:

talking about functions in Haskell

on SO

TLDR:  there's no way you can define in set theory a function that does not return a result. (Actually you can, but then the whole sets axiomatics should be overhauled.)
juan_gandhi: (Default)
2018-06-05 10:15 am
Entry tags:

пошел раз Тони Моррис на работу устраиваться

Его на интервью спрашивают: список перевернуть можешь? А на каком языке, - спрашивает. Да на каком хочешь.

foldl (flip Cons) Nil - сказал Тони.

Его не взяли.
juan_gandhi: (Default)
2018-04-20 06:35 pm
Entry tags:

вопрос хаскельщикам

true x y = x
false x y = y

lampair :: a -> b -> (a -> b -> c) -> c
lampair x y p = p x y

pa :: ((a -> b -> c) ->c) -> a
pa p = p true


And I see
   • Couldn't match type ‘a’ with ‘c’
      ‘a’ is a rigid type variable bound by
        the type signature for:
          pa :: forall a b c. ((a -> b -> c) -> c) -> a
        at sample1.hs:8:1-30
      ‘c’ is a rigid type variable bound by
        the type signature for:
          pa :: forall a b c. ((a -> b -> c) -> c) -> a
        at sample1.hs:8:1-30
      Expected type: a -> b -> c
        Actual type: c -> b -> c
    • In the first argument of ‘p’, namely ‘true’
      In the expression: p true
      In an equation for ‘pa’: pa p = p true
    • Relevant bindings include
        p :: (a -> b -> c) -> c (bound at sample1.hs:9:4)
        pa :: ((a -> b -> c) -> c) -> a (bound at sample1.hs:9:1)
  |


What have I done wrong? What fails here? Is Hindley-Milner "not smart enough"? What am I missing?
juan_gandhi: (Default)
2017-08-29 04:00 pm

good news for fp-bashers

"total functional programming is not Turing-complete."

Kind of almost obvious. But you can tell all those haskellers that your Turing machine (unversal, of course) is a better busy beaver than their unreadable code. 
juan_gandhi: (Default)
2017-05-20 09:02 pm

кстати о языцех

Джавасприпт, Хаскель и Скала, и, говорят, OCaml, из-за своей компактности, канают в качестве скриптовых языков.

Питон в этом смысле тоже ничо, но там, во-первых, споткнуться можно много где, во-вторых, на уровне компиляции нам ничего не скажут. Это уже на продакшене ебанется. То-то квора, которая на питоне, деплоится по сто раз в час (а тесты потом гоняют, и кодревью тоже). 
juan_gandhi: (Default)
2017-01-08 12:49 pm
Entry tags:

list via codensity


List a = Codensity Endo a = forall r. (a -> r -> r) -> r -> r

nil :: List a
nil = \f z -> z

cons :: a -> List a -> List a
cons x xs = \f z -> f x (xs f z)

append :: List a -> List a -> List a
append xs ys = \f z -> xs f (ys f z)

foldr :: (a -> r -> r) -> r -> List a -> r
foldr f z xs = xs f z

Basically, it's like lambda.

Src: https://golem.ph.utexas.edu/category/2012/09/where_do_monads_come_from.html#c042100
juan_gandhi: (VP)
2016-09-24 03:13 pm
Entry tags:

io in lambda



(10x [livejournal.com profile] _hacid_)

The list of references starts with Penrose.

author's page
juan_gandhi: (VP)
2016-08-18 01:05 pm

now I'm totally confused

People started assuring me that Haskell streams may be empty. Meaning, not a comonad at all.
So, wtf, are they even monads? They also say a list can be infinite; well, any proof that it's still a monad? Not what you get if you build a free monoid (that's what a list is).

Or? Do they mean we actually need σ-algebras?!
juan_gandhi: (VP)
2016-05-31 04:03 pm
Entry tags:

A Very General Method of Computing Shortest Paths

http://r6.ca/blog/20110808T035622Z.html

"I would like to introduce you to a very general algorithm that I like to call the Gauss-Jordan-Floyd-Warshall-McNaughton-Yamada algorithm. With this simple algorithm (an algorithm whose implementation is not very much longer than its name) you can solve almost half of the problems you might encounter in computer science. For instance, this algorithm will let you:

- compute transitive closures
- compute shortest paths
- compute largest capacity paths
- compute most reliable paths
- compute the regular expression for a finite automaton
- solve linear equations
"