@@ -332,6 +332,8 @@ primitives =
332 (2, LStrEq) total,
332 (2, LStrEq) total,
333 Prim (UN "prim__ltString") (ty [StrType, StrType] IType) 2 (bsBin (<))
333 Prim (UN "prim__ltString") (ty [StrType, StrType] IType) 2 (bsBin (<))
334 (2, LStrLt) total,
334 (2, LStrLt) total,
335+ Prim (UN "prim_lenString") (ty [StrType] IType) 1 (p_strLen)
335 -- Conversions
337 -- Conversions
336 Prim (UN "prim__strToInt") (ty [StrType] IType) 1 (c_strToInt)
338 Prim (UN "prim__strToInt") (ty [StrType] IType) 1 (c_strToInt)
337 (1, LStrInt) total,
339 (1, LStrInt) total,
@@ -622,6 +624,7 @@ p_floatSqrt = p_fPrim sqrt
622p_floatFloor = p_fPrim (fromInteger . floor)
624p_floatFloor = p_fPrim (fromInteger . floor)
623p_floatCeil = p_fPrim (fromInteger . ceiling)
625p_floatCeil = p_fPrim (fromInteger . ceiling)
627+p_strLen [VConstant (Str xs)] = Just $ VConstant (I (length xs))
625p_strHead [VConstant (Str (x:xs))] = Just $ VConstant (Ch x)
628p_strHead [VConstant (Str (x:xs))] = Just $ VConstant (Ch x)
626p_strHead _ = Nothing
629p_strHead _ = Nothing
627p_strTail [VConstant (Str (x:xs))] = Just $ VConstant (Str xs)
630p_strTail [VConstant (Str (x:xs))] = Just $ VConstant (Str xs)