Difference between revisions of "La ce folosim operatorul !! (dublu semn de exclamare) ?"
Jump to navigation
Jump to search
Tomjaguarpaw (talk | contribs) (Deleting page that hasn't been edited for over 10 years) |
|||
Line 1: | Line 1: | ||
− | [[Category:Ro]] |
||
− | Este folosit pentru a extrage al n-lea element dintr-o lista, n fiind numar intreg. |
||
− | |||
− | '''Iata un exemplu de dialog cu interpretorul:''' |
||
− | |||
− | Prelude> :t (!!) |
||
− | |||
− | (!!) :: [a] -> Int -> a |
||
− | |||
− | Prelude> (!!) [1,2,3,5] 0 |
||
− | |||
− | 1 |
||
− | |||
− | Prelude> (!!) [1,2,3,5] 1 |
||
− | |||
− | 2 |
||
− | |||
− | Prelude> (!!) [1,2,3,5] 2 |
||
− | |||
− | 3 |
||
− | |||
− | Prelude> (!!) [1,2,3,5] 3 |
||
− | |||
− | 5 |
||
− | |||
− | Prelude> (!!) [1,2,3,5] 4 |
||
− | |||
− | Program error: Prelude.!!: index too large |
||
− | |||
− | |||
− | ---- |
||
− | Pagina indexata la indexul [[Category:Ro]] [http://www.haskell.org/haskellwiki/Category:Ro Categories:Ro] |
||
− | ---- |
||
− | [http://www.haskell.org/haskellwiki/Ro/Haskell <= Inapoi la pagina principala Ro/Haskell. ]<br> <br> |
||
− | [http://www.haskell.org/haskellwiki/Intrebarile_incepatorului <'''-''' Inapoi la Intrebarile incepatorului Ro/Haskell. ] |