juan_gandhi: (Default)
Seems like the site does not exist anymore. Sad. 

tweag

Dec. 17th, 2019 05:33 am
juan_gandhi: (Default)
Just discovered this company, which is in Paris. Really impressed. https://www.tweag.io/about
 
juan_gandhi: (Default)
http://github.com/qfpl/hpython

Хаскель на питоне.
Тони Моррис надыбал. 
juan_gandhi: (Default)
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)
Его на интервью спрашивают: список перевернуть можешь? А на каком языке, - спрашивает. Да на каком хочешь.

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

Его не взяли.
juan_gandhi: (Default)
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)
"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)
Джавасприпт, Хаскель и Скала, и, говорят, OCaml, из-за своей компактности, канают в качестве скриптовых языков.

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

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)


(10x [livejournal.com profile] _hacid_)

The list of references starts with Penrose.

author's page
juan_gandhi: (VP)
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)
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
"

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

June 2025

S M T W T F S
1 2345 6 7
8 9 10 11 121314
15161718 1920 21
22232425262728
2930     

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 26th, 2025 07:05 am
Powered by Dreamwidth Studios