1,913 karma · joined March 29, 2016
Here is a picture of her drawing on one of her vast sheets of paper.
https://news.artnet.com/app/news-upload/2014/08/Maryam-Mirza...
https://stackoverflow.com/questions/3859340/calling-haskell-...
Does this remind anyone of MonadBaseControl from the Haskell package monad-control?
For those new to this, good search terms are "row polymorphism", "extensible records", and "polymorphic variants".
factorial n =
if n < 2
then 1
else n * factorial (n - 1)
I think the OCaml version will look almost exactly like the F# one.Any of the mainstream functional languages (which are most likely to have type inference) can infer the types of all functions, unless you use funky language extensions that make type inference undecidable. Rust has a Hindley-Milner system, so it should be able to "infer recursive functions" too (but I can't say for sure since I don't use it).
Not sure why this is so common: perhaps the Terry form of the name?
Also, "Num in IO", nice. Now we wait for someone to write a "(Num in IO) in IO" action.
lend.
I think some European languages have the same word for both lend* and borrow (German?): is that actually the case?
https://donsbot.wordpress.com/2010/02/21/smoking-fast-haskel...
It's been seven years since: that's GHC 6.13, and GHC 8.2.1 is being released soon. Performance is even better now as long as laziness doesn't bite you (which is much less rare than people think).
> you won't be able to convince him that a standard recursive-descent parser is 10x simpler to write and read
I don't know what a "compile-time parser" is, but someone used to a good parser combinator library is going to be difficult to convince.
http://www.haskellforall.com/2017/06/translating-c-parser-to...
It reads like the formal spec of the language. Hand-writing recursive descent parsers isn't fun (given a sufficiently complex grammar) and expecting people to accept it as the One True Practical Non-Ivory Tower Way (and expressing dismay at not being able to convince them otherwise) is suggestive of monoculture, the kind that prides itself on copying code and using wrappers over the two or three first-class data structures that exist in the language for everything.
An extremely heavily-commented approach to defining equality for things like Double (where there are multiple sensible ways to compare things) will probably be a better introduction to these ideas:
https://github.com/mrkgnao/noether/blob/master/library/Noeth...
https://github.com/mrkgnao/noether/blob/master/library/Noeth...
The rest of the repo implements abstract algebraic structures along similar lines.
Here is what monoids look like in this formalism at present. It's a bit involved: first I use a fine-grained separation into highly polymorphic Magma and Neutral classes:
https://github.com/mrkgnao/noether/blob/master/library/Noeth...
And there are "strategies" for combining those pieces of structure, whose use looks like
type instance MonoidS (op :: BinaryNumeric) Rational
= DeriveMonoid_Semigroup_Neutral op Rational
Which means "derive the preferred monoid structure with operation op" (MonoidS op) on Rational from the preferred semigroup structure and preferred neutral element on it with that operation.https://github.com/mrkgnao/noether/blob/master/library/Noeth...
You can always use some other monoid structure for the same combination of type and operation (!) if you like. For instance, here's a demo of using the self-action of a ring on itself (i.e. considering a ring as a module over itself) to compute something, even if your preferred choice of action has been declared to be something else (or hasn't been defined at all).
https://github.com/mrkgnao/noether/blob/master/library/Noeth...
This says "here, use the self-action derived from the multiplicative magma structure on R".
> Lyra is a non-profit, non-invasive communication service which aims to enable deep and meaningful conversations.
Seems like a Slack/wiki hybrid.
Idris is strict too, but optional laziness is built into the compiler with the use of a special-cased Lazy wrapper of the form
data Lazy a = Delay a
This is kind of the opposite of strictness annotations (bang-patterns) from Haskell, except one doesn't need to pattern-match on Delay or use it to wrap arguments to functions expecting Lazy values. The Idris compiler can do something like "laziness analysis" (admittedly trivial in comparison to GHC's strictness analyser) to introduce and eliminate Delay constructors automatically. The laziness information is carried around in the types: force : Lazy a -> a
force a = a
https://github.com/idris-lang/Idris-dev/wiki/Unofficial-FAQ#...(purescript-lazy is also a thing, but I think it's not as seamless because of the "no compiler magic" position.)
In any case, what about -XStrict? I've never used it (or -XStrictData either), but isn't it a solution to the laziness problem, albeit a nuke-ish one at that?
And while we're thinking ahead, let's talk about the project to get linear types (something similar to Rust lifetimes, but weaker) into GHC :)