<reponame>running-grass/grass-python<gh_stars>0
from forbiddenfruit import curse

from grass.function import flip, applyFlipped, const, apply, applyN, id, on, compose

from grass.functor import Functor, map, mapFlipped

# 修改内置类型的实现

def list_fmap(self, f):
    res = []
    for x in self:
        res.append(f(x))
    return res

curse(list, "fmap", list_fmap)

Functor.register(list)
from forbiddenfruit import curse

from grass.function import flip, applyFlipped, const, apply, applyN, id, on, compose

from grass.functor import Functor, map, mapFlipped

# 修改内置类型的实现

def list_fmap(self, f):
    res = []
    for x in self:
        res.append(f(x))
    return res

curse(list, "fmap", list_fmap)

Functor.register(list)
# 修改内置类型的实现