hask.Python.builtins – Python builtins as Hask functions

Typed wrappers for builtin Python functions.

This makes it easier to chain lots of things together in function composition without having to manually add type signatures to Python builtins.

Each function is a TypedFunc replacement of the corresponding Python builtin with the right signature.

hask.Python.builtins.callable()

callable ** (H/ "a" >> bool)

hask.Python.builtins.cmp()

cmp ** (H/ "a" >> "a" >> int)

Note

In Python 3, cmp is not a builtin.

hask.Python.builtins.delattr()

delattr ** (H/ "a" >> str >> None)

hask.Python.builtins.divmod()

divmod ** (H/ "a" >> "b" >> ("c", "c"))

hask.Python.builtins.getattr()

getattr ** (H/ "a" >> str >> "b")

hask.Python.builtins.hasattr()

hasattr ** (H/ "a" >> str >> bool)

hask.Python.builtins.hash()

hash ** (H/ "a" >> int)

hask.Python.builtins.hex()

hex ** (H/ int >> str)

hask.Python.builtins.isinstance()

isinstance ** (H/ "a" >> "b" >> bool)

hask.Python.builtins.issubclass()

issubclass ** (H/ "a" >> "b" >> bool)

hask.Python.builtins.len()

len ** (H/ "a" >> int)

hask.Python.builtins.oct()

oct ** (H/ int >> str)

hask.Python.builtins.repr()

repr ** (H/ "a" >> str)

hask.Python.builtins.setattr()

setattr ** (H/ "a" >> str >> "b" >> None)

hask.Python.builtins.sorted()

sorted ** (H/ "a" >> list)