module Bitcoin.Misc.Strict where
data SMaybe a
= SJust !a
| SNothing
deriving (Eq,Ord,Show)
catSMaybes :: [SMaybe a] -> [a]
catSMaybes = go where
go mbs = case mbs of
(mb:rest) -> case mb of
SJust x -> x : go rest
SNothing -> go rest
[] -> []
data SEither a b
= SLeft !a
| SRight !b
deriving (Eq,Ord,Show)
data SPair a b = SPair !a !b deriving (Eq,Ord,Show)
data STriple a b c = STriple !a !b !c deriving (Eq,Ord,Show)
data SQuad a b c d = SQuad !a !b !c !d deriving (Eq,Ord,Show)
data SList a
= SCons !a !(SList a)
| SNil
deriving (Eq,Ord,Show)