mirror of
https://github.com/sdiehl/write-you-a-haskell.git
synced 2024-10-03 22:38:04 +03:00
added failure cases for poly
This commit is contained in:
parent
efae2ed8bb
commit
710d1c8905
@ -250,8 +250,6 @@ Substitution
|
||||
Erasure
|
||||
-------
|
||||
|
||||
The type erasure:
|
||||
|
||||
$$
|
||||
\begin{aligned}[lcl]
|
||||
& \t{erase}(x) &=&\ x \\
|
||||
@ -269,6 +267,6 @@ unbound-generics
|
||||
----------------
|
||||
|
||||
Up until now we've been writing our own binding implementation. There is however
|
||||
a better way
|
||||
a better way to automate writing a lot of the substitution boilerplate.
|
||||
|
||||
\clearpage
|
||||
|
4
chapter7/poly/fail2.ml
Normal file
4
chapter7/poly/fail2.ml
Normal file
@ -0,0 +1,4 @@
|
||||
let f = (\x -> if x then x else (x+1));
|
||||
let g = (\x -> if x then 1 else (x+1));
|
||||
let h = (\x -> if x then (x+1) else 1);
|
||||
let j = (\x -> fix (x 0));
|
Loading…
Reference in New Issue
Block a user