Description
You can't bind polymorphic terms at the syntactic top level:
f <- return concat;
produces
% saw test.saw
[22:19:20.624] Loading file "test.saw"
[22:19:20.625] Stack trace:
Not a monomorphic type: [t.5] -> [t.5] -> [t.5]
It's not clear what the reason for this restriction might be. One might guess it was cargo-culted from Haskell's monomorphism restriction. Based on https://www.haskell.org/onlinereport/haskell2010/haskellch4.html#x10-930004.5.5, there are roughly speaking three reasons for the monomorphism restriction: confusing lazy evaluation behavior (SAWScript doesn't have lazy evaluation, and besides, the behavior in question is perfectly sound); certain ambiguous cases arising from typeclass constraints (SAWScript doesn't have typeclasses); and other ambiguous cases arising from having modules (SAWScript has no module system). Therefore, there's no need for any related constraint in SAWScript.
Unless some other reason appears, this restriction should be removed.
(This point has come up before, e.g. when I was fixing the typechecker, but I can't find an existing issue about it.)