@@ -332,6 +332,8 @@ primitives =
332332 (2, LStrEq) total,
333333 Prim (UN "prim__ltString") (ty [StrType, StrType] IType) 2 (bsBin (<))
334334 (2, LStrLt) total,
335+ Prim (UN "prim_lenString") (ty [StrType] IType) 1 (p_strLen)
336+ (1, LStrLen) total,
335337 -- Conversions
336338 Prim (UN "prim__strToInt") (ty [StrType] IType) 1 (c_strToInt)
337339 (1, LStrInt) total,
@@ -622,6 +624,7 @@ p_floatSqrt = p_fPrim sqrt
622624p_floatFloor = p_fPrim (fromInteger . floor)
623625p_floatCeil = p_fPrim (fromInteger . ceiling)
624626
627+p_strLen [VConstant (Str xs)] = Just $ VConstant (I (length xs))
625628p_strHead [VConstant (Str (x:xs))] = Just $ VConstant (Ch x)
626629p_strHead _ = Nothing
627630p_strTail [VConstant (Str (x:xs))] = Just $ VConstant (Str xs)