There's something wonky about closed type families!

If both arguments to 'Min' contain type variables, only the first rule is ever tried. The family below gives 'Min n n ~ n' but if we move the first rule down, it no longer computes!

gist.github.com/wenkokke/7ffe6

@RaeHaskell@twitter.com @fancytypes@twitter.com Could you explain why this happens? Is this expected, or an implementation bug?

Both Stephanie and Richard actually responded! In short, it's because Haskell let's you shoot yourself in the foot by writing non-terminating type families, but they didn't want to let that translate into letting you shoot yourself in the foot by writing segfaulting programs.

Sign in to participate in the conversation
Computer Fairies

Computer Fairies is a Mastodon instance that aims to be as queer, friendly and furry as possible. We welcome all kinds of computer fairies!