Pattern Match Wildcards

(I think maybe this came up in an issue but)

I’ve wanted to use wildcards in Dhall, there’s a couple examples in this file.

let isMac =
      λ(os : types.OS) →
        merge
          { FreeBSD = False
          , OpenBSD = False
          , NetBSD = False
          , Solaris = False
          , Dragonfly = False
          , Linux = False
          , Darwin = True
          , Windows = False
          , Redox = False
          , Haiku = False
          , IOS = False
          , AIX = False
          , Hurd = False
          , Android = False
          , NoOs = False
          }
          os

So in this particular case I think wildcards line up with what I actually want to do (i.e. not a mistake)!

See: https://github.com/dhall-lang/dhall-lang/pull/962

Oh wow! Nvm, thanks for the response though.

You’re welcome! Also, keep in mind that these things can be relitigated. Decisions are not final.

1 Like

In the bug fixed by the PR, there are some comments about equality test for enum, which seems like what you are looking for here.

1 Like