HUYIJDOWWQLSKZUJ5LLC5YOFYBDXLP7T3SPQJIWKX5SLW5VDSMSAC
DORURVCGBXEF3DMKG6PFOKVPCO6I7ZZKUGRQP5VO5MBAG6GEE4MAC
H5ZMKSRCKHPZZTZ6ITFKMDWSF25AIJZBEKX6SD77NBHW7ZFX3DSQC
5FL4GFXIQJ3P7U5DD7VUEZHNZTTN7DERSUBQ64JZEPLU4PRX4K5QC
ZJ6BESB2ZX5KZWQRANKZFHPP64H3WQHF56PMFFMZIKVSIZSX3SXAC
BFH72ISNORLFYPNB5SKVOG36JUXY2NAYHQZ6SMQIUUG4PB4EKVLAC
NZ2SHCLDVMHP4MN4ZIVSABSBXKVC6WYMTR7YPVA5AH6VUREXH37AC
4YZYDSDVJFE7RB47LPOUIOQ3U5XBTSJ53UG4TY42VXZI7O3NX7AAC
F3PSUKWXAFKSWPWD4OFGDMMOPGRZVLJWWHNWOHRDP677PZVFTRIQC
withSomeSSymbol currency $ \(ss :: SSymbol s) ->
withKnownSymbol ss (SomePosMoney @s (PosMoney amount))
-- mkSomePosMoney currency amount = withSomeSSymbol currency $ \ss -> withKnownSymbol ss (SomePosMoney (PosMoney amount))
-- mkSomeMoney :: forall (c :: Symbol). Pos -> SomePosMoney
-- mkSomeMoney :: forall c. KnownSymbol c => Pos -> SomePosMoney
-- mkSomeMoney = SomePosMoney @c . PosMoney
withSomeSSymbol currency $ \(ss :: SSymbol s) -> SomePosMoney ss (PosMoney amount)
getCurrency' :: SomePosMoney' -> String
getCurrency' (MkSomePosMoney' s m) = withKnownSymbol s $ symbolVal m
-- getCurrency (SomePosMoney SSymbol) = fromSSymbol $ symbolSing
-- mkMoney :: SomeSymbol -> Int -> Income c
-- mkMoney = undefined
mkIncome :: Int -> App (PosMoney "USD")
mkIncome input = liftEither . mapLeft (const NegativeIncome) $ eitherPos input >>= return . PosMoney @"USD"
mkIncome :: Int -> String -> App (SomePosMoney)
mkIncome input currency = do
pos <- liftEither . mapLeft (const NegativeIncome) $ eitherPos input
return $ withSomeSSymbol currency $ \curr -> SomePosMoney curr (PosMoney pos)