Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Make definition of 'map' work

  • Loading branch information...
puffnfresh committed Dec 5, 2011
1 parent 4039d59 commit 7ff4ac22b2d0a1ebdc80e162f1b1d64ced330c8f
Showing with 6 additions and 1 deletion.
  1. +1 −1 src/typeinference.js
  2. +5 −0 test/map.roy
@@ -425,7 +425,7 @@ var analyse = function(node, env, nonGeneric, data, aliases) {
path.push(index);

var currentValue = value;
for(var x = 0; x < path.length; x++) {
for(var x = 0; x < path.length && path[x] != -1; x++) {
currentValue = prune(currentValue).types[path[x]];
}

@@ -0,0 +1,5 @@
data List a = Empty | Cons a (List a)

let map f l = match l
case (Cons x xs) = Cons (f x) (map f xs)
case Empty = Empty

0 comments on commit 7ff4ac2

Please sign in to comment.
You can’t perform that action at this time.