One other option is to import the package Control.Lens
.
>>> import Control.Lens
>>> let movie = ( "The Terminator"
, "James Cameron"
, ["Arnold Schwartzenegger", "Michael Biehn"]
, 1984
,"Science Fiction"
, 19.99)
>>> movie ^. _1
"The Terminator"
>>> movie ^. _4
1984
I wouldn't recommend that you do this though. Use record syntax instead.
data Movie = Movie
{ title :: String
, director :: String
, mainActors :: [String]
, releaseDate :: Int
, genre :: String
, price :: Double
} deriving (Eq,Ord,Show)
Now you can do
>>> let movie = Movie "The Terminator" "James Cameron"
["Arnold Schwartzenegger", " Michael Biehn"]
1984 "Science Fiction" 19.99
>>> title movie
"The Terminator"
>>> releaseDate movie
1984