{-# LANGUAGE ExistentialQuantification #-}
class Device a
data Device' = forall a.(Device a, Show a)=> MakeDevice' a
data Hedgehog = Hedgehog
data GrassSnake = GrassSnake
instance Device Hedgehog
instance Device GrassSnake
device "Уж" = MakeDevice' Hedgehog
device "Ёж" = MakeDevice' GrassSnake
main = putStrLn $ f $ device "Уж"
where f (MakeDevice' a
) = show a
ey0jIExBTkdVQUdFIEV4aXN0ZW50aWFsUXVhbnRpZmljYXRpb24gIy19CgpjbGFzcyBEZXZpY2UgYQoKZGF0YSBEZXZpY2UnID0gZm9yYWxsIGEuKERldmljZSBhLCBTaG93IGEpPT4gTWFrZURldmljZScgYQoKZGF0YSBIZWRnZWhvZyA9IEhlZGdlaG9nCglkZXJpdmluZyAoU2hvdykKCmRhdGEgR3Jhc3NTbmFrZSA9IEdyYXNzU25ha2UKCWRlcml2aW5nIChTaG93KQoKaW5zdGFuY2UgRGV2aWNlIEhlZGdlaG9nCmluc3RhbmNlIERldmljZSBHcmFzc1NuYWtlCgpkZXZpY2UgOjogU3RyaW5nIC0+IERldmljZScKZGV2aWNlICLQo9C2IiA9IE1ha2VEZXZpY2UnIEhlZGdlaG9nCmRldmljZSAi0IHQtiIgPSBNYWtlRGV2aWNlJyBHcmFzc1NuYWtlCgptYWluID0gcHV0U3RyTG4gJCBmICQgZGV2aWNlICLQo9C2IgoJd2hlcmUgZiAoTWFrZURldmljZScgYSkgPSBzaG93IGE=