[Haskell-beginners] Understanding some notation
edwards.benj at gmail.com
Mon Jun 27 00:55:53 CEST 2011
On 26 June 2011 23:48, Jack Henahan <jhenahan at uvm.edu> wrote:
> I know the type signature of (++), I'm just not seeing `n` as a list, I
> suppose. I'm reading it as being the Int that is passed to splitAt, though
> perhaps my thought process is just wonky.
Look at the type of splitAt, the answers are all in the types :)
splitAt :: Int -> [a] -> ([a],[a])
So when you do a case match on the result of
splitAt x (y:ys)
you must be matching on a tuple of lists, because that's what the return
type of the list is
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners