[Haskell-beginners] The (x:xs) in function parameter is a tuple?
bayesragem at gmail.com
Thu Feb 25 04:35:02 UTC 2016
The way I learned it:
A tuple type is defined by the types inside it, so an (int,int) is not the same type as an (int, maybe(int)). With a one-tuple the type would just be (int) and that provides zero benefit.
Instead of trying to do `first (...my expression...)` to get the first element of the one tuple, it just becomes the value inside.
Sent from my iPhone
> On Feb 24, 2016, at 7:02 PM, Imants Cekusins <imantc at gmail.com> wrote:
> My guess is: tuple must contain 2+ elements.
> Try to enter (1) in ghci. It is displayed as 1
> Parentheses are only recognized as a tuple if there are elements separated by a comma. Otherwise an expression is assumed.
> Beginners mailing list
> Beginners at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners