{-# language DataKinds #-}
{-# language ScopedTypeVariables #-}
{-# language ViewPatterns #-}
{-# language RankNTypes #-}
{-# language KindSignatures #-}
{-# language PatternSynonyms #-}
{-# language MagicHash #-}
{-# language GADTSyntax #-}
{-# language UnliftedNewtypes #-}
{-# language UnboxedTuples #-}
module Data.Either.Void
( EitherVoid#(..)
, pattern LeftVoid#
, pattern RightVoid#
) where
import GHC.Exts
newtype EitherVoid# :: TYPE ('TupleRep '[]) -> TYPE ('TupleRep '[]) -> TYPE 'WordRep where
EitherVoid# :: forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])). Word# -> EitherVoid# a b
{-# COMPLETE RightVoid#, LeftVoid# #-}
pattern RightVoid# :: b -> EitherVoid# a b
pattern $bRightVoid# :: forall (b :: TYPE ('TupleRep '[])) (a :: TYPE ('TupleRep '[])).
b -> EitherVoid# a b
$mRightVoid# :: forall {r} {b :: TYPE ('TupleRep '[])} {a :: TYPE ('TupleRep '[])}.
EitherVoid# a b -> (b -> r) -> ((# #) -> r) -> r
RightVoid# a <- (helperRight -> (# 1##, a #)) where
RightVoid# b
_ = forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])).
Word# -> EitherVoid# a b
EitherVoid# Word#
1##
helperRight :: forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])).
EitherVoid# a b -> (# Word#, b #)
{-# inline helperRight #-}
helperRight :: forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])).
EitherVoid# a b -> (# Word#, b #)
helperRight (EitherVoid# Word#
x) =
(# Word#
x, (unsafeCoerce# :: forall a b. a -> b
unsafeCoerce# :: (# #) -> b) (# #) #)
pattern LeftVoid# :: a -> EitherVoid# a b
pattern $bLeftVoid# :: forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])).
a -> EitherVoid# a b
$mLeftVoid# :: forall {r} {a :: TYPE ('TupleRep '[])} {b :: TYPE ('TupleRep '[])}.
EitherVoid# a b -> (a -> r) -> ((# #) -> r) -> r
LeftVoid# a <- (helperLeft -> (# 0##, a #)) where
LeftVoid# a
_ = forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])).
Word# -> EitherVoid# a b
EitherVoid# Word#
0##
helperLeft :: forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])).
EitherVoid# a b -> (# Word#, a #)
{-# inline helperLeft #-}
helperLeft :: forall (a :: TYPE ('TupleRep '[])) (b :: TYPE ('TupleRep '[])).
EitherVoid# a b -> (# Word#, a #)
helperLeft (EitherVoid# Word#
x) =
(# Word#
x, (unsafeCoerce# :: forall a b. a -> b
unsafeCoerce# :: (# #) -> a) (# #) #)