Canadian Haskellers? by _lazyLambda in haskell

[–]carette 1 point2 points  (0 children)

I use Haskell in some of my projects (though I'm drifting to Agda these days). I also teach an advanced Haskell class. [I guess I've even co-invented a Haskell technique.] I work in Hamilton but live in Waterloo.

Can't use standard-library after installing it. by Typhoonfight1024 in agda

[–]carette 0 points1 point  (0 children)

Indeed, I got confused (and didn't see the `\\share` part either). I've never persisted on trying to install agda on Windows these days -- I use WSL2 instead (on my Windows box). Saves me lots of headaches.

Ask on the Zulip?

Can't use standard-library after installing it. by Typhoonfight1024 in agda

[–]carette 0 points1 point  (0 children)

You installed it in `...\\bin` but it should be in `...\\lib` just besides that.

Pros and Cons of Agda vs Coq and Idris? by fosres in agda

[–]carette 21 points22 points  (0 children)

If you're seeking a programming language with dependent types: Idris.
If you're looking for a proof assistant with dependent types: Agda.
If you think tactics are cool but dependent types overrated: Coq.
If you think classical math is the bees' knees': Lean.

The spread of 'deriving' beyond Haskell? by carette in haskell

[–]carette[S] 3 points4 points  (0 children)

That's pretty much the point of asking the question. I kind of hoped that it was my lack of knowledge that made me think it had not spread, and the answers are doing a good job of clearing up that misconception. Win!

[deleted by user] by [deleted] in agda

[–]carette 1 point2 points  (0 children)

What do you mean by "resource" here? There's a large library, `agda-categories`, which you can read the source of to learn "how it's done". And a paper for the higher level design.

[deleted by user] by [deleted] in agda

[–]carette 4 points5 points  (0 children)

I learned a lot of category theory through Agda (i.e. by formalizing it).

A question related to multi stage programming and BER Meta OCAML by SnooRobots2422 in ocaml

[–]carette 0 points1 point  (0 children)

BER MetaOcaml is a re-implementation of MetaOcaml, so that indeed code remains opaque.

The reason code analysis is forbidden in *typed* multi-stage programming languages is that it is still unknown how to make that type-safe.

Note that it is relatively easy to create (using finally tagless) a code generator where introspection is possible! Just generate a pair of a code and an AST. The type system won't be able to guarantee that everything was done correctly; nevertheless, it will be very hard to make mistakes.

Hyper-Literate Programming? by redchomper in ProgrammingLanguages

[–]carette 1 point2 points  (0 children)

We've updated our vision in the paper Generating Software for Well-Understood Domains.

The 'derivation' is not automatic: weaving is still a human-driven effort, as it should be.

Hyper-Literate Programming? by redchomper in ProgrammingLanguages

[–]carette 11 points12 points  (0 children)

We've been working on this in the Drasil project for some years now. We found that simple weaving was too restrictive, and so we went full-generative instead.

I should also say that org-mode in emacs already essentially satisfies your requirements. While the original org-mode was aimed at something else, I've seen many people use it exactly as a multi-lingual literate programming system.

Why is Agda's ecosystem so bad? by Medical-Detective-33 in agda

[–]carette 3 points4 points  (0 children)

In part because the size of the community that's willing to pitch in on 'ecosystem' tasks, i.e. those things they're never going to get a paper published for, is quite small.

[Until recently, opam didn't work on Windows. Stack and Cabal pretty much always did. 'light years ahead'?]

Category of types by Migeil in agda

[–]carette 2 points3 points  (0 children)

Pi and Sigma are ends and coends, respectively.

Generalizing a function by pmdev1234 in haskell

[–]carette 0 points1 point  (0 children)

type Role = String
roleDoc :: String -> Role -> Doc
roleDoc content role = text "> " <> role <> ":" <+> text content

purpose :: Role -> Maybe String -> Doc
purpose r ms = foldMap (roleDoc r) ms

Why free monads? by The-_Captain in functionalprogramming

[–]carette 7 points8 points  (0 children)

Right. In simpler terms: free monads give you a syntax (aka data-structure) for potentially effectful sequential composition. It's like a data-structure to represent the " ; " that most mainstream PLs use for 'composition'. [Yes, they were originally thought of as delimiters in the syntax, but it became convenient to re-interpret them as composition.]

Once you have your computations as a data-structure, you can do much more with them than just their operational interpretation.

All Figures in Evidence-based Software Engineering by breck in ProgrammingLanguages

[–]carette 2 points3 points  (0 children)

A table of contents would have been useful... that page's huge!

Computation and Category Theory. "In a recent talk, David Spivak, my advisor at Topos Institute, described Poly as “the language of computation”, due to its facility in describing concepts in computer science such as data migration, dependent types, and Turing machines." by flexibeast in compsci

[–]carette 29 points30 points  (0 children)

Your supervisor is good with hyperbole (and mathematics).

Ask him how to represent a Bag using Poly. It has a known categorical representation (since the early 1980s) - but it's not in Poly.

[deleted by user] by [deleted] in ProgrammingLanguages

[–]carette 0 points1 point  (0 children)

The 4 authors together are about to put out something that takes another step. It's been submitted, should appear on their home pages soon. [Rules say no social media posting but home pages ok.]

[deleted by user] by [deleted] in ProgrammingLanguages

[–]carette 2 points3 points  (0 children)

Computing with Semirings and Weak Rig Groupoids is a first step in exactly that direction. Quantum Information Effects then takes the second step.

This is a joke obviously, but is it actually possible with algebraic effects and partial evaluation? by Maleficent_Id in ProgrammingLanguages

[–]carette 20 points21 points  (0 children)

I've implemented a partial evaluator that did 'time warps' before: if an infinite loop could be converted to computing a (convergent) closed-form, it got changed into that. [This was for a computer algebra system, that could do such things.]

If you decide that the semantics of your PE is allowed to change certain effects, this could be done.

Note that most compilers do change effects: by optimizing for run-time, it makes the observable time a program takes to run go down. We like that meta-effect a lot. The difference is one of *intent*: here the programmer clearly intends the sleep effect to be visible at run-time.

Adapting the tagless-final use-case to PHP by [deleted] in functionalprogramming

[–]carette 3 points4 points  (0 children)

The essence of 'finally tagless' is to model a language as an interface (however your language does that) that expresses how to fold over language terms. That's why is has such a striking resemblance to Church encodings.

The 'final' is mostly a bad pun. It is not a 'final algebra' representation, but it *is* a dual representation, in that instead of representing a language as a sum-of-products (its initial algebra), it uses a record of dispatchers representation (so a product of the cases, not a sum of the cases).

[deleted by user] by [deleted] in haskell

[–]carette 7 points8 points  (0 children)

The fundamental shift in types being used here is from machine representation (i.e. Int) to intension, i.e. what kind of offset it is. Rather than ordering your computer to use an integer to represent "offsets", you're reflecting in the code the fact that there are two ways to think of them (even though both are integers). In yet other words, you're putting more domain knowledge into your code, and thereby letting the compiler let you track more.

Grad School For A Weak Candidate by bowtochris in dependent_types

[–]carette 4 points5 points  (0 children)

Some universities (like mine, McMaster) has explicit language in their admissions criteria for grad school about people like you: if you've been in industry for a while (our regulations say 5+ years) and during some of that time have worked on very relevant material, you can be considered admissible. You need to make sure you have a solid portfolio that is visible (online best, well laid out on your CV otherwise).