projects
/
lambda.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b04c88a
)
(no commit message)
author
chris
<chris@web>
Sun, 15 Mar 2015 17:26:22 +0000
(13:26 -0400)
committer
Linux User
<ikiwiki@localhost.members.linode.com>
Sun, 15 Mar 2015 17:26:22 +0000
(13:26 -0400)
exercises/_assignment6.mdwn
patch
|
blob
|
history
diff --git
a/exercises/_assignment6.mdwn
b/exercises/_assignment6.mdwn
index
50e89ac
..
b6a00de
100644
(file)
--- a/
exercises/_assignment6.mdwn
+++ b/
exercises/_assignment6.mdwn
@@
-134,8
+134,8
@@
piece, which we can think of as a function from a type to a type.
Call this type function M, and let P, Q, R, and S be variables over types.
Recall that a monad requires a singleton function 1:P-> MP, and a
Call this type function M, and let P, Q, R, and S be variables over types.
Recall that a monad requires a singleton function 1:P-> MP, and a
-composition operator >=>: (P->MQ) -> (Q->MR) -> (P->MR) [t
yp
e type for
-the composition operator corrects a "type"-o from the class handout]
+composition operator >=>: (P->MQ) -> (Q->MR) -> (P->MR) [t
h
e type for
+the composition operator
given here
corrects a "type"-o from the class handout]
that obey the following laws:
1 >=> k = k
that obey the following laws:
1 >=> k = k
@@
-170,7
+170,7
@@
Show your composition operator obeys the monad laws.
'a, let the boxed type be a list of objects of type 'a. The singleton
is `\p.[p]`, and the composition operator is
'a, let the boxed type be a list of objects of type 'a. The singleton
is `\p.[p]`, and the composition operator is
- >=> (first:P->[Q]) (second:Q->[R]) :(P->[R]) = fun p -> [r | q <- first p, r <- second q]
+
>=> (first:P->[Q]) (second:Q->[R]) :(P->[R]) = fun p -> [r | q <- first p, r <- second q]
Sanity check:
Sanity check: