def __getitem__(self, ix):
        is_slice = isinstance(ix, slice)
        if is_slice:
            i = ix.start if ix.stop is None else ix.stop
        else:
            i = ix

        # make sure that the list is evaluated enough to do the indexing, but
        # not any more than necessary
        # if index is negative, evaluate the entire list
        if i >= 0:
            while (i+1) > len(self.__head):
                try:
                    self.__next()
                except StopIteration:
                    break
        else:
            self.__evaluate()

        if is_slice:
            if ix.stop is None and not self.__is_evaluated:
                return List(head=self.__head[ix], tail=self.__tail)
            return List(head=self.__head[ix])
        return self.__head[i]


## Basic typeclass instances for list
dataset/ETHPy150Open billpmurphy/hask/hask/lang/lazylist.py/List.__getitem__/original