
I noticed that with algebraic types I can do something like so: code -------- data Projectile = Bullet { range :: Double } | Missile { range :: Double } | Torpedo { range :: Double } f p = let r = range p in ...whatever... -------- (This is interesting in and of itself, as I don't in this case have to do pattern matching for each constructor. Also, apparently not all the constructors actually need to have a "range" selector for the program to compile!) However, what if I wanted to make the same function f (again, without multiple lines of pattern matching) but using a "simpler" data type like so: code: -------- type Range = Double data Projectile = Bullet Range | Missile Range | Torpedo Range -------- My first try was code -------- f (_ r) = ... -------- But that doesn't work. -- frigidcode.com indicium.us