encode :: String -> String
encode xs =
let s = normalize xs
in case s of
[] -> []
_ -> encode' s row col
where row = isqrt (length s)
col = length s `div` row
This gives the error "Variable not in scope: s". It seems the where clause within let..in can't see the variable s defined earlier.
How can I rewrite this?