Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exposition on arrows in haskell

Tags:

haskell

arrows

What would be a good place to go to understand arrows? Ideally, I am just looking for some place with a concise definition with motivation from some good examples, something similar to Wadler's exposition on monads.

like image 224
user8865 Avatar asked Sep 15 '08 17:09

user8865


People also ask

What does -> mean in Haskell?

(->) is often called the "function arrow" or "function type constructor", and while it does have some special syntax, there's not that much special about it. It's essentially an infix type operator. Give it two types, and it gives you the type of functions between those types.

What does arrow do in Haskell?

The Arrow (either (->) or MyArr ) is an abstraction of a computation. For a function b -> c , b is the input and c is the output. For a MyArr b c , b is the input and c is the output.

What does left arrow mean in Haskell?

The left arrow gets used in do notation as something similar to variable binding, in list comprehensions for the same (I'm assuming they are the same, as list comprehensions look like condensed do blocks), and in pattern guards, which have the form (p <- e). All of those constructs bind a new variable.

What is a Haskell Monad?

In Haskell a monad is represented as a type constructor (call it m ), a function that builds values of that type ( a -> m a ), and a function that combines values of that type with computations that produce values of that type to produce a new computation for values of that type ( m a -> (a -> m b) -> m b ).


1 Answers

http://en.wikibooks.org/wiki/Haskell/Understanding_arrows

like image 63
Chris Smith Avatar answered Nov 14 '22 01:11

Chris Smith