I have multiple union types that in turn belong to another union type like so:
type Foo = OneFoo | TwoFoo | ThreeFoo
type Bar = UnoBar | DosBar | TresBar
type Baz = Foo | Bar
I then have a function that matches on a Baz like so:
myFunct : Baz -> String
myFunct baz =
case baz of
OneFoo -> "One foo!"
_ -> "who cares this is a silly pseudo example"
The compiler complains that
The pattern matches things of type:
Foo
But the values it will actually be trying to match are:
Baz
How do I overcome this?