haskell - Implicit pattern matching the first 2 items of a list -


is there way in implicit way:

(originalpath:extractpath:ignoredargs) <- getargs

considering need first 2 args , ignore others anyway.

this curiosity/exploring/learning question (just started haskell), ignoredargs not harm if it's left this.

i tried

(originalpath:extractpath) <- getargs

but fails since extractpath of [string] type (instead of string)

use wildcard, _

(originalpath:extractpath:_) <- getargs 

to ignore after first 2 arguments.

you need have there have 2 names bound strings, , wildcard pattern (underscore) way tell compiler , human readers of code not interested in further arguments.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -