repositories
/
cc1516.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ding
[cc1516.git]
/
examples
/
Markus
/
identity(2).spl
diff --git
a/examples/Markus/identity(2).spl
b/examples/Markus/identity(2).spl
index
96232a2
..
04ff196
100644
(file)
--- a/
examples/Markus/identity(2).spl
+++ b/
examples/Markus/identity(2).spl
@@
-1,18
+1,18
@@
-//
Various versions of the identity function
+//
// Various versions of the identity function//
// Identity for integers
// The type signature forces the function to have a more concrete type than it could have.
id_int(x) :: Int -> Int
{
return x;
// Identity for integers
// The type signature forces the function to have a more concrete type than it could have.
id_int(x) :: Int -> Int
{
return x;
-}
-
+}
//
+////
// Polymorphic identity with type signature
id_poly_with(x) :: a -> a
{
return x;
// Polymorphic identity with type signature
id_poly_with(x) :: a -> a
{
return x;
-}
+}
//////
// Polymorphic identity without type signature
// Polymorphic identity without type signature
@@
-20,7
+20,7
@@
id_poly_with(x) :: a -> a
id_poly_without(x)
{
return x;
id_poly_without(x)
{
return x;
-}
+}
//
// Clumsy polymorphic identity
// Clumsy polymorphic identity
@@
-31,7
+31,7
@@
id_poly_wtf(x)
var b = a;
var c = b;
return c;
var b = a;
var c = b;
return c;
-}
+}
//
// Clumsy identity for integers
// Clumsy identity for integers
@@
-43,3
+43,5
@@
id_int_wtf(x)
var c = b;
return c;
}
var c = b;
return c;
}
+
+main() {return;}
\ No newline at end of file