Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
momentoftop
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
61.
▲
by
momentoftop
4y ago
Is there any plan to have effect types like in koka, where the effects that a function performs are visible in the type, and handling an effect eliminates it from the function's type?
62.
▲
OCaml 5.0 Alpha Release
(discuss.ocaml.org)
226 points
by
momentoftop
4y ago
|
121 comments
63.
▲
by
momentoftop
4y ago
I don't like REPL driven development. REPLs are celebrated as some sort of achievement in interactivity, but they're hopelessly puny, barely imitating a UNIX shell. When I write Emacs Lisp, I don't have a REPL. I just put poi
64.
▲
by
momentoftop
5y ago
> You'll see why it's useful to have a formal justification for treating isomorphic objects as equal (this is called "univalence"), which is something you may have even been doing informally/subconsciously all al
65.
▲
by
momentoftop
5y ago
Here's a pure computation: import Data.List (nubBy) refuteGoldbach :: Integer refuteGoldbach = head $ [ n | n <- [4,6..] , not $ n `elem` [ p1 + p2 | p1 <- pr
66.
▲
by
momentoftop
5y ago
To disagree with the post: I have always wanted to run my own servers. But for most of my time on the internet, my upload speeds have been garbage, my IP addresses have been dynamic, and my computers have been behind NATs. The basic netwo
67.
▲
by
momentoftop
5y ago
I did my PhD at Edinburgh, and my second supervisor was a proud Scotsman. I had a sentence in my thesis that began "Under the hood..." He wrote in the margin: "bonnet?" I immediately corrected it, and have since been hyp
68.
▲
by
momentoftop
5y ago
Not the parent, but I think if you tried to do Nix in Haskell, the syntax would be seriously gross. For starters, you couldn't use Haskell's record syntax for Nix's sets, because they're not Haskell records. Types wouldn
69.
▲
by
momentoftop
5y ago
It's certainly possible to express some of these ideas in other languages, but implementations are nowhere near as ubiquitous or idiomatic as in Haskell, where they pervade the standard library and most people's code. And I'd
70.
▲
by
momentoftop
5y ago
Good points. But I'd note that Haskell's infrastructure around Functor isn't typical of functional languages. Specifically in Haskell, I think it's pretty important to have an idea what functors, monoids and monads are,
71.
▲
by
momentoftop
5y ago
Right. Things could be headed off early where the blog defines a monoid. The definition given is roughly what the average mathematician would call a monoid, but a category theorist would complain saying that it only defines a monoid in the
72.
▲
by
momentoftop
5y ago
Conal Elliott wasn't making fun of pure functional programming zealots. Elliott is a pure functional programming zealot, and was making fun of Haskellers who defend the IO type as a purely functional way to express effects. He thinks
73.
▲
by
momentoftop
5y ago
Many programmers will tell you that you can live with no type system at all, and they would be correct. Personally, as an Ocaml coder, I make extensive use of Ocaml's fancier type-system features and would be sad to lose them.
74.
▲
by
momentoftop
5y ago
Last I looked, Ocaml's upcoming effect system is untyped, so doesn't really belong in the discussion.
75.
▲
by
momentoftop
5y ago
HOL Light doesn't have subtyping. If the type system had subtyping, there would be terms that are assigned two different types, where one type is a subtype of the other. So, in a truly subtyped system, you would have it that 3 has both
76.
▲
by
momentoftop
5y ago
"Eternalism" refers to the static "block universe" conception of spacetime, where all events exist simultaneously, past, present and future. "Presentists", by contrast, hold that the past no longer exists, the
77.
▲
by
momentoftop
5y ago
The F# module system is just as incapable compared to SML. The SML and Ocaml module systems provide higher-kinding which isn't present in F#. And if you don't have functors, you're not SML/Ocaml.
78.
▲
by
momentoftop
5y ago
I wish that anyone trying to teach logic would emphasise that there are many, many possible formal systems for any particular logic, and there is absolutely no standard. That way, confused readers won't end up on places like /r&#x
79.
▲
by
momentoftop
5y ago
Haskell and the Nix language are both pure and lazy extensions of lambda calculus, but that's an enormous language space, and Nix's lack of static types makes them pretty distant. For many Haskellers, I believe the interest stems
80.
▲
by
momentoftop
5y ago
Sometimes, the strategy of proving ~P by showing how P entails absurdity is called "proof by negation". The phrase "proof by contradiction" is then reserved for the strategy of proving P by showing how ~P entails absurdi
81.
▲
by
momentoftop
5y ago
I actually only know CL and Elisp. I played a bit with Clojure, and its Emacs story looks pretty solid, but I was thinking it might be difficult to translate idiomatic clojure code to Elisp when Clojure has more emphasis on purity. I'd
82.
▲
by
momentoftop
5y ago
Do you know any other lisps? I got by with the Elisp manual, but I already knew Common Lisp. Maybe a strategy is to find a great book teaching, say, scheme, and learn elisp after?
83.
▲
by
momentoftop
6y ago
Chris Martin is a Haskeller, and so will spend hardly any time writing type specifications. He'll let the compiler infer them. I'm very enthusiastic about static types with global type inference, where I don't have to write a
84.
▲
by
momentoftop
6y ago
I've always liked `mapAccumL`, and nowadays, it amuses that it is implemented by mapping with a state monad (and thus it works over arbitrary Traversables). With that precedent, I'm happy to implement the given problem using State
85.
▲
by
momentoftop
6y ago
I think that was when you were stuck in a prison with a high window. The typical exchange was: # say to Gandalf "carry me" GANDALF says no. GANDALF goes east. # wait You wait. Time passes... # wait Y
86.
▲
by
momentoftop
6y ago
Or if you want to avoid off-by-one errors, why not have a function: dotimes(n, () => button.click()) If anyone is in the habit of solving trivial constant space problems in linear space where n is expected to be over 100000, I d
87.
▲
by
momentoftop
6y ago
Haskell has strict limits on side-effects, but also abstracts these functions over the thing you're "forEaching." There, a reduce can't implement a map, because a map is required to return the same type of collection you
88.
▲
by
momentoftop
6y ago
The first programming course at Edinburgh is the Haskell course, taught in the first year in the first semester.
89.
▲
by
momentoftop
6y ago
> Think about it this way. If the primary importance of something is only apparent from the big picture how is a user supposed to decide whether to use it or not? The big picture is rarely available to most programmers. Maybe a user isn&
90.
▲
by
momentoftop
6y ago
You can't define the interface in either language. Implementations of Functor consist, in part, of type-level functions . In Haskell terms, these are "higher-kinded types". The standard example is the list type "[]"
More ›