YAHT: Things I haven’t seen in the text

If there’s a type Foo a b, then it’s possible to access a and b in a function definition through the notation f@(x y):

bar :: Foo a b -> Int
bar f@(x y) = ...

Very handy indeed.

Share

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>