xs'
would be bound to the string "ello"
.
xs
would be bound to the string "hello"
.
The @
pattern lets you give a name to a variable while also matching its structure and possibly giving name to the components.
More Related Contents:
- Haskell: Parse error in pattern
- Pattern matching identical values
- Haskell GHC: what is the time complexity of a pattern match with N constructors?
- Can I match a data constructor wildcard in Haskell?
- Haskell \p -> not takeWhile
- Sum of two numbers with function in haskell
- How to group similar items in a list using Haskell?
- How do I deal with many levels of indentation?
- Memoization in Haskell?
- Wrong IO actions order using putStr and getLine
- Difference between `data` and `newtype` in Haskell
- How do functors work in haskell?
- double stream feed to prevent unneeded memoization?
- Currying subtraction
- Haskell: how to evaluate a String like “1+2”
- Why does haskell’s bind function take a function from non-monadic to monadic
- Difference between Monad and Applicative in Haskell
- Why is lazy evaluation useful?
- Using Maybe type in Haskell
- Composing Monads v. Applicative Functors
- Abusing the algebra of algebraic data types – why does this work?
- What does the : infix operator do in Haskell?
- Why should Applicative be a superclass of Monad?
- Monoidal Functor is Applicative but where is the Monoid typeclass in the definition of Applicative?
- How to return a pure value from a impure method
- How to convert Unicode Escape Sequence to Unicode String in Haskell
- Functional lenses
- How to reuse a type variable in an inner type declaration
- How to compare two functions for extensional equivalence, as in (λx.2*x) == (λx.x+x)?
- How does Haskell printf work?