double exclamation marks in haskell -
i have code:
ghci>let listoffuns = map (*) [0..] ghci>(listoffuns !! 4) 5 20
what !! mean?
i saw example double exclamation this:
ghci> [1,2,3,4]!!1 ghci> 2
but seems don't apply question example.
- how understand function. need explanations.
!!
indexes lists. takes list , index, , returns item @ index. if index out of bounds, returns ⊥.
Comments
Post a Comment