Link https://ericlippert.com/ Feed http://ericlippert.com/feed Updated 2017-10-17 15:02
 Excessive explanation, part twenty-four by ericlippert on 2017-03-23 14:19 (#2GTM8) We have four kinds of things in Exp: identifiers, function calls, lambdas and lets, and we have four rules in type inference. Finally, the last recursive rule of the type inference algorithm: (iv) If e is let x = e1 … Continue reading →
 Excessive explanation, part twenty-three by ericlippert on 2017-03-20 17:35 (#2GFZ1) Last time we gave the base case of our recursive algorithm. Today, two of the three non-base cases. But before we get to them, another annoyance. The first time I read this algorithm carefully I got to the second step … Continue reading →
 Excessive explanation, part twenty-two by ericlippert on 2017-03-16 14:13 (#2G2G9) All right, at long last, the type inference algorithm itself! Algorithm W. W(A, e) = (S, τ) where This is just a reminder that what we’re doing here is taking a set of assumptions that give types to identifiers, and … Continue reading →
 Excessive explanation, part twenty-one by ericlippert on 2017-03-13 14:47 (#2FQM4) All right; we have a deductive system whereby the types of expressions can be justified with derivations. What we want is the ability to take an expression and the typing assumptions of an environment and deduce the type scheme of … Continue reading →
 Happy anniversary Visual Studio! by ericlippert on 2017-03-08 23:44 (#2F7TS) Oh my goodness, I cannot believe it has been twenty years since I got this t-shirt: Happy anniversary Visual Studio, and congratulations to the whole team on VS 2017, and a particular shout-out to my Roslyn friends. I can’t wait … Continue reading →
 Excessive explanation, part twenty by ericlippert on 2017-02-23 15:44 (#2DPCR) Summing up the story so far: we have a formal system that allows us to start with the types of identifiers in an environment, and provide a series of deductive steps that ends the type of an expression. This is … Continue reading →
 Excessive explanation, part nineteen by ericlippert on 2017-02-21 15:11 (#2DEA2) We’ve just seen that we can use our deductive logic system with its rules TAUT, GEN, and so on, to start from knowing nothing, and end with a correct derivation of the type scheme of a complex expression. But here’s … Continue reading →
 Excessive explanation, part eighteen by ericlippert on 2017-02-16 15:18 (#2CX8V) Over the last two episodes we gave the rules of the deductive system. The paper now gives an example of using that deductive system to derive the type of a complicated expression. The way it is laid out on the … Continue reading →
 The chess mystery, solved by ericlippert on 2017-02-14 15:42 (#2CN8Q) Happy St. Valentine’s Day all. To solve the Smullyan retrograde chess puzzle posted yesterday, the first question to ask is “is the black king actually in check, or not?” In a great many retro problems the first task is to … Continue reading →
 Why should I be worried about dying? by ericlippert on 2017-02-13 17:50 (#2CHSZ) It’s not going to happen in my lifetime! Thus logician, philosopher and puzzle-constructor Raymond Smullyan, who died last week at the age of 97. I started reading Smullyan when I was a teenager; I don’t remember whether I read This … Continue reading →
 Excessive explanation, part seventeen by ericlippert on 2017-02-09 15:57 (#2C2ZY) Last time we discussed the syntax for logical deductions that is common in academia: facts above, deductions below, a line between them. We discussed the tautology rule and the instance rule. Today: more rules. A ⊢ e:σ GEN: ------------ ( … Continue reading →
 Excessive explanation, part sixteen by ericlippert on 2017-02-06 22:24 (#2BQT2) All right, so far we’ve mostly been talking about jargon and background information. Now we’re actually going to get into the meat of the thing here. What we want is (1) a formal definition of what logical steps we are … Continue reading →
 Excessive explanation, part fifteen by ericlippert on 2017-02-02 15:30 (#2B7AK) All right, we are getting through section four of this paper. Today: what is an “environment”? Now let Env = Id → V be the domain of environments η. Just to be clear, this is not a function in the … Continue reading →
 Excessive explanation, part fourteen by ericlippert on 2017-01-30 16:07 (#2ATKX) All right, finally we are getting to typing judgments, which are the bread and butter of type inference algorithms. We said in the previous episode that the values that are manipulated by a program written in Exp are either values … Continue reading →
 Excessive explanation, part thirteen by ericlippert on 2017-01-26 14:29 (#2AB2S) So far we’ve gotten through the introduction, the grammar of the Exp language, the grammar of the type description language, and what it means to make substitutions in type schemes. For the next few episodes we’ll consider the semantics of … Continue reading →
 Real Americans by ericlippert on 2017-01-24 19:34 (#2A3N5) We take a break from a detailed exegesis of a 40-year-old paper for a brief political message. Freakonomics did a poll to come up with a slogan for this country, and the winner was America: Our Worst Critics Prefer To … Continue reading →
 Excessive explanation, part twelve by ericlippert on 2017-01-19 14:25 (#29F9A) Last time we saw how we can make a substitution for a free variable to produce an instance of a type scheme. This time we’ll look at a much more powerful form of substitution. By contrast a type-scheme σ = … Continue reading →
 Excessive explanation, part eleven by ericlippert on 2017-01-17 14:20 (#296QS) Last time we learned what is meant by “free” and “bound” variables both in the context of the Exp language and the type scheme language. So, substitutions: If S is a substitution of types for type variables, often written [τ1/α1, … Continue reading →
 Excessive explanation, part ten by ericlippert on 2017-01-12 14:40 (#28MCJ) In this short section the paper gives a somewhat formal definition of what we mean by generic type substitution. You are of course familiar with the basic idea in C#: if you have delegate T MyDelegate(T t, List us); … Continue reading →
 Excessive explanation, part nine by ericlippert on 2017-01-09 17:10 (#288DJ) Last time we defined the grammar of our language “Exp”, which consists of identifiers, lambdas, function application and let expressions. This is a programming language. We also need a different language to formally describe types and “type schemes”. The paper … Continue reading →
 Excessive explanation, part eight by ericlippert on 2017-01-05 15:01 (#27S3J) Happy new year all, well enough chit chat, more type inference! Recall that we are going through the seminal paper on ML type inference line-by-line and explaining all the jargon and symbols. Last year we got through the introduction. 2 … Continue reading →
 Excessive explanation, part seven by ericlippert on 2016-12-22 14:57 (#26725) From the paper we’re studying: For simplicity, our definitions and results here are formulated for a skeletal language, since their extension to ML is a routine matter. For example recursion is omitted since it can be introduced by simply adding … Continue reading →
 Excessive explanation, part six by ericlippert on 2016-12-19 14:53 (#25TSD) Continuing with the question of how to deduce the “type scheme” of letrec map f s = if null s then nil else cons(f(hd s)) (map f (tl s)) Knowing the type schemes of null, nil, and so on. Let’s … Continue reading →
 Excessive explanation, part five by ericlippert on 2016-12-15 14:49 (#25C8A) Today, what’s the type of map given the types of its parts? The type checker will deduce a type-scheme for map from existing type-schemes for null, nil, cons, hd and tl; the term type-scheme is appropriate since all these objects … Continue reading →
 Another spicy interview by ericlippert on 2016-12-14 15:17 (#2582A) During my blog hiatus I also did a brief interview with Dot Net Curry magazine, which was a follow-up to their 2013 interview with me. Long-time readers will recognize the puzzle that I pose at the end!
 Excessive explanation, part four by ericlippert on 2016-12-12 14:44 (#24Z7H) Continuing with my excessively detailed explanation of type inference in ML… After several years of successful use of the language, both in LCF and other research, and in teaching to undergraduates, it has become important to answer these questions — … Continue reading →
 Excessive explanation, part three by ericlippert on 2016-12-08 14:39 (#24GMX) Continuing with my excessive explanation of type inference in ML… Here we answer the question in the affirmative, for the purely applicative part of ML. It follows immediately that it is decidable whether a program is well-typed, in contrast with … Continue reading →
 Impactfulness by ericlippert on 2016-12-07 15:45 (#24CDZ) The nice people at the New Jersey Institute of Technology asked a dozen people for some extremely brief thoughts on the impactfulness of computer programming in the coming economy, and were kind enough to include me among those dozen. And … Continue reading →
 I’m on fire! by ericlippert on 2016-12-06 15:31 (#247YD) Podcaster Dave Rael was kind enough to invite me to his geek interview podcast show “Developer On Fire” recently; we talk about developer tools and impact and blogging and all kinds of fun stuff. Check it out!
 Excessive explanation, part two by ericlippert on 2016-12-05 15:31 (#243H8) We continue with my excessively detailed explanation of the seminal paper on the ML type inference system… 1 Introduction This paper is concerned with the polymorphic type discipline of ML, which is a general purpose functional programming language, although it … Continue reading →
 Excessive explanation, part one by ericlippert on 2016-12-01 01:11 (#23QFJ) Well that was a long break! When I was studying for my Facebook interviews I realized that I was going to have no time to write in my blog if I got hired, so I wrote several dozen articles, batched … Continue reading →
 Shaft room, again by ericlippert on 2016-05-19 19:41 (#1EBCZ) > look In the middle this room a small shaft descends into darkness below. Above the shaft is a metal framework to which a heavy iron chain is attached. There are exits to the west and north. A foul odor … Continue reading →
 Ladder room by ericlippert on 2016-05-16 14:11 (#1DXQP) At the east end of this narrow passage, a ladder leads upward. There’s a strong draft from the west, where the passage narrows even further. There is a small pile of coal here. > take the coal Taken. > go … Continue reading →
 Coal mine by ericlippert on 2016-05-06 13:22 (#1CZAA) This is a nondescript part of a coal mine. Someone carrying a large bag is casually leaning against the wall. It is clear that the bag will only be taken over his dead body > examine the thief The thief … Continue reading →
 Gas room by ericlippert on 2016-05-04 13:25 (#1CRM0) This room smells strongly of coal gas. Narrow tunnels lead east and south. There is a sapphire-encrusted bracelet here. > go east This room of course explodes if the burning torch is brought into it. I note that this game … Continue reading →
 Shaft room by ericlippert on 2016-05-02 13:05 (#1CGVW) In the middle this room a small shaft descends into darkness below. Above the shaft is a metal framework to which a heavy iron chain is attached. There are exits to the west and north. A foul odor can be … Continue reading →
 Bat room by ericlippert on 2016-04-29 13:10 (#1C7EG) You are in a small room with exits to the east and south. There is an exquisite jade figurine here. In the corner of the ceiling, a large vampire bat is holding his nose. > go east Code for this … Continue reading →
 Mine entrance by ericlippert on 2016-04-27 12:34 (#1BZ4K) You are at the entrance of an abandoned coal mine. Strange squeaky sounds come from the passage at the north end. You may also escape to the west. > go north Ominous. Code for this episode can be found in … Continue reading →
 Slide room by ericlippert on 2016-04-25 13:30 (#1BQ2N) This small chamber appears to have been part of a coal mine. To the west and south are passages, and a steep metal slide twists downward. > go west Well I guess now we know where the unclimbable steep metal … Continue reading →
 Winding passage by ericlippert on 2016-04-22 13:04 (#1BDWB) This is a crooked corridor from the north, with forks to the southwest and south. > go north If you think the winding passage is deliberately designed to be easily confused with the twisting passage, you’re right! Code for this … Continue reading →
 Drafty cave by ericlippert on 2016-04-20 14:12 (#1B5XT) This is a tiny cave with entrances west and north, and a dark, forbidding staircase leading down. > go north If you think the drafty cave is deliberately designed to be easily confused with the windy cave, you’re probably right! … Continue reading →
 Twisting passage by ericlippert on 2016-04-18 13:34 (#1AXJR) This is a crooked corridor from the north, with forks to the southwest and south. > go north > go west > go south > go up > put the skull and the emerald in the trophy case crystal skull: … Continue reading →
 Mirror room by ericlippert on 2016-04-15 12:51 (#1AKZR) You are in a square room with tall ceilings. A huge mirror fills the south wall. There are exits east and northeast. > look in the mirror An ugly person stares back at you. > go northeast Hmph. Code for … Continue reading →
 Hades by ericlippert on 2016-04-13 13:41 (#1ABV1) You have entered the Land of the Living Dead. Thousands of lost souls can be heard weeping and moaning. In a corner are the remains of previous adventurers less fortunate than yourself. A passage exits to the north. Lying in … Continue reading →
 Entrance to Hades by ericlippert on 2016-04-11 13:28 (#1A3NF) You are outside a large gate inscribed, “Abandon all hope ye who enter here!” The gate is open; beyond you can see a desolation, with a pile of mangled bodies in one corner. Thousands of voices, lamenting some hideous fate, … Continue reading →
 Windy cave by ericlippert on 2016-04-08 13:40 (#19T7G) This is a tiny cave with entrances west and north, and a dark, forbidding staircase leading down. > wait Time passes… A gust of wind blows out your candles! > go down Code for this episode can be found in … Continue reading →
 White Cliffs Beach by ericlippert on 2016-04-06 15:45 (#19JGF) …in the magic boat You are on a narrow strip of beach between the White Cliffs and the Frigid River. A tiny passage leads west into the cliff. > get out of the boat You are on your own feet … Continue reading →
 Frigid River, in the magic boat by ericlippert on 2016-04-04 13:35 (#199XF) You are on the Frigid River just below the dam. The river flows quietly here. There is a landing on the west shore. > wait Time passes… The current carries you downstream. The river descends here into a valley. The … Continue reading →
 Dam base by ericlippert on 2016-04-01 15:36 (#190WZ) You are at the base of the dam, which looms above you. The river Frigid begins here. Across it, to the east, cliffs form giant walls stretching north-south along the shore. There is a folded pile of plastic here which … Continue reading →
 Reservoir North by ericlippert on 2016-03-30 14:46 (#18RK5) You are in a cavern to the north of what was formerly a lake. However, with the water level lowered, there is merely a shallow stream, easily. A slimy stairway climbs to the north. There is a hand-held air pump … Continue reading →
123