[Question]
  [
Recently I had the pleasure of writing a Haskell program that could detect if the `NegativeLiterals` extension was engaged. I came up with the following:
```
data B=B{u::Integer}
instance Num B where{fromInteger=B;negate _=B 1}
main=print$1==u(-1)
```
[Try it online!](https://tio.run/##LcqxCsIwEADQvV9xg4MOHbJWbskmSGc3Oeo1DSanXC46lP66EcE3v4XKnVNq7UZG4NGvdRhOYhxYty5KMZKJYawZPLwXVl5nfeT/QH8UDmQMV/Tgti5TFHxqFNs5xLrv3aG1zzQnCqX1l/GX44vP0VgplS8 "Haskell – Try It Online")
This will print `True` normally and `False` otherwise.
Now I had so much fun doing this I'm extending the challenge to all of you. What other Haskell language extensions can you crack?
## Rules
To crack a particular language extension you must write a Haskell program that compiles both with and without the language extension (warnings are fine) and outputs two different *non-error* values when run with the language extension and it turned off (by adding the `No` prefix to the language extension). In this way the code above could be shortened to just:
```
data B=B{u::Integer}
instance Num B where{fromInteger=B;negate _=B 1}
main=print$u(-1)
```
which prints `1` and `-1`.
Any method you use to crack a extension must be specific to that extension. There may be ways of arbitrarily detecting what compiler flags or LanguageExtensions are enabled, if so such methods are not allowed. You may enable additional language extensions or change the compiler optimization using `-O` at no cost to your byte count.
## Language extensions
You cannot crack any language extension that does not have a `No` counterpart (e.g. `Haskell98`, `Haskell2010`, `Unsafe`, `Trustworthy`, `Safe`) because these do not fall under the terms outlined above. Every other language extension is fair game.
## Scoring
You will be awarded one point for every language extensions you are the first person to crack and one additional point for every language extension for which you have the shortest (measured in bytes) crack. For the second point ties will be broken in favor of earlier submissions. Higher score is better
You will not be able to score a point for first submission on `NegativeLiterals` or `QuasiQuotes` because I have already cracked them and included them in the body of the post. You will however be able to score a point for the shortest crack of each of these. Here is my crack of `QuasiQuotes`
```
import Text.Heredoc
main=print[here|here<-""] -- |]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRCEktaJEzyO1KDUlP5krNzEzz7agKDOvJDoDKFQDImx0lZRiFXR1FWpi////l5yWk5he/F83IrA0sTgzsDS/JLUYAA "Haskell – Try It Online")
  
[Answer]
# MagicHash, 30 bytes
```
x=1
y#a=2
x#a=1
main=print$x#x
```
[-XMagicHash](https://tio.run/##y0gszk7Nyfn/v8LWkKtSOdHWiKsCSBpy5SZm5tkWFGXmlahUKFf8//8vOS0nMb34v26Eb2J6ZrJHYnEGAA) outputs 1, [-XNoMagicHash](https://tio.run/##y0gszk7Nyfn/v8LWkKtSOdHWiKsCSBpy5SZm5tkWFGXmlahUKFf8//8vOS0nMb34v26EX75vYnpmskdicQYA) outputs 2
MagicHash allows variable names to terminate in a `#`. Therefore with the extension, this defines two functions `y#` and `x#` which each take a value and return a constant `2`, or `1`. `x#x` will return 1 (because it is `x#` applied to `1`)
Without the extension, this defines one function `#` which takes two arguments and returns `2`. The `x#a=1` is a pattern that never gets reached. Then `x#x` is `1#1`, which returns 2.
# 29 bytes
```
a=1
a#b=a
main|a<-0=print$a#0
```
[Answer]
# CPP, ~~33~~ 20 bytes
```
main=print$0-- \
 +1
```
Prints `0` with [`-XCPP`](https://tio.run/##y0gszk7Nyfn/PzcxM8@2oCgzr0TFQFdXIYZLQdvw//9/yWk5ienF/3UjnAMCAA "Haskell – Try It Online") and `1` with [`-XNoCPP`](https://tio.run/##y0gszk7Nyfn/PzcxM8@2oCgzr0TFQFdXIYZLQdvw//9/yWk5ienF/3Uj/PKdAwIA "Haskell – Try It Online").
With `-XCPP`, a slash `\` before a newline removes the newline, thus the code becomes `main=print$0-- +1` and only `0` is printed as the `+1` is now part of the comment.
Without the flag the comment is ignored and the second line is parsed as a part of the previous line because it is indented.
---
### Previous approach with `#define`
```
x=1{-
#define x 0
-}
main=print x
```
Also prints `0` with [`-XCPP`](https://tio.run/##y0gszk7Nyfn/v8LWsFqXSzklNS0zL1WhQsGAS7eWKzcxM8@2oCgzr0Sh4v//f8lpOYnpxf91I5wDAgA) and `1` with [`-XNoCPP`](https://tio.run/##y0gszk7Nyfn/v8LWsFqXSzklNS0zL1WhQsGAS7eWKzcxM8@2oCgzr0Sh4v//f8lpOYnpxf91I/zynQMCAA "Haskell – Try It Online").
[Answer]
# NumDecimals, 14 bytes
```
main=print 1e1
```
[-XNumDecimals](https://tio.run/##y0gszk7Nyfn/PzcxM8@2oCgzr0TBMNXw//9/yWk5ienF/3Uj/EpzXVKTM3MTc4oB) prints `10`. [-XNoNumDecimals](https://tio.run/##y0gszk7Nyfn/PzcxM8@2oCgzr0TBMNXw//9/yWk5ienF/3Uj/PL9SnNdUpMzcxNzigE) prints `10.0`.
[Answer]
# BinaryLiterals, 57 bytes
```
b1=1
instance Show(a->b)where;show _=""
main=print$(+)0b1
```
[-XBinaryLiterals](https://tio.run/##y0gszk7Nyfn/P8nQ1pArM6@4JDEvOVUhOCO/XCNR1y5JszwjtSjVuhjIV4i3VVLiyk3MzLMtKMrMK1HR0NY0SDL8//9fclpOYnrxf90Ip8y8xKJKn8yS1KLEnGIA) prints a single newline. [-XNoBinaryLiterals](https://tio.run/##y0gszk7Nyfn/P8nQ1pArM6@4JDEvOVUhOCO/XCNR1y5JszwjtSjVuhjIV4i3VVLiyk3MzLMtKMrMK1HR0NY0SDL8//9fclpOYnrxf90Iv3ynzLzEokqfzJLUosScYgA) prints a `1`.
I am sure there is a better way to do this. If you find one, please post it.
[Answer]
# MonomorphismRestriction + 7 others, 107 bytes
This uses TH which requires the flag `-XTemplateHaskell` at all times.
### File T.hs, 81 + 4 bytes
```
module T where
import Language.Haskell.TH
p=(+)
t=reify(mkName"p")>>=stringE.show
```
### Main, 22 bytes
```
import T
main=print $t
```
Compiling with the flag [MonomorphismRestriction](https://tio.run/##rZBLC8IwEITv@ytCEVHECJ7b3hQPPkBy8FCQWNcm2DxIIsVfX9v66F26x1nmm2Eu3Iu6znkgKWFUeBLHq8MalLk@SiSMVAIdglTWuEC2XBcPXiDdcH/HsqRsAzaZzKYQEofy9pyo@54rjGw0TdPEByd1saJemApaKrxzdlzqPurDZqAaObGNJZBsFHpDVysdL6H73Uh0/ucynemow3TQb4chuVCI/AeenxgqW/KAn7EaZWe0UcZZIb06YjtPHqTRg5agi7ZBXb8A) forces the type of `p` to `Integer -> Integer -> Integer` and thus produces the following output:
```
"VarI T.p (AppT (AppT ArrowT (ConT GHC.Integer.Type.Integer)) (AppT (AppT ArrowT (ConT GHC.Integer.Type.Integer)) (ConT GHC.Integer.Type.Integer))) Nothing"
```
Compiling with the flag [NoMonomorphismRestriction](https://tio.run/##rZBLC8IwEITv@ytCEVHECJ7b3hQPPkBy8FCQWNcm2DxIUoq/vra16l3c4yzzzTAX7kXT5DyQlDAqPInj1WENylyrEgkjtUCHIJU1LpAt10XFC6Qb7u9YlpRtwCaT2RRC4lDeHhN133OFkY2maZr44KQuVtQLU0NHhVfOjkv9jRrYDFQrJ7a1BJKNwtfQ10rHS@h/NxKdf7lMZzrqMT303eGfXChE/gHPTwyVLXnAYaxW2Zud0UYZZ4X06ojdQHmQRv@1Bl10HZrmCQ) leaves the type of `p` at the most general, ie. `Num a => a->a->a` - producing something like (shortened the `VarT` names to `a`):
```
"VarI T.p (ForallT [KindedTV a StarT] [AppT (ConT GHC.Num.Num) (VarT a)] (AppT (AppT ArrowT (VarT a)) (AppT (AppT ArrowT (VarT a)) (VarT a)))) Nothing"
```
[Try them online!](https://tio.run/##rZBPq8IwEMTv@ymWIqKIPXi2vSk9@Ackh3coPGJdm2CTDUmK@Omr1ufzKIh7nGV@M8xeBtV1lYyYo0hVwPl8sV2C4UPbEAo8K/IE2jj2EVfS1q2sKS1kOFHTpKIAl40mY4iZJ328jMxpIw0lLhnneRai17ZepEHxGe5UeOSspbavqD@2AHOTM3ezRCwH8WXoa@XDGfS/Iya/n1xpS5v0mB767PBNLvjWqscyOP0RZFwjIxX/yobXbNmwd0oHs6P7PlXUbJ9tgCrF7yhvGF13BQ "Bash – Try It Online")
---
## Alternatives
Since the above code simply prints out the type of `p`, this can be done with all flags that somehow influence how Haskell infers types. I will only specify the flag and with what to replace the function `p` and if needed additional flags (besides `-XTemplateHaskell`):
### OverloadedLists, 106 bytes
Additionally needs `-XNoMonomorphismRestriction`:
```
p=[]
```
Either `p :: [a]` or `p :: IsList l => l`, [try them online!](https://tio.run/##rZA/T8MwEMX3@xRWhBAMZOjcZCvK0D9S5QGJIGSSa2zV9ln2hYpPH1qX0okFuPE9vd97ujeV9DR1ikUtZKmTmM8Xm0dw1I8WhRQHjRHBuECRxVL5YVQDlo1Ke7S2lA2E6vkFuIpodh93br9WDotQ3Nd1lTgaPyzKpOkAJyica1bK@GvTF1qCO8pVOEZYtDd8DeRV9e0MsrcTxetvrvWtLzImQy8b/pMLcfT6/Bjx8CTRBasYm29lTSvy5CgGbZLb4uk/HRvy2du8Y7SkeuyXJnG6LATsNP2F/AN3mj4B "Bash – Try It Online")
### OverloadedStrings, 106 bytes
Additionally needs `-XNoMonomorphismRestriction`:
```
p=""
```
Either `p :: String` or `p :: IsString s => s`, [try them online!](https://tio.run/##rZAxT8MwEIX3@xWWhRAMZGBushVloK0EHhgioSO5xlZtn2U7VPz60LqUTizAje/0vvf03jDpee4xi0aoSiexWCw3D@B4mCwJJfaaIoFxgWMWj@jHCUeqWkw7srZSLYRaSsh1JLP9uHG7NTqSQd42TZ1yNH5cVknzHo5QOMWs0PhL0hdagTvIdThYsuiu8sVQWjXX91B@WyFff3Od77wsmAI9d/hPLsTJ69Mw4u5FkQsWM7XfyppX7NlxDNok90THffps2Jff5p2iZRxoeC67pXNHoF7zX9g/kuf5Ew "Bash – Try It Online")
### PolyKinds, 112 bytes
This is entirely due to @CsongorKiss:
```
data P a=P 
```
Either `P :: P a` or `P :: forall k (a :: k). P a`, [try them online!](https://tio.run/##rZA9i8JAEIb7@RVDkOOuMMXVJp1HwK8UW1gEZDRjdnE/wu4G8ddHjacWFsJxU77D@zzDbCnIvt9RxBxFKgNOJtPVDxhXd5pR4FGyZ1CmdT7inGzTUcNpQeHAWqeigJoiYYmUlRAzz2p/@jSHJRlOyuQrz7MQvbLNNA3SHeGKhptsQco@fb8CAeYSZ@2lErEaxWdhuC3/@IZht8dk85epbGWTATNA7zf8Jxd8Z@XtPTheCzatpsjFI1m60unTTNk63P3AO@ne9V5afX8G "Bash – Try It Online")
### MonadComprehensions, 114 bytes
```
p x=[i|i<-x]
```
Either `p :: [a] -> [a]` or `p :: Monad m => m a -> m a`, [try them online!](https://tio.run/##rZBBS8NAEIXv8yuGIKKH5uA5yUUqOdh62YPQiIztNLs0O7vsbmgL/vdYU2tvLYhzfMP73uN9UNTDsKSEFapcRyyK6csTWLfqO0aFW82BwVjvQsJnkranlvOa4oa7Llc1eNyVC/NpisnuDVIZ2Kz3d3YzJ8uZz@6rqowpGGmnedRuC99wOMbNyMg58SdCgT3IpT9YEjY36WwY21W3DzD@1pi9/@UaaSQbMSP01OE/uRB60ceBcPKq2PqOEte/ytzNnNDq0VkfWLNE4ySemgAvtbtGuOAfhi8 "Bash – Try It Online")
### NamedWildCards, 114 bytes
This one was found by @Laikoni, it additionally requires `-XPartialTypeSignatures`:
```
p=id::_a->_a
```
They both have the save type (`p :: a -> a`) but GHC generates different names for the variables, [try them online!](https://tio.run/##rZA/a8MwEMX3@xTClNIO8ZAxxFpKioc2KVTQDgZzjS6WiP4hyYR8etdxmmbpFHrjO97vPd4XJjUMW8yMM1GqxJbL1eYZrJe9ISbYQVEk0Db4mNkLuq7Hjsoa056MKUUNodJysWhxxluEXEXSu@OD3a/RUhGKR86rlKN23apMyh/gBIdz3Ctqd038iRBgR7kKoyWz5i5fDVM7fj@H6bdjRXvLNa5xxYSZoJcO/8mF2Dt1HojNPgXZYDBT/au8YcwajTgGetedw9xHSqO@9qfR5Ic28gmjTJdyQFvlb4b@iRyGbw "Bash – Try It Online")
### ApplicativeDo, 120 bytes
```
p x=do i<-x;pure i
```
Either `p :: Monad m => m a -> m a` or `p :: Functor f => f a -> f a`, [try them online!](https://tio.run/##rZBNa8JAEIbv8yuGIFIPyaFXk4CgkoPVyx48BMpWx@zifrG78ePXp2ms9VIoFOc4w/M@L/PBg@i6HY9YIstEwDxfbJag7b5VhAzPgjyB1M76iCtumpY3lFU8HEmpjFXg8FLsLco8vUxd6wklxMKTPFxf9HHNNSUumZRlEaKXpllkQdgzfCngJn3j0jy83yIGul8Xrkci1qP4AIaO5fgVhtsBk/f/TG1qkwwxQ@i9wzNzwbdG3N6E6ZaRdopHqn42aztzTsleL080t/cOQDth/2J/JbvuEw "Bash – Try It Online")
### OverloadedLabels, 120 bytes
This needs the additional flag `-XFlexibleContexts`:
```
p x=(#id)x
(#)=seq
```
Either types as `p :: a -> b -> b` or `p :: IsLabel "id" (a->b) => a -> b`, [try them online!](https://tio.run/##rZA9b4MwEIb3@xUWqSoYwtA5sFSJGNJk8dABqTrCBVvxV23T0F9PKWmaqUvUG9/TPc@razCIcTxgZCXjuQhstVrvN6Bt2ytinJ0FeQKpnfWRbdF0PXaUVxhOpFTOK3BsKNKFbLMB0kVWBHqHWHiSx89Un3aoKXFJVpZFiF6abp0HYc/wrYCL9AWluXl/RBz0FBduOomsfoi3g7lj@fgE8@7Ikrd7pja1SWbMDL12@E8u@N6Iy5vY8pWTdgojVb/JRtEgG0XP1kQaYpiind1/kFcWW2q32JAK12ZAB2HvIP7FG8cv "Bash – Try It Online")
[Answer]
# ScopedTypeVariables, ~~162~~ 113 bytes
```
instance Show[()]where show _=""
p::forall a.(Show a,Show[a])=>a->IO()
p a=(print::Show a=>[a]->IO())[a]
main=p()
```
[-XScopedTypeVariables](https://tio.run/##TY5BCsIwEEX3PUXoKgHrAQIpiCh05aIighQZ42iDMQlJwHp5Y2pddDfz/5vh9RAeqHVKyoQIRiJpe/s6Uda9evRIQt7IWZRl4Ti/WQ9aE1jSESKw@LHQMVFDVTc7ygpHQFDnlYmcT5CoMzG1LE/FE5QRjrKUPvKm4R5SddxqHNRFY/OXmGdrayIOcYw2g9NKqri1fpWdq2NjpB01TZxfttI6vO7fDg/gFeQf4Qs) prints `""` (empty), [-XNoScopedTypeVariables](https://tio.run/##TY5BCsIwEEX3PUXoKgHrAQIpiFjoyoWbghQZQ2qD0yQkgfb0xtSKuPvz5314I4SnQkxJmxDBSEUuo52vlPXzqLwiIV/kJsqycJwP1gMigT1dIQK7Dws9EzVUdXumrHAEBHVem8j5Bok6E9uX5VRMoI1wlKX0kgPCI6Sqa1At@o6q/Ur8d0drolriWp0Wh1rq2Fh/yM5V1xppV00Tf8s3) prints `"[()]"`.
Edit: updated solution thanks to useful suggestions in the comments
[Answer]
# CPP, ~~27~~ 25
```
main=print({-/*-}1{-*/-})
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/PzcxM8@2oCgzr0SjWldfS7fWsFpXS1@3VvP//3/JaTmJ6cX/dSOcAwIA "Haskell – Try It Online")
Prints `()` for `-XCPP` and `1` for `-XNoCPP`
***Previous version:***
```
main=print[1{-/*-},2{-*/-}]
```
[Try it online!](https://tio.run/##y0gszk7Nyfn/PzcxM8@2oCgzryTasFpXX0u3VseoWldLX7c29v//f8lpOYnpxf91I5wDAgA "Haskell – Try It Online")
Prints `[1]` with `-XCPP` and `[1,2]` otherwise.
Credits: This is inspired by Laikoni's answer, but instead of a `#define` it simply uses C comments.
[Answer]
# BangPatterns, 32 bytes
```
(!)=seq
main|let f!_=0=print$9!1
```
[-XBangPatterns](https://tio.run/##y0gszk7Nyfn/X0NR07Y4tZArNzEzryYntUQhTTHe1sC2oCgzr0TFUtHw//9/yWk5ienF/3UjnBLz0gMSS0pSi/KKAQ "Haskell – Try It Online") prints `1` whereas [-XNoBangPatterns](https://tio.run/##y0gszk7Nyfn/X0NR07Y4tZArNzEzryYntUQhTTHe1sC2oCgzr0TFUtHw//9/yWk5ienF/3Uj/PKdEvPSAxJLSlKL8ooB "Haskell – Try It Online") will print `0`.
This makes use that the flag BangPatterns allows to annotate patterns with a `!` to force evaluation to WHNF, in that case `9!1` will use the top-level definition `(!)=seq`. If the flag is not enabled `f!_` defines a new operator `(!)` and shadows the top-level definition.
[Answer]
# MonoLocalBinds, GADTs, or TypeFamilies, ~~36~~ 32 bytes
EDIT:
* -4 bytes: A version of this was incorporated into the [great polyglot chain](https://codegolf.stackexchange.com/a/167537/) by stasoid, who surprised me by putting all the declarations at top level. Apparently triggering this restriction does not require actual *local* bindings.
```
a=0
f b=b^a
main=print(f pi,f 0)
```
* With [no extensions](https://tio.run/##y0gszk7Nyfn/P9HWgCtNIck2KS6RKzcxM8@2oCgzr0QjTaEgUydNwUDz/38A "Haskell – Try It Online"), this program prints `(1.0,1)`.
* With either of the flags [-XMonoLocalBinds](https://tio.run/##y0gszk7Nyfn/P9HWgCtNIck2KS6RKzcxM8@2oCgzr0QjTaEgUydNwUDz//9/yWk5ienF/3UjfPPz8n3ykxNznDLzUooB "Haskell – Try It Online"), [-XGADTs](https://tio.run/##y0gszk7Nyfn/P9HWgCtNIck2KS6RKzcxM8@2oCgzr0QjTaEgUydNwUDz//9/yWk5ienF/3Uj3B1dQooB "Haskell – Try It Online"), or [-XTypeFamilies](https://tio.run/##y0gszk7Nyfn/P9HWgCtNIck2KS6RKzcxM8@2oCgzr0QjTaEgUydNwUDz//9/yWk5ienF/3UjQioLUt0SczNzMlOLAQ "Haskell – Try It Online"), it prints `(1.0,1.0)`.
* The `MonoLocalBinds` extension exists to prevent some unintuitive type inference triggered by GADTs and type families. As such, this extension is automatically turned on by the two others.
* It *is* possible to turn it off again explicitly with `-XNoMonoLocalBinds`, this trick assumes you don't.
* Like its more well-known cousin the monomorphism restriction, `MonoLocalBinds` works by preventing some values (~~in local bindings like `let` or `where`, thus the name~~ apparently it can also happen at top level) from being polymorphic. Despite being created for saner type inference, the [rules for when it triggers](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#let-generalisation) are if possible even more hairy than the MR.
* Without any extension, the above program infers the type `f :: Num a => a -> a`, allowing `f pi` to default to a `Double` and `f 0` to an `Integer`.
* With the extensions, the type inferred becomes `f :: Double -> Double`, and `f 0` has to return a `Double` as well.
* The separate variable `a=0` is needed to trigger the technical rules: `a` is hit by the monomorphism restriction, and `a` is a *free variable* of `f`, which means that `f`'s binding group is not *fully generalized*, which means `f` is not *closed* and thus doesn't become polymorphic.
[Answer]
# [RebindableSyntax](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#extension-RebindableSyntax), 25 bytes
I was reading the recently posted [Guide to GHC's Extensions](https://limperg.de/ghc-extensions/) when I noticed an easy one that I didn't recall seeing here yet.
```
main|negate<-id=print$ -1
```
* With [-XNoRebindableSyntax](https://tio.run/##DcixDkBADADQXzFYb7DzARYRFmvd1WlUiauExLcrb3wzpAWZzVYgeQQjKJaOQrUfJJpnrjB7/cQQk7mh2TocSQKMjP0tCtef9bozedL2QD4Dfg "Haskell – Try It Online"), prints `-1`.
* With [-XRebindableSyntax](https://tio.run/##y0gszk7Nyfn/PzcxM68mLzU9sSTVRjczxbagKDOvREVB1/D//3/JaTmJ6cX/dSOCUpMy81ISk3JSgyvzShIrgEKeuQU5mcmZJQFFqTmlKakA "Haskell – Try It Online"), prints `1`.
Also requires `-XImplicitPrelude`, or alternatively `import Prelude` in the code itself.
* `-XRebindableSyntax` changes the behavior of some of Haskell's syntactic sugar to make it possible to redefine it.
* `-1` is syntactic sugar for `negate 1`.
* Normally this `negate` is `Prelude.negate`, but with the extension it's "whichever `negate` is in scope at the point of use", which is defined as `id`.
* Because the extension is meant to be used to make replacements for the `Prelude` module, it automatically disables the usual implicit import of that, but other `Prelude` functions (like `print`) are needed here, so it is re-enabled with `-XImplicitPrelude`.
[Answer]
# OverloadedStrings, ~~65~~ ~~48~~ 32 bytes
Taking advantage of RebindableSyntax, use our own version of fromString to turn any string literal into `"y"`.
```
main=print""
fromString _=['y']
```
Must be compiled with `-XRebindableSyntax -XImplicitPrelude`.
Without `-XOverloadedStrings` prints `""`; with prints `"y"`.
Also, it only just now struck me that the same technique works with (e.g.) OverloadedLists:
# OverloadedLists, 27 bytes
```
main=print[0]
fromListN=(:)
```
Must be compiled with `-XRebindableSyntax -XImplicitPrelude`.
Without `-XOverloadedLists` prints `[0]`; with prints `[1,0]`.
[Answer]
# ApplicativeDo, 146 bytes
```
newtype C a=C{u::Int}
instance Functor C where fmap _ _=C 1
instance Applicative C
instance Monad C where _>>=_=C 0
main=print$u$do{_<-C 0;pure 1}
```
Prints 1 when ApplicativeDo is enabled, 0 otherwise
[Try it online!](https://tio.run/##TYyxDoIwFEV3vuINrCSyoiUxGBMGnd2al1Kksbw2tJUYwq9b6yKu555zB3QPqXWMJGf/shIaQNYsoapa8mumyHkkIeEcSHgzpXke5CShH9ECB84aKDfraK1WAr16pqMNXwxh90t5XbNvt8tGVMTspMjnIe/Mwg9FwnsbklWuMb5Fr/HuYnG7mr/rk/kA "Haskell – Try It Online")
[Answer]
# ApplicativeDo, 104 bytes
```
import Control.Applicative
z=ZipList
instance Monad ZipList where _>>=_=z[]
main=print$do a<-z[1];pure a
```
[Try it online!](https://tio.run/##Tc2xCsIwEIDhPU9xg2sFZ01BdNS9WEo50mgP09yRnAp5eKODg@vPB/@M@e5DqJUW4aRw4KiJw3ovEsih0tObYi8kJ8pqKGbF6DycOeIEvwyv2ScPY9va0ZZ@MAtStJIo6mpiwF1T@s2wlccXYa1vdw14y7Xp/iZH/gA)
With `ApplicativeDo`, this prints
```
ZipList {getZipList = [1]}
```
Without it, it prints
```
ZipList {getZipList = []}
```
`ZipList` is one of the few types in the base libraries with an instance for `Applicative` but not for `Monad`.
There may be shorter alternatives lurking somewhere.
[Answer]
# BinaryLiterals, ~~31~~ 24 bytes
Edit:
* -7 bytes: H.PWiz suggested adjusting it further by using a single `b12` variable.
An adjustment to [H.PWiz's method](https://codegolf.stackexchange.com/a/153751/), avoiding the function instance.
```
b12=1
main=print$(+)0b12
```
* With [-XNoBinaryLiterals](https://tio.run/##y0gszk7Nyfn/P8nQyNaQKzcxM8@2oCgzr0RFQ1vTACj4//@/5LScxPTi/7oRfvlOmXmJRZU@mSWpRYk5xQA "Haskell – Try It Online"), `0b12` lexes as `0` `b12`, printing 0+1 = `1`.
* With [-XBinaryLiterals](https://tio.run/##y0gszk7Nyfn/P8nQyNaQKzcxM8@2oCgzr0RFQ1vTACj4//@/5LScxPTi/7oRTpl5iUWVPpklqUWJOcUA "Haskell – Try It Online"), `0b12` lexes as `0b1` `2`, printing 1+2 = `3`.
[Answer]
# ExtendedDefaultRules, ~~54~~ 53 bytes
```
instance Num()
main=print(toEnum 0::Num a=>Enum a=>a)
```
Prints `()` with [`-XExtendedDefaultRules`](https://tio.run/##HcmxDkAwEADQ3Vd0bBMSs4SJ1WCyXjg0rkf0mvh6R4wvb4O4I5Gq5yjAE5o@BeuyAJ7r8/IsVo6OUzBlVdnvDOQ/wdUNONVnWgjWqMXY3YI849ziAolkSITxBQ "Haskell – Try It Online") and `0` with [`-XNoExtendedDefaultRules`](https://tio.run/##HcmxDkAwEIDh3VN0ZJCYJTXpajBZL3poXI/oNfH0jpj@fPk3SDsSqQZOAjyjGXIsqyJCYHtegaWUw3GOpmnbbxmw3c@vUKk@80KwJq2n4XC3IHv0PS6QScZMmF4).
This flag is enabled by default in GHCi, but not in GHC, which recently [caused some confusion for me](https://chat.stackexchange.com/transcript/message/42958768#42958768), though [BMO](https://codegolf.stackexchange.com/users/48198/bmo) was quickly able to help.
The above code is a golfed version of an example in the GHC User Guide where [type defaulting in GHCi](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html#type-defaulting-in-ghci) is explained.
*-1 byte thanks to [Ørjan Johansen](https://codegolf.stackexchange.com/users/66041/%c3%98rjan-johansen)!*
[Answer]
# Strict, ~~87 84~~ 82 bytes
-5 bytes thanks to [dfeuer](https://codegolf.stackexchange.com/users/38603/dfeuer)!
Could be less with `BlockArguments` saving the parens around `\_->print 1`:
```
import Control.Exception
0!_=0
main=catch @ErrorCall(print$0!error"")(\_->print 1)
```
Running this with [-XStrict](https://tio.run/##HY0xDoJAEEV7TgHEAgoMHgCjIZxAYyxMyLiuMmHYncxOoZd3Ze3@f694E4TZEsWIC3vRvPdOxdN2eBvLit5lbTF2bbYAus6Amik/DCJeeiCqWNDppi1sImVZV7ex2f9hvqtj/JonwSvE5npSQaNpGM/2cf6wvYAg3Mkmnf6RmXAtrM3wAw) prints a `1` whereas running it with [-XNoStrict](https://tio.run/##HY0xDoJAEEV7TwHEAgoMHgCjIbQ2GGNhQsZ1lYnDzmSYQi/vCnb/v7zkDTC9PFGMOAqrJQ0HU6ZN@3ZeDDmsqrSvq9UIGGoH5oZk36qyNkCUi2KwdZX6hWRZkV/7cveHybaI8eseBM8plpcjd6bobJ6dY/H300f8GRThRn4Rln8QIZwbc3X6AQ) will print a `0`. This uses that Haskell by default is lazy and doesn't need to evaluate `error""` since it already knows that the result will be `0` when it matched on the first argument of `(!)`, this behaviour can be changed with that flag - forcing the runtime to evaluate both arguments.
If printing nothing in one case is allowed we can get it down to [**75 bytes**](https://tio.run/##FY1BDsIwDATvfUVbcYADKB@oBKr6AhDihkww1MJJLMcH@nlCc9udlWZnyB9kLoWCJLV2TNE08WH6ehSjFBvX3QfXBKA4eDA/t8dJNekIzFtRirZxHVbS97uAQWwp5edfDO9c9rezKXmrwSfB52URvIISPBjrXPtJhGlVr2f5Dw) replacing the main by (also some bytes off by [dfeuer](https://codegolf.stackexchange.com/users/38603/dfeuer)):
```
main=catch @ErrorCall(print$0!error"")mempty
```
# StrictData, ~~106 99~~ 93 bytes
-15 bytes thanks to [dfeuer](https://codegolf.stackexchange.com/users/38603/dfeuer)!
This basically does the same but works with data fields instead:
```
import Control.Exception
data D=D()
main=catch @ErrorCall(p$seq(D$error"")0)(\_->p 1);p=print
```
Prints `1` with the [-XStrictData](https://tio.run/##Fc2xDoIwEIDhnadoCEM7YHQ2GA3lCXRwMDGXWqXhaM/rDfryVlj/4ftHyJNHLCXMlFhUn6Jwws3wcZ4kpFg9QEDZzmpTzRBi50DcqI4Dc@IeEDU12b@1bfxa6tpsjb7d2wOpndlTRxyilPJzT4RXLu318iV/IsKwQIu/prNwcGKX0R8) flag and `0` with [-XNoStrictData](https://tio.run/##Fc2hDsIwEIBhv6dololWjIAmI5B1FgMCQUIupbCGW3tcT8DLUzb7i@8fIb88YilhosSi@hSFE66Gj/MkIcXqDgLKdlabaoIQOwfiRrUfmBP3gKipyf6tbeOXUtdmbfT11u5IbcyWOuIQpZSfeyA8c2kv5y/5AxGGGZr9JR3TSTg4sfPqDw).
If printing nothing in one case is allowed we can get it down to [**86 bytes**](https://tio.run/##Fc0xDsIwDEDRvaeIqg7JAOIClUBNTwADqxUCtXAS43iglye06x/eX6C@I1FrmLiImqlklULH@RsiK5bcPUDB@NFb1yXAPAbQsJjzLFJkAiLLglmHGj/WD3Gvfe9OLsXEurb2C0@CV22H@23leGEm3IQN3tNVBYP67fAH) replacing the main by (19 bytes off by [dfeuer](https://codegolf.stackexchange.com/users/38603/dfeuer)):
```
main=catch @ErrorCall(print$seq(D$error"")0)mempty
```
---
**Note:** All solutions require `TypeApplications` set.
[Answer]
# Strict, 52 bytes
```
import GHC.IO
f _=print()
main=f$unsafePerformIO$f()
```
[-XStrict](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMHdw1nP058rTSHetqAoM69EQ5MrNzEzzzZNpTSvODEtNSC1KC2/KNfTXyVNQ/P//3/JaTmJ6cX/dSOCS4oyk0sA)
[-XNoStrict](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMHdw1nP058rTSHetqAoM69EQ5MrNzEzzzZNpTSvODEtNSC1KC2/KNfTXyVNQ/P//3/JaTmJ6cX/dSP88oNLijKTSwA)
With `-XStrict`, prints `()` an extra time.
Thanks to @Sriotchilism O'Zaic for two bytes.
[Answer]
# StrictData, 58 bytes
```
import GHC.Exts
data D=D Int
main=print$unsafeCoerce#D 3+0
```
[-XNoStrictData](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMHdw1nPtaKkmCslsSRRwcXWRcEzr4QrNzEzz7agKDOvRKU0rzgxLdU5P7UoOVXZRcFY2@D//3/JaTmJ6cX/df3/60b4JqZnJnskFmcA2X75wSVFmcklLkDDAA)
[-XStrictData](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMHdw1nPtaKkmCslsSRRwcXWRcEzr4QrNzEzz7agKDOvRKU0rzgxLdU5P7UoOVXZRcFY2@D//3/JaTmJ6cX/df3/60b4JqZnJnskFmcA2cElRZnJJS5AowA)
Requires `MagicHash` (to let us import `GHC.Exts` instead of `Unsafe.Coerce`) and `-O` (absolutely required, to enable unpacking of small strict fields).
With `-XStrictData`, prints 3. Otherwise, prints the integer value of the (probably tagged) pointer to the pre-allocated copy of `3::Integer`, which can't possibly be 3.
### Explanation
It will be a bit easier to understand with a little expansion, based on type defaulting. With signatures, we can drop the addition.
```
main=print
  (unsafeCoerce# D (3::Integer)
    :: Integer)
```
Equivalently,
```
main=print
  (unsafeCoerce# $
    D (unsafeCoerce# (3::Integer))
    :: Integer)
```
Why does it ever print 3? This seems surprising! Well, small `Integer` values are represented very much like `Int`s, which (with strict data) are represented just like `D`s. We end up ignoring the tag indicating whether the integer is small or large positive/negative.
Why can't it print 3 without the extension? Leaving aside any memory layout reasons, a data pointer with low bits (2 lowest for 32-bit, 3 lowest for 64-bit) of 3 must represent a value built from the third constructor. In this case, that would require a *negative* integer.
[Answer]
# UnboxedTuples, 52 bytes
```
import Language.Haskell.TH
main=runQ[|(##)|]>>=print
```
Requires `-XTemplateHaskell`. Prints `ConE GHC.Prim.(##)` with [-XUnboxedTuples](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMEnMS@9NDE9Vc8DIqEX4sGVm5iZZ1tUmhcYXaOhrKxZE2tnZ1tQlJlX8v//v@S0nMT04v@6ESGpuQU5iSWpUH1AkdC8pPyK1JSQ0oKc1GIA) and `UnboundVarE ##` with [-XNoUnboxedTuples](https://tio.run/##y0gszk7Nyfn/PzO3IL@oRMEnMS@9NDE9Vc8DIqEX4sGVm5iZZ1tUmhcYXaOhrKxZE2tnZ1tQlJlX8v//v@S0nMT04v@6ESGpuQU5iSWpUH1AEb/80Lyk/IrUlJDSgpzUYgA).
[Answer]
# OverloadedLists, 76 bytes
```
import GHC.Exts
instance IsList[()]where fromList=(():)
main=print([]::[()])
```
With [-XOverloadedLists](https://tio.run/##Pc1LCsIwEAbgfU@RZbLQAxS6Eh8BoVuhdBHTqQ1OkpIZtKc3MiBuP/7H4ugJiLWGuObC6nw57I8bUxMSsUselKVrIB60Gd8LFFBzyVGk09q0pokupG4tIbEexraVnKn142d0D6q7W/@CgtlNMElJ5ISwhTuC/T2I2eSzrCf@6xc) it prints `[()]`. With [-XNoOverloadedLists](https://tio.run/##Pc1LCsIwEAbgfU@RZbLQAxS6Eh8B0a1Quojp1A4mk5IJ2tMbGRC3H/9jdvyEEGrFuKRc1PG02@7Xwg0SF0celOUzcum1Gd4zZFBTTlGk09q0pokOqVsyUtH90LaSM7V@/BTcg@vmdknXF@SQ3Aij1MQOAVa8B7C/DzFLPsk@lb9@AQ) it prints `[]`
This requires the additional flags: `-XFlexibleInstances`, `-XIncoherentInstances`
[Answer]
# [HexFloatLiterals](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#hexadecimal-floating-point-literals), ~~49~~ 25 bytes
*-24 bytes thanks to Ørjan Johansen.*
```
main|(.)<-seq=print$0x0.0
```
Prints `0.0` with `-XHexFloatLiterals` and `0` with `-XNoHexFloatLiterals`.
There are no TIO links because HexFloatLiterals was added in ghc 8.4.1, but TIO has ghc 8.2.2.
[Answer]
# ScopedTypeVariables, 37 bytes
```
main=print(1::_=>a):: ∀a.a~Float=>_
```
This also requires `UnicodeSyntax`,`PartialTypeSignatures`, `GADTs`, and `ExplicitForAll`.
[Try it online (without extension)](https://tio.run/##FY2xCsIwFEV/xVGHCq6BFApaNxFapVu5prE@fCYhidAu4uh3@iHGdrocOId7Q7hr5pQeICOdJxOXGyFamWMlxOL7eWONV8kWUeZtSj91ZfQhZc3JkLKdrkYTMUx8hI8ErkenK@oN4tPr2dsX23re3eCYFMXS@mI6zJqDrZR1upuLMzzhwjr8AQ)
[Try it online (with extension)](https://tio.run/##FY2xCsIwGAZfxVGHCq6BFApaVyFVupXPNNYf/yYhjdAu4uhz@iDGdjoODu6O4WGYU@pBVvpANq53QjQyx0aI1ffzxhavkh2izJuUfvrG6IaU1WdL2rVGTTZinP2EEAlcTd4o6iziM5ilOxb7auFh9EyaYulCMQ@zWmnnTbv0FwTClc3wBw)
### Explanation
The partial type signatures are just to save bytes. We can fill them in like so:
```
main=print(1::(Num a, Show a)=>a):: ∀a.a~Float=>IO ()
```
With scoped type variables, the `a` in the type of `1` is constrained to be the `a` in the type of `main`, which itself is constrained to be `Float`. Without scoped type variables, `1` defaults to type `Integer`. Since `Float` and `Integer` values are shown differently, we can distinguish them.
Thanks to @ØrjanJohansen for a whopping 19 bytes! He realized that it was much better to take advantage of the difference between `Show` instances of different numerical types than differences in their arithmetic. He also realized that it was okay to leave the type of `main` "syntactically ambiguous" because the constraint actually disambiguates it. Getting rid of the local function also freed me up to remove the type signature for `main` (shifting it to the RHS) to save five more bytes.
[Answer]
# DeriveAnyClass, ~~121~~ 113 bytes
Thanks to [dfeuer](https://codegolf.stackexchange.com/users/38603/dfeuer) for quite some bytes!
```
import Control.Exception
newtype M=M Int deriving(Show,Num)
main=handle h$print(0::M);h(_::SomeException)=print 1
```
[-XDeriveAnyClass](https://tio.run/##PY2xDoIwFAB3vqKDAyRqdK1hMGCMAywY42YqPGlj@9q0VcSPt4Ia17vkjjN3BSlDEMpo60mm0Vst55tHDcYLjRFC53sDpEgLskNPGrDiLrCNK667aXlTSaSYwJQzbCQQPjFWoI8XlBbJiscnSiut4N9L0o8nyxBe9UWy1oXZMR@bsMY@k8yNYAsIlknxhKb8/vPfdpBVrQ00@wEemBXsLMG9AQ) prints `1` whereas [-XNoDeriveAnyClass](https://tio.run/##PY6xDoIwFEV3vqKDAyRqdK1hMGCMAywY42YqPGlj@9q0VcSPt4Ia13OScy9n7gpShiCU0daTTKO3Ws43jxqMFxojhM73BkiRFmSHnjRgxV1gG1dcd9PyppJIMYEpZ9hIIHxirEAfLygtkhWPT5RWWsG/l6QfT5YhvOqLZK0Ls2Op87EKa@wzydyItoBgmRRPaMrvg/w3PMiq1gaa/QAPzAp2luDe) prints `M 0`. 
This is exploiting the fact that DeriveAnyClass is the default strategy when both DeriveAnyClass and GeneralizedNewtypeDeriving are enabled, as you can see from the warnings. This flag will happily generate empty implementations for all methods but GeneralizedNewtypeDeriving is actually smart enough to use the underlying type's implementation and since `Int` is a `Num` it won't fail in this case.
---
If printing nothing in case the flag is enabled replacing the `main` by the following would be [**109 bytes**](https://tio.run/##PY1NC4JAEEDv/gqPChmdBYPQiA5KYIduNeikQ7uzyzp92I9vM4qu78F7PQwXVMp70tY4CXPD4oyarx8NWiHDAeNdRothmZXhliVs0dGNuIvq3txn1VXHgQbizDpiiRZpWsanBqTpT5FGbWVM09po/AeT5TH2/tWcFXSDTw7Fp4crHnMFwwdskNGBoie21fdd/JaT3IETArWfaE0dg1wdDm8):
```
main=print(0::M)`catch`(mempty::SomeException->_)
```
[Answer]
# PostfixOperators, 63 bytes
```
import Text.Show.Functions
instance Num(a->b)
main=print(0`id`)
```
[Try it online (without extension)](https://tio.run/##BcExDoMwDADAnVcwwgDiA@3ISJFg6IibBrCa2FFsBK/HvdtBfj4EM4yJs5azv7Sddj7b/iCnyCQFkiiQ8@VwxAqa56cuIiA9UkbSqlvwu9Rmt1sDbGLNe@CRRVe8XslnUM7yBw)
[Try it online (with extension)](https://tio.run/##BcExDoMwDADAnVcwwgDiA2XsWCqVgRGThmKR2FFsVF6PudtAdh@CGcbEWcvRn9p@Nv63z4OcIpMUSKJAzpevI1bQ9EtdREB6pIykVTfjd67NLrcG@Ik105tFVzyH5DMoZ7kB)
This is a cut-down version of [a Hugs/GHC polyglot I wrote](https://codegolf.stackexchange.com/a/180958/38603). See that post for explanation. Thanks to @ØrjanJohansen for realizing I could use `id` instead of a custom operator, saving four bytes.
[Answer]
# DeriveAnyClass, 104 bytes
```
import Control.Exception
newtype M a=M a deriving(Show,Exception)
main=print.displayException$M Deadlock
```
[Try it online (without extension)](https://tio.run/##PY2xDoJAEER7vuIKC02UP6AwYKygobHdcCtsWHYvdxcRP95ToqGYZuZl3gBhROaUaHLqoylVolfOL88OXSSVTHCOi0NTGyi@MRY9PUj6fTvofNy4QzYBSeE8ScwtBcewbOOuNhWCZe3GlN7dnaEP6XRrtFrP8CxLyRDW6oqCHpheaJufuPr7Pg)
[Try it online (with extension)](https://tio.run/##PY0xDsIwEAT7vMIFBUiQH6RAMaIKDQ3tyT6SUy5ny7YI5vEYIlCKbXZHOwPEEZlLocm7kFTrJAXH9elp0CdyUgnOKXtUnYLmG2Ux0IOk314HN@9XbldNQNL4QJJqS9Ez5HXcdEojWHZmLOVt7gx9LIebXq7wKLlliEtxRsEATC@0l59W/20f)
Also requires `GeneralizedNewtypeDeriving`.
[Answer]
# StrictData, 97 bytes
```
import GHC.Generics
data A=A()deriving Generic
main=print$selDecidedStrictness$unM1.unM1$from$A()
```
[Try it online (no strict data)](https://tio.run/##LY07DsIwEER7n8JFiqQAKQdwEWEpNKGhoV3Zm7DCn8hrcXwWI1LOzNObJ/ALQxChuOdS9Xy9nGdMWMix8lBBT2bqB9@KN6VNH5taxn4ZNQxmLTl2jVARKJm9UKodY7DoyKO/1wbXhMwaRD5uDbCxnB63/F9se2jR/vR4uL8)
[Try it online (strict data)](https://tio.run/##LYwxDoMwEAR7v8IFBRSJxANcoFgiDRVN2pN9kFNsg3ynPB/jKJQ7O5o38AdDKIXivmXR4/NxHzFhJsfKg4AezNB2voIvpVVfn5r6duo1dGbJW2yqoSJQMnumJA1jsOjIo5@lypKQWUMph1sCrFxurz@3tV@H/cXxKp8)
Also requires `DeriveGeneric`.
[Answer]
# UnicodeSyntax, 33 bytes
```
(∀)=0
main|forall<-1=print(∀)
```
[Try it online!](https://tio.run/##S0oszvifnFiiYGOjq6Cup65gp5Cml1H8X@NRR4OmrQFXbmJmXk1aflFiTo6NrqFtQVFmXglY7r8eV1FpXnpGsoJuhF9@aF5mcn5KanBlXkliBdgEhCymnMJ/AA "Bash – Try It Online")
[Answer]
# TemplateHaskell, ~~140~~ 91 bytes
Just copied from [mauke](https://github.com/mauke/poly.poly/blob/master/poly.poly) with small modifications. I don't know what's going on.
*-49 bytes thanks to Ørjan Johansen.*
```
import Language.Haskell.TH
instance Show(Q a)where show _=""
main=print$(pure$TupE[]::ExpQ)
```
[Try it online!](https://tio.run/##bY1LCsIwFAD3OcVDCm0XzQFK667QhQjFLgQReYZnE2yTkA/19vGD4MbZDQzMFb1MAgM0TQU5z2ELNy59Uos1LsAO9RRxIt6jv9M887FnSvuAWhAcpFmLAbBcJTkC/1K4tJsNW1Dp1jqlQ1bY6Cgbo@1O57ruHnYoE2cu6kkKqI57M9JiZwz0HXzujIQ0UL35pf9CSE8)
[Answer]
# MonomorphismRestriction, ~~31~~ 29 bytes
Edit:
* -2 bytes with an improvement by H.PWiz
```
f=(2^)
main=print$f$f(6::Int)
```
[-XMonomorphismRestriction](https://tio.run/##y0gszk7Nyfn/P81WwyhOkys3MTPPtqAoM69EJU0lTcPMysozr0Tz//9/yWk5ienF/3UjfPPz8nPziwoyMotzg1KLS4oyk0sy8/MA "Haskell – Try It Online") prints `0`. [-XNoMonomorphismRestriction](https://tio.run/##y0gszk7Nyfn/P81WwyhOkys3MTPPtqAoM69EJU0lTcPMysozr0Tz//9/yWk5ienF/3Uj/PJ98/Pyc/OLCjIyi3ODUotLijKTSzLz8wA "Haskell – Try It Online") prints `18446744073709551616`.
* With the restriction, the two uses of `f` are forced to be the same type, so the program prints `2^2^6 = 2^64` as a 64-bit `Int` (on 64-bit platforms), which overflows to `0`.
* Without the restriction, the program prints `2^64` as a bignum `Integer`.
[Answer]
# ScopedTypeVariables, ~~119~~ 97 bytes
Just copied from [mauke](https://github.com/mauke/poly.poly/blob/master/poly.poly) with small modifications.
Currently there are two other answers for ScopedTypeVariables: [113 bytes by Csongor Kiss](https://codegolf.stackexchange.com/a/153762) and [37 bytes by dfeuer](https://codegolf.stackexchange.com/a/181047).
This submission is different in that it does not require other Haskell extensions.
*-22 bytes thanks to Ørjan Johansen.*
```
class(Show a,Num a)=>S a where s::a->IO();s _=print$(id::a->a)0
instance S Float
main=s(0::Float)
```
[Try it online!](https://tio.run/##dY6xCoMwFAB3v@INBROo4pyqY6GLHVJKt/KMaROIieRFpF@fgkunjnfccCOSyQoTtG0FZV1CD6/aUFYOiZg0YQM8DusMyLteAsJmdNRAQmDVX66Mnwie3RKtTwdmp10jbwrrKaFXGiScXcBUzGh9R6wRYmee6yKu/m0UVI8hSBUWPd0@i75jtDg6TfvHr/lXQP4C)
]