I study Haskell and write very simple programs. I want to create a function that will return an element to a given position. Here is what I tried to do -
elempos::Int->[a]->a elempos n (b:_)=head (drop n (b:_) )
But I get this error when I load the Test.hs file in the GHCi editor.
Pattern syntax in expression context: _
And he says that Failed modules are loaded: none. Since I am very new to the language, I really donβt have a good idea of ββwhat the error is (at present, in chapter 4 you will learn that you havekell). Can someone tell me what's wrong here?
source share