Esempio n. 1
0
def format_funcall(fun: Union[Callable, str], args: tuple,
                   kwargs: dict) -> str:
    from amino.map import Map
    kw = Map(kwargs).map2('{}={!r}'.format)
    a = list(map(repr, args)) + list(kw)
    args_fmt = ', '.join(a)
    return '{}({})'.format(lambda_str(fun), args_fmt)
Esempio n. 2
0
 def _instances(self):
     from amino.map import Map
     return Map({
         Monad: LazyListMonad(),
         Traverse: LazyListTraverse(),
         Foldable: LazyListFoldable(),
         Zip: LazyListZip(),
     })
Esempio n. 3
0
 def _instances(self) -> Map:
     from amino.map import Map
     return Map(
         {
             Monad: EitherMonad(),
             Optional: EitherOptional(),
             Traverse: EitherTraverse(),
             Foldable: EitherFoldable(),
             Zip: EitherZip(),
         }
     )
Esempio n. 4
0
 def _instances(self) -> 'amino.map.Map':
     from amino.map import Map
     return Map({Monad: TmuxIOMonad()})
Esempio n. 5
0
 def vars(self):
     return Map(os.environ)
Esempio n. 6
0
 def _instances(self) -> Dict[type, TypeClass]:
     from amino import Map
     return Map({self.tpe: self.instance})
Esempio n. 7
0
 def instances(self) -> Dict[type, TypeClass]:
     from amino.map import Map
     from amino.tc.tap import Tap
     from amino.tc.show import Show
     return Map({Show: Show(), Tap: Tap()})
Esempio n. 8
0
 def _override_instances(self) -> Dict[type, TypeClass]:
     from amino.map import Map
     return Map()