The Soft Side of Software
queue.acm.org
The Soft Side of Software
1–10 of 26 posts
Re: The Soft Side of Software
#2Re: The Soft Side of Software
#3In particular, I suggest his Haskell lectures to anyone interesting by theoretical aspects of functional programming. https://channel9.msdn.com/Series/C9-Lectures-Erik-Meijer-Fun...
Re: The Soft Side of Software
#4 Cont r a = (a -> r) -> r
Prove that this type forms a monad."I'm reading it as 'Container' passed 'r' and 'a' performs 'a' to 'r' which returns 'r'. (I'm guessing on verbs here)..
I've never come across a good way to read these type signatures.
Re: The Soft Side of Software
#5Can anyone help me interpret the type signature Meijer used in his programming question? "Given a generic type: Cont r a = (a -> r) -> r Prove that this type forms a monad." I'm reading it as 'Container' passed 'r' and 'a' performs 'a' to 'r' which returns 'r'. (I'm guessing on verbs here).. I've never come across a good way to read these type signatures.
Re: The Soft Side of Software
#6Can anyone help me interpret the type signature Meijer used in his programming question? "Given a generic type: Cont r a = (a -> r) -> r Prove that this type forms a monad." I'm reading it as 'Container' passed 'r' and 'a' performs 'a' to 'r' which returns 'r'. (I'm guessing on verbs here).. I've never come across a good way to read these type signatures.
Re: The Soft Side of Software
#7Can anyone help me interpret the type signature Meijer used in his programming question? "Given a generic type: Cont r a = (a -> r) -> r Prove that this type forms a monad." I'm reading it as 'Container' passed 'r' and 'a' performs 'a' to 'r' which returns 'r'. (I'm guessing on verbs here).. I've never come across a good way to read these type signatures.
type Cont r a = (a -> r) -> r
Cont is a type constructor that takes two type arguments, r and a. This means that Cont r a can always be substituted by (a -> r) -> r. For example, Cont String Int is equivalent to (Int -> String) -> String(a -> r) is the type of a function from a to r. For example, Int -> Bool is the type of a function from Int to Bool. (a -> r) -> r is the type of a function that takes a function from (a -> r) as its argument and returns an r. So Cont String Int takes a function from Int to String as its argument and finally returns a String.
http://www.haskellforall.com/2012/12/the-continuation-monad.... https://begriffs.com/posts/2015-06-03-haskell-continuations....
Re: The Soft Side of Software
#8Can anyone help me interpret the type signature Meijer used in his programming question? "Given a generic type: Cont r a = (a -> r) -> r Prove that this type forms a monad." I'm reading it as 'Container' passed 'r' and 'a' performs 'a' to 'r' which returns 'r'. (I'm guessing on verbs here).. I've never come across a good way to read these type signatures.
Cont r a is a computation that knows how to produce an "a" but, instead of returning it directly, passes it to a function that takes the "a" and produces an "r".
Compared to typical sequential execution, this gives more power to the "current" phase of the computation, because it might choose to invoke the passed a -> r function more than one time, none at all, inspect the resulting "r" and change course based on the result, etc.
Re: The Soft Side of Software
#9Re: The Soft Side of Software
#10Can anyone help me interpret the type signature Meijer used in his programming question? "Given a generic type: Cont r a = (a -> r) -> r Prove that this type forms a monad." I'm reading it as 'Container' passed 'r' and 'a' performs 'a' to 'r' which returns 'r'. (I'm guessing on verbs here).. I've never come across a good way to read these type signatures.
Cont stands for Continuation. A continuation basically represents a 'suspended' computation with an intermediate result of type 'a' and final result of type 'r' type Cont r a = (a -> r) -> r Cont is a type constructor that takes two type arguments, r and a. This means that Cont r a can always be substituted by (a -> r) -> r. For example, Cont String Int is equivalent to (Int -> String) -> String (a -> r) is the type…