jasondelaat / pymonad

PyMonad implements data structures typically available in pure functional or functional first programming languages like Haskell and F#. Included are Monad and Monoid data types with several common monads included - such as Maybe and State - as well as some useful tools such as the @curry decorator for defining curried functions. PyMonad 2.x.x represents an almost complete re-write of the library with a simpler, more consistent interface as well as type annotations to help ensure correct usage.
BSD 3-Clause "New" or "Revised" License
194 stars 21 forks source link

Update list.py #28

Open John-J-Riehl opened 1 year ago

John-J-Riehl commented 1 year ago

Found an error when slicing a ListMonad.

my_list = ListMonad(1)
print(my_list[:-1]) # should be [], actually raises UnboundLocalError on line 84 in list.py

I believe the change I made will fix this.