ar0 s f as = Ok o flip tuple as o f
-generic gopt a :: Opt a
+generic gopt a *! :: Opt a
gopt{|Bool|} = BinaryFlag (const True) (const False)
gopt{|Int|} = Positionals [\s _->if (and [isDigit c\\c<-:s]) (Ok $ toInt s) (Error ["Not an integer"])]
gopt{|Char|} = Positionals [\s _->if (size s == 1) (Ok s.[0]) (Error ["Not a single character"])]
:: T2 = {f :: Int}
:: C = A Int | B | C
//:: T2 = T Int Int
-derive bimap Opt, [], (,), MaybeError
+derive binumap Opt, [], (,), MaybeError
derive gopt T, T2, C
Start w