rowandavies/sml-cidre — Issue #11: Map won't let me give an instantiation of the type it has
Author: robsimmons
Created: 2011-10-27 14:34:55+00:00
State: open

Truly a "Expected: ?.vector, got: ?.vector" esque error, courtesy of https://github.com/robsimmons/l10/blob/bug6/sml/splitting.sml#L67-70 (which does normal-sml-typecheck). If you can't tell, from the annotation, I played around with this one for awhile, to my increasing disbelief ;-).

```
CIDRE: basis construction error:

/Users/rjsimmon/r/l10/sml/splitting.sml:68.3-68.6 Error:
(map (*[ <: (Term.term_t -> t) -> Term.term_t conslist -> t conslist
^^^
Sort mismatch: ('a -> 'b) -> 'a conslist -> 'b conslist & ('a -> 'b) -> 'a list -> 'b list
expecting: (term_t -> t) -> term_t conslist -> t conslist & (term_t -> t) -> term_t list -> t list
```

Of course, it results from the interaction of polymorphism abstract types that turn out to be invariant.

The workaround is basically expanding the definition of `map` (see https://github.com/robsimmons/l10/blob/master/sml/splitting.sml#L67-68), but... seriously? That's what `map` is there for.