Unboxed sums

Run Settings
LanguageHaskell
Language Version
Run Command
{-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedSums #-} module Main ( main ) where import GHC.Int (Int (..)) import GHC.Prim (Int#) type MaybeInt = (# Int# | () #) maybeInt :: a -> (Int# -> a) -> MaybeInt -> a maybeInt _ f (# i | #) = f i maybeInt z _ (# | () #) = z main :: IO () main = do print $ maybeInt 0 I# (# 1# | #) print $ maybeInt 0 I# (# | () #)
Editor Settings
Theme
Key bindings
Full width
Lines