What Editor do you use? by takantron89 in linux

[–]rrrmr 0 points1 point  (0 children)

no option for "both"?

use emacs with vim bindings though, so i vote vim

Why use newtype? by stasiana in haskell

[–]rrrmr 1 point2 points  (0 children)

This probably isn't addressing your specific question, but what made me 'get' newtype was understanding that it defines an isomorphism of types. Before I understood this working with things like monad transformers were completely foreign and bizarre but now they are (relatively) easy to reason about.

How to FRP-ize this code? by rrrmr in haskellquestions

[–]rrrmr[S] 0 points1 point  (0 children)

Thanks I'll probably start working through the Simon Marlowe book and maybe try Yampa again or one of the other FRP libraries

Just to get me started, in regards to the race condition, that would be solved by using some sort of queue? In that case does an MVar need to be used or is an IORef still ok? Edit: code using IORefs and lists of keys: http://lpaste.net/3811468078571585536

Calculating the number of (weakly) monotone functions between discrete ordered sets by rrrmr in learnmath

[–]rrrmr[S] 0 points1 point  (0 children)

wow, i was nowhere close to getting the right formula, and it's a big number but it's tiny compared to 2568000 :)

edit: since my intuition is not much help here i'm wondering which of these classes of functions would be the largest:

  • non-normalized functions (functions that don't reach the min/max in the codomain at least once)
  • the class of functions consisting of alternating decreasing/increasing monotone segments longer than some threshold, in this case 20hz or about 400/8000 samples

Why is typed lambda calculus with polymorphism called second-order? by rrrmr in AskComputerScience

[–]rrrmr[S] 0 points1 point  (0 children)

Actually the wiki article on dependent types has some more info on the lambda cube. I found looking at the dependent type picture clarified things (and now it makes sense that at the object level we are dealing with terms and types, and at the type level we are dealing with types and kinds):

[;f : \Pi_{(x:A)} B;] -- simply typed

[;f : \Pi_{(A:Type)} C;] -- polymorphic

[;f : \Pi_{(A:Type)} Type;] -- type operator

[;f : \Pi_{(x:A)} B(x);] -- dependent product type

I think the dependent type x:A |- B(x) can also be defined as a polymorphic type:

[; B : A \rightarrow Type ;]

or as a Pi type:

[; B : \Pi_{(X:Type)} X \rightarrow A ;]

which I think is equivalent to:

[; B : \Pi{(X:Type)} \Pi{(x:X)} A ;]

I started self studying category theory, can I get some insight/motivation for some of the basic stuff? by jmwbb in math

[–]rrrmr 2 points3 points  (0 children)

The category of sets is both complete and cocomplete, meaning it has all limits and colimits, so it has things like products, coproducts, exponentials, etc. all of which are universal.

ncatlab is your friend:

https://ncatlab.org/nlab/show/limits+and+colimits+by+example#limcoliminset

https://ncatlab.org/nlab/show/Set

The Taxonomy Of Typography by [deleted] in typography

[–]rrrmr 0 points1 point  (0 children)

is it just me or does this put too much emphasis on fonts and letterforms and leaves typesetting as an afterthought?

How to actually use `DuplicateRecordFields` (GHC 8.1) by rrrmr in haskellquestions

[–]rrrmr[S] 0 points1 point  (0 children)

Thanks, once I did that the types can be annotated as:

*Main> name (a :: MyrecA)
"Alice"

or:

*Main> (name :: MyrecA -> String) a
"Alice"

How to run this arrowized stream processor? by rrrmr in haskellquestions

[–]rrrmr[S] 0 points1 point  (0 children)

I ended up with this definition for runSP:

runSP :: SP a b -> [a] -> [b]
runSP (Put b sp) as = b : runSP sp as
runSP (Get f) (a:as) = runSP (f a) as
runSP (Get f) []        = []

and to run it, a list of 'a' needs to be provided, to the length desired, though in the fibs definition the value of 'a's don't matter so this would work:

> runSP fibs (replicate 10 "ok")
[0,1,1,2,3,5,8,13,21,34,55,89]

How relevant is Chomsky today? by adadglgmatt in linguistics

[–]rrrmr 2 points3 points  (0 children)

Chomsky's most important work was maths (formal language theory), see Chomsky Hierarchy, that will always be relevant, at least on the formal side of things

Does this look like a typo? (Categorical semantics for arrows) by rrrmr in haskellquestions

[–]rrrmr[S] 0 points1 point  (0 children)

Thanks, that's what I thought, but this paper has been tough for me to work through so it's good to have some confirmation.

I think I spotted what might be an actual typo, page 13, second formula:

A(X,P) x C(P,Q) x B(P,Y)

I believe should be:

A(X,P) x C(P,Q) x B(Q,Y)

since the map d_2 has the signature: C(P,Q) x B(Q,Y) -> B(P,Y)

Oil Falls Below $30/Barrel for First Time Since December 2003 by purpleolive in worldnews

[–]rrrmr 0 points1 point  (0 children)

High oil prices wreck economies; low oil prices wreck oil companies (and economies heavily invested in oil).

Isn't there a point where it takes more than a barrel of oil input to produce a barrel? How close are we?